bash
scripting – performance improvement with file open
2020/04/20
Sometimes just one line of code can make all the difference. I will show you with example. Here is script with 2 functions. Both are writing some lines of text to a file. First function, “a” I have …
using cat with grep – why?
2020/01/06
Get the git url of current repo in clipboard
2019/12/30
Lot of times, I just want to copy the git url to clipboard. This is so common in my flow of work that I created an alias for it. Here it is:
Script to try various themes from kitty terminal
2019/12/16
Here is the script. Very simple yet very useful script.
scan your network with bash IP scan script
2019/10/10
Here is the youtbe video that will walk you through bash script.
ssh trick – ssh to remote host with bastion host
2019/09/16
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 …
View xml files like a pro
2019/08/05
Viewing XML files can be daunting with tracking mentally where the tag starts and where it ends. So, I ended up with the following alias to help me view xml files
Add files to dropbox with single curl command
2019/07/08
I have been thinking of posting this for sometime now. This is very useful, when you are working on a different Linux box and want to upload a file to dropbox. So, before you run this command, you …
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 …
GREP_COLORS – change the colors in the GREP output.
2019/04/22
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options …
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 …