Backs up all databases, saves the last 4 copies.

!/bin/bash

# modify the following :
export DB_BACKUP=”/home/user/mysql_backup/”
export DB_USER=”root”
export DB_PASSWD=”********”

echo “MySQL_Backup”
echo “———————-”
echo “* Rotating 4 backups…”
rm -rf $DB_BACKUP/04
mv $DB_BACKUP/03 $DB_BACKUP/04
mv $DB_BACKUP/02 $DB_BACKUP/03
mv $DB_BACKUP/01 $DB_BACKUP/02
mkdir $DB_BACKUP/01

echo “* Creating new backup…”
mysqldump –user=$DB_USER –password=$DB_PASSWD –all-databases | bzip2 > $DB_BACKUP/01/mysql-`date +%Y-%m-%d`.bz2
echo “———————-”
echo “Done”
exit 0

Here are some examples of useful scp commands:

$ scp file1 [email protected]:/tmp/

Password: ******
Above code copies file1 to server1.

$ scp server1:/tmp/file1

Password: ******
Copy remote file1 to local working directory. Use the -p option to preserve permissions and timestamps on the copied files.

$ scp -p file1 server1:/tmp/If the SSH service is configured to listen on a port other than the default port 22, use -P to indicate that port on the scp command line:

$ scp -P 12345 file1 server1:/tmp/

Connect to a particular port.To do recursive copies, from a particular point in the remote file system, use the -r option:

$ scp -r dir1 [email protected]:/tmp/

Copies all dir1 to remote /tmp .
I hope I was helpful.

1. First install the apache with this command:

apt-get install apache2

2. Now use locate to find if the mod_rewrite.so is availble on your server:

updatedb

locate mod_rewrite.so

it will found in “/usr/lib/apache2/modules”

3. New apache follow some folders to enable and disable mods so now do this:

cd /etc/apache2/mods-enabled

touch rewrite.load

vim rewrite.load (you may use any editor to edit this file)

4. Now paste this following line:

Continue Reading…

Ofris is an application which serves to lock the system or freeze. Or in other words Ofris is a application similar to Deep Freeze that runs on Linux operating system.

Installation:

sudo add-apt-repository ppa:tldm217/tahutek.net
sudo apt-get update
sudo apt-get install ofris-en

How to run Ofris:
open a terminal and run :

ofris-en

And then select what you want to do, freeze the system for this user or for another user.
You can later unfreeze the system the same way.


Alien converts between the rpm, deb and Slackware tgz file formats. If you want to use a package from another distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it.

Installation :

apt-get install alien

Usage.

Use the following  to install your rpm file :

alien -i rpm_file_to_install.rpm

Converting rpm file to deb:

alien -k rpm_file_to_convert.rpm

Then you will need to use the following command to install the deb file resulted :

dpkg -i name_of_created_deb_file.deb