rofi menu with icons
Here is a quick command to show menu (applications) in simplistic windows managers with icons.
rofi -modi drun -show drun -show-icons
Here is a quick command to show menu (applications) in simplistic windows managers with icons.
rofi -modi drun -show drun -show-icons
Lot of times you want to check the disk rpm, especially on the servers to check if it is 7.2K or 10K or 15K rpm disk. How do you do this from linux terminal. Here it is :
sginfo -g /dev/<device>
Note that sginfo comes from sg3-utils.
Lot of times, you have to ssh to a server with bastion host. If you dont know what is bastion host then see this:
Now, in such cases, either you add an entry in “~/.ssh/config” to route the ssh through the bastion host or do ssh to bastion host and then ssh from there to the actual host. But wait, there is always a better way:
Continue readingSometime back I posted about terminal.sexy – make your teminal sexy. I personally use URxvt terminal and hence need the xrdb files to apply the theme. It’s pain to go to the website everytime I want to change my theme and hence I wrote a python script that can use the github repo and convert the files to xrdb files. Here is the link to the script:
terminal.sexy script for xrdb
Color Scheme for Gnome Terminal and Pantheon Terminal – here is the github page
With both wayland and X11 in mainstream, its pretty easy to forget if you are running in Wayland or in X11. To check this here are the commands:
loginctl list-sessions # The above command will show you all the sessions. Note the session number for your session loginctl show-session <session number> -p Type
Here is a script that can use tshark to split a large pcap to multiple small pcaps
inpcap="test.pcap"
max=$(tshark -r $inpcap -n -T fields -e frame.number|tail -1)
# This is the number of packets in each split pcap
c=1
# Save all new pcaps to out, if it does not exist, create it.
[[ ! -d out ]] && mkdir out
for i in $(seq 1 $max $c)
do
tshark -r $inpcap -n -c $c "frame.number==$i" -w out/$i.pcap
#Do other stuff, if required
read -p "Send the next packet? "
done
A very simple 3-4 line script that has saved my day so may times.
Continue reading