"Innovation comes only from readily and seamlessly sharing information rather than hoarding it."- Tom Peters
Development Blog

Articles - Other entries

The Easy way for Key Based Authentication for SSH

Why use a key-based system?

Using a key-based system makes it much faster, and even more secure to ssh into a server, and scp files onto a remote server. To do this is pretty easy...

Automatic Backup of MySQL Databases

This is a trick that works on a Linux system, as most servers are hosted using Linux. So, you would have to figure out how to change it if you are using Windows (sorry).

What are we going to do?

We will just create a simple bash script that will backup all databases, and we will create a cron job to do it for us on automatic intervals.

The Bash Script

You may first ask me, why do this in a bash script? Why not put it straight into a cronjob? Well, I'm doing it just to make it easier if you want to run other commands, or do one file per database. So, here's the script:


#/bin/sh

mysqldump -h localhost -u mikesir87 -pPASSWORD --all-databases > database.sql
gzip database.sql
mv database.sql.gz BACKUPS/`date +mysql-BACKUP.sql-%y-%m-%d.gz`

The first command, mysqldump, does a simple dump on the database. Since we give it the --all-databases flag, it grabs all databases that user has access to. The -h flag is for the host, which will probably be localhost. The -u flag is the username for the connection and the -p flag is for the user's password. Note that there is space between the flag and the password. If you're not familiar with Unix command lines, the > is what is called an IO Redirect.

A few SEO notes

Introduction

There are a lot of different tools and methods to use to help your site be noticed and found. Of course, I'm still working on some of these myself, but here's a few things I've learned so far. Post a comment about any other things you might have to offer!

Google Analytics

Google Analytics is a pretty powerful suite to help you understand the experience of your site's visitors. To get an account is free, and only requires you to add a Javascript file to your site pages. Most CMS's have plugins that make this easy.

Some of the features I look at are the sources of the visits. Google Analytics gives you a nice chart to help you get a quick glance of the source of the visits... such as this:

You can click on the graph to get it broken down. If you go into the Search Engine section, it'll even tell you what search terms were entered to get them to your page (helps having Google providing the software!).