How to use inotify-tools to trigger scripts on filesystem events

How to use inotify-tools to trigger scripts on filesystem eventsIn my last example of Bash if statements we created a backup script which would run “rsync” as per the time set in a cron. But wouldn’t it be nice if we could run our “rsync” script only if there was a change to the files in our directory instead of running a cron every... Read More »

How to display a changing output like top

In my earlier post on linux memory management, I showed you how you can get the exact memory usage of your script by using py_mem.py. This script, without any options will run once and give you the current memory usage of the system. But what if you wanted real time memory usage?, In other words,... Read More »

Advance text processing examples in awk

Advance text processing examples in awkLast week I was reading up on awk and was fascinated by its text processing capabilities despite been written more than 3 decades ago. Although, I mostly use awk for printing columns while troubleshooting a DDOS attack or to find high number of connections from an IP, netstat -ntu | awk '{print $5}' | cut... Read More »

Bash If statements, Exit Status and Comparison Operators, A beginners guide to bash scripting part 2

Bash If statements, Exit Status and Comparison Operators, A beginners guide to bash scripting part 2In my previous post we looked at a simple bash backup script example, which would sync data between servers using “rsync” and then send us an email. The only problem with this script is if “rsync” fails, we would still get a successful email. Now I am sure you don’t want to find out on... Read More »

A simple way to install and configure puppet on CentOS 6

A simple way to install and configure puppet on CentOS 6Puppet is an automation tool which allows you to automate the configuration of software like apache and nginx across multiple servers. Puppet installation In this tutorial we will be installing Puppet in the Puppet/Agent mode.You can install it in a Stand Alone mode as well. OS & software Versions Centos 6.5 Linux kernel 2.6.32 Puppet... Read More »

An Amateur’s guide to Bash scripting

An Amateur’s guide to Bash scriptingBash scripts are one of the easiest linux programming languages to learn. Bash scripts are handy when you want to automate tasks like a server backup or email the IP address of your Raspberry Pi server on boot. In this post you will see how to write a simple bash script and then proceed to... Read More »