Learning
Running dnsmasq with NetworkManager in Fedora
2019/06/10
Here is a good link to do this: https://fedoramagazine.org/using-the-networkmanagers-dnsmasq-plugin/
Split pcap to multiple files based on number of packets
2019/06/03
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 …
copy /proc folder
2019/03/18
Other day, I was trying to copy the proc folder with following command: tar cvzf /tmp/proc.tgz /proc and I found out that all the files in tar were empty. Strange it may seem but lot of people are …
cool sed/grep magic to convert output to csv format
2019/03/11
I generallly keep doing this a lot, so thought will share with you. Lets assume we are capturing free ouput every min/hour/or whatever. The output looks like this: […] Time: Mon Jan 21 23:59:10 …
bash function for rpm whatprovides
2018/12/31
Sometimes some simple one-liner function can save you a lot of time, like-
xev – Check the X keyboard events
2018/11/19
xev man page […] xev – print contents of X events […] So other day I was checking why my play key was not working and wanted to check if it maps to one of the X default mappings for the …
ranger – try terminal file manager
2018/06/11
ranger is a terminal file manager, just install and run and have some fun. Tip: You might want to try it on uxrvt terminal and in Photos folder once.
Display IP address in console login screen
2018/04/30
Here is one liner that will add the current IP address in the console login screen (if you are not running X as is case for servers): (ip -o -4 a| awk '$2 !="lo" {print "\nIP Address ::"$4}' |tr '\n' …
Port php mysql scripts to php 7.0 from 5.x version
2018/04/23
Recently I got a script or series of scripts that were written for PHP 5.6x and hence used mysql_connect which as you know by now does not work with PHP 7.0. Since there were number of scripts, I …
Monitor progress of coreutils commad like mv, cp etc
2018/04/02
Monitor progress of coreutils commad like mv, cp etc You can use command called “progress”. Other option is “pv” but that is little complicated so here is simpler option. […] Progress – A …
Send history of current host to some other host over ssh
2018/02/26
Sometimes I want to save the history of current host on another host. This is to ensure that I can use copy/paste on other host to run the commands. To this, I found a simple solution – history| ssh …
Fix display size on libvirt/Qemu guest
2017/05/22
Lot of times I find myself of VM that does not correctly resize the screen display and that is literally nuisance. So, here is quick and dirty fix for this. First you need to find out information …