Script to try various themes from kitty terminal

2019-12-16 1 min read bash Learning
Here is the script. Very simple yet very useful script. #!/bin/bash - #=============================================================================== # # FILE: kitty-theme.sh # # USAGE: ./kitty-theme.sh # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka), # ORGANIZATION: Individual # CREATED: 12/06/2019 10:15 # Last modified: Fri Dec 06, 2019 10:41AM # REVISION: --- #=============================================================================== set -o nounset # Treat unset variables as an error FOLDER=" Continue reading

i3 – show mapped hotkeys

2019-12-02 1 min read Learning
Here is a simple script that can show you the hotkeys bound in ~/.config/i3/config : #!/bin/bash - #=============================================================================== # # FILE: i3-showkeys.sh # # USAGE: ./i3-showkeys.sh # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Amit Agarwal (aka) # ORGANIZATION: Individual # CREATED: 11/26/2019 14:22 # Last modified: Tue Nov 26, 2019 02:43PM # REVISION: --- #=============================================================================== set -o nounset # Treat unset variables as an error > /tmp/keys cd ~/. Continue reading

Add files to dropbox with single curl command

2019-07-08 1 min read bash
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 need to create your auth token in Dropbox developer API page. Once that is done, need to change the 2 parameters in command below. Export your Access token and run the below command. Continue reading

Split pcap to multiple files based on number of packets

2019-06-03 1 min read bash Learning Linux
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 " Continue reading

libvirt- Create virtual machine with text console only interface

2019-05-27 1 min read Linux Vurtualization
virt-install is an amazing tool to create VMs. If you have created a config file (Kickstart file – ks.cfg), then its only one line un-attended install. If you are using this on remote host with ssh and unluckily cannot export display – what do you do. Do a non-graphical install. There are only minor changes in the command to tell the installer that there is no graphics available and it is amazing, is it not 🙂 Continue reading

Port php mysql scripts to php 7.0 from 5.x version

2018-04-23 2 min read Learning
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 thought it would be waste of time to change them manually and wrote a script to fix them. If you have similar situation then probably this few lines could help you. Since my scripts did not use all the functions so I did not put the sed commands for all of them but you get the idea 🙂 Continue reading
Older posts