Date and time is useful. You might want your script to check if it is Monday today, or if the script ran 2 days ago. Maybe you need to save a file with the current date and time. Here are some variables that I use to put in my bash scripts: [bash] TODAY=$(date|awk ‘{ print

If you just need a quick way to get some data from a mysql database in your shell (bash), you could do something like this in one line: mysql -h your.server.edu -u db_username -p`cat /path/to/your/homedir/secretpasswordfile` -e “;use databasename; SELECT tablename.columnname FROM tablename where id like ‘421111’ and something like ‘1’ and option like ’23’;”; >

If you want to see the http headers from your shell, you can do it with:   wget –no-check-certificate –server-response –spider https://yourwebsite.something The result would be something like: [bash] Spider mode enabled. Check if remote file exists. –2014-02-07 11:13:33– https://yourwebsite.something/something Resolving yourwebsite.something… 129.177.5.226 Connecting to yourwebsite.something|129.177.5.226|:443… connected. HTTP request sent, awaiting response… HTTP/1.1 301 Moved

We had a lot of spam users in our multisite wordpress system. This was because we had self-registration enabled for a period. Not a smart thing to do… anyway, I wrote a bash script in order to find which users id’s from the Mysql database that could potentially be spam users. With this list of

For those who are running a WordPress site today at May 2013, you should know about this on-going BruteForce attack against many WordPress sites around the world. http://www.bbc.co.uk/news/technology-22152296 Here at University of Bergen, we are also working on to protect our multisite WordPress installation. How is this “attack” performed? There is a so-called “botnet”, where

I had two files that both contained lines that I needed. The final result I wanted was a file called LocalSettings.php that could get the “goodies” from the two other files. The “goodies” here are variable lines containing specific details for a certain Wiki installation. So my first file was called: LocalSettings.php.original The other: LocalSettings.php.upgraded