Pages

Thursday 27 February 2020

How to send command to specific pane in tmux

I was looking for a way of launching process in tmux split screen mode where one part of the terminal shows log entries and another starting sequence. I found a script in internet but was having problems locating a pane. So first I had to figure out correct pane locations. To do this execute following command:


tmux list-panes –a

This gave me indication that window id is equal 1 and not 0 as indicated in tmux status bar.

Then it went easy, just go with following bash script:

#!/bin/bash
session="my name"
window=${session}:1
pane=${window}.1
echo $pane
tmux send-keys -t "$pane" C-z 'test cmd 1' Enter
tmux send-keys -t "$pane" 'test cmd 2' Enter

Thursday 20 February 2020

Linux how to check progress of DD

Few days ago I decided to install linux on Lenovo Yoga 1051f which is a Windows 10 tablet. First I wanted to create backup of existing system. This tablet has only 1 micro USB port so I had to use USB hub. I executed DD command for entire disk, that was about 32GB.

dd if=/dev/sdb of=/dev/sdc
After an hour or so I became curious about the progress. I expected this to be quick thing while it was very slow. Probably I should have done something like this:
dd if=/dev/sdb of=/dev/sdc status=progress
Copying was in progress and I didn't want to abort it. After doing some research I found a comment saying that I can open another terminal window and execute kill command there, then terminal where DD is running would show the progress. This indeed worked. In theory this should work too:
sudo kill -USR1 $(pgrep ^dd)

Happy dd-ing!

Saturday 1 February 2020

How to change Time Zone on Oracle Linux (Working)

I tried multiple commands from different posts which ran correctly but didn't change Time Zone permanently. I figured out following steps in order to change Time Zone info on Oracle Linux:

1. Run tzselect (this will return timezone name)
2. Run timedatectl set-timezone OUTPUT_OF_ABOVE

Then execute date to confirm if it worked.