scripting – performance improvement with file open


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 …

Get the git url of current repo in clipboard


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


Here is the script. Very simple yet very useful script.

scan your network with bash IP scan script


Here is the youtbe video that will walk you through bash script.  

ssh trick – ssh to remote host with bastion host


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 …

View xml files like a pro


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


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


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.


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


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


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 …

This website uses cookies to ensure you get the best experience on our website. Learn more Got it