Postgresql 9.1 BACKUP DUMP BASH script
We wrote an improved postgresql dump bash script for Postgresql version 9.1. This one will save each dump file with the name: database_name_DAYNAME.sql.bz2 In this way, we would only have 7 backups at any time, because each file will be overwritten after seven days. Since our backup system (TSM) saves 7 versions of each file,
Mysql SQL in bash one-liner
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’;”; >
Check http headers with wget
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
Finding spam users
WordPress Brute Force attack spring 2013
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
patching two files
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