Category Archives: Shell

Hosts Based Load-Balancing in AIX

The following script allows you to update your /etc/hosts file in a regular interval. By configuring a hostname and list of IPs, you can distribute requests to several hosts over time automatically. All you have to do is configure this script, add it to your crontab file, and point your application or script to the configured hostname. In… Read More »

Boot into Windows on Ubuntu Dual-Boot via Command Line

Frequently found myself needing a way to remotely boot into Windows from a Ubuntu dual-boot machine. Looking at grub.cfg, I found there was only one “windows” option, so the following command allowed me to remotely boot into that partition via command line: sudo grub-reboot “$(grep -i ‘windows’ /boot/grub/grub.cfg|cut -d”‘” -f2)” && sudo reboot You can create a shell… Read More »

Remove directories that start with a number

The linux shell script below comes in quite handy when you need to delete all folders that start with a number in a path that contains other folders you don’t want to remove. The script contains some logic to only run as root and stop/start a service if needed. Also, I’ve included a sample crontab line to run… Read More »