DevOps

“Foolproof Your Bash Script” – Some Best Practices

I am a DevOps practitioner and a lazy one too, so whenever we come across any task that needs to be repeated, we create a bash script. I have been doing this for a long time and after doing a lot of mistakes, I figured that if we follow some basic rules we can make our script more portable and less prone to failure when semantics...

by Nitin Bhadauria
Tag: script
09-May-2016

Grails

Executing Groovy scripts at runtime

A very useful Groovy class GroovyScriptEngine can be used to execute Groovy scripts at runtime. For understanding purpose, lets start with an example. We have a script named as Area.groovy that calculates the area of circle. [java] // Area.groovy Float r = "${radius}".toFloat() //radius will be passed as an...

by Divya Setia
Tag: script
25-Sep-2012

Technology

Bash script to open a terminal with multiple tabs on Linux start-up

All of the tasks performed by us after system startup such as opening a browser, MySql etc can be automated by following the steps mentioned below : 1. Write a script:- [bash] sleep 1m;gnome-terminal --geometry=150x50 --tab --title="echo" -e "bash -c \"echo "hello";echo "there";exec...

by Nitesh
Tag: script
25-May-2012

Technology

Database Backup Script for windows

In one of the project I am working on, the application needs to be deployed on windows server. To take the database backup, I wrote the script which does the following : Takes database dump and copy it to the backup folder. Zip that backup file and rename it to the format "YYYYMMDD_HHMMSS" Removes  all the backups older than 30...

by Amit Jain
Tag: script
14-Dec-2010