Tag Archives: mysql

Setup a backup job for your LAMP sites. | Setup a backup job for your LAMP sites.

I wrote a script which takes a backup of my webserver, taking a snapshot of all the website content, database, and configuration files.

Theory is if the webserver died, we would be about to result quickly using the data backed up.

On the server, put the following script and below is the cron entry which triggers every week. You will need up change the username and password for your mysql server.

This is the cron entry which fires up every friday.

Now this script will be on a linux machine somewhere else, it will connect and copy the backup archive file generated. You must first setup the ssh key so that its passwordless connection.

Simplicity it key! It works and will get you out of trouble. Well worth the 5minute investment.



Simple way to backup your MySQL database everyday! | backup your mysql database everyday with this bash script.

This is a simple script to backup your MySQL database everyday and compress it on the fly, you just need to add an entry into Cron. see below


The script will also data the new backup which stops it overriding the previous backup.

Edit cron

Enter this

This will kick off everyday at 9:22pm

Dump1090 to MySQL Script | send flight data from dump1090 to mysql

I wanted a script which would read all the live dump1090 aircraft data and log it to a mysql database.

This base script does it, it will dump all the data to Mysql every minute.

It will start the dump1090 server and kick off a process which reads/sorts and inserts.


Installing and configuring MediaWiki on Raspberry Pi 1 | Setup mediawiki on a raspberry pi 1

MediaWiki is the software used by Wikipedia run, its a fantastic way to document share.

I would recommend installing DNSMasq to allow as to use fully qualified domain names. See here.

Setting up Mediawiki is a pretty simply task, does not really require a high level of experience. Lets dig in, install software.

Once completed we start setting up the housing for MediaWiki, the following will also download the software from MediaWiki’s site and unzip it.

Then we’ll need to setup the database and user permissions.

Now we’ll begin the Mediawiki installation, easy part. Navigate to the following URL and start the point and click install.

Once connected you’ll see this.

Click on the “Set up the wiki” link, follow the instructions and enter all the information it requires. Take note, youll need the database,username and password we input earlier. Once it has finished it will let you download the LocalSettings.php file to your computer. You’ll need to upload it to the /var/www/html/wiki directory.

Lets create the DNS entries.

Insert the following line

Now restart DNSMasq

We also need to setup the virtual host in apache

Insert the following line

Restart apache.

Make sure your connected to the AP while your setting up, otherwise the setup will use the LAN IP to setup the config file.


Mysql Creating new database username and password | how to create a mysql database username and password

Quick and small howto, how to create a new MySQL database with an associated username and password with full access to that database.



Mythtv and HDhomerun

I use a combination of a HDhomerun tuner by Silicon Dust and a PC with mythtv backend setup, the tuner is network based.

Problem is the hdhomerun only works with DHCP, no static IP setup. So what happens is when I have a power outage the unit resets and comes back with a different IP.

I know I should setup my own DHCP server instead of using my routers, but cbf

So, what was happening was when the IP changed my mythtv would still record…. But nothing was recorded.

So I wrote the following script which would log on to the database check the recorded files and compared them to the files in the directory. If it existed in the database and not in the directory it will remove the entry from the database.

It just works and keeps your mythtv db nice and clean.