automation
How Vim Can Make a Hacker’s Life Easier with Macros and Registers
2025/03/09
Explore how Vim’s macros and registers can streamline repetitive tasks, making life easier for hackers, pentesters, and security researchers.
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 …
send mail using telnet from script
2017/12/25
If you have no other option but to use telnet with authentication to send mail 🙂
ansible with docker dynamic inventory
2017/01/09
So, I have a few dockers. Every now and then I want to run some command on all of them. Doing ‘docker exec’ is tiresome. I found this neat solution with ansible that I thought I should share with you. …
Executing commands on multiple hosts
2015/09/21
If you have to execute the same command in multiple hosts, then you can use mussh: […] First install mussh with the following command dnf install mussh Now to run this for multiple hosts, you …
script to get hard disk health in fedora/ubuntu
2014/12/01
First, put this in a script. #!/bin/bash #Change as appropriate HDD=sda export sub="SmartCtl data for HDD" echo 'To: <Your Email> Sub: [Cron] $sub MIME-Version: 1.0 Content-Type: text/html …
Quick tip on zipping logs in real time.
2010/10/13
Sometimes, some small things that we don’t actually think can be useful are such useful. I faced this couple of days back when I was working on something and the amount of logs getting generated and …
Delete Files older than 14 days
2010/06/25
Taken from Dzone. […] @echo on setlocal set srcDir=. […] Read more: <a href="http://snippets.dzone.com/posts/show/10441">http://snippets.dzone.com/posts/show/10441
bash one liner to change/remove test pattern from config file or text file.
2010/06/25
Problem: I had a directory with a lot of config files in the ini file format, i.e. name and value separated by equals. Some/all of these contained some directory names and other values which had to be …
Script to add all the partitions to the fstab.
2010/06/24
I wrote a simple script today to get all the partitions on all the disks and then create <a class="zem_slink freebase/en/fstab" title="Fstab" rel="wikipedia" …
bash script to change icon theme to check out all the installed themes (personal)
2010/05/19
I am really annoyed with the time that is required and the number of clicks that it takes to change the gnome icon theme. So here’s a small script that I wrote to quickly check out all the …
bash script to periodically change the cursor theme.
2010/05/07
#!/bin/bash [[ ”$1” == ”” ]] && time=5 || time=$1 [[ ”$2” == ”” ]] && ( cd ~/.icons …