blog.up-link.ro
30Mar/100

How To Backup MySQL databases using a shell script

MySQL is one of the most popular open source database management system for the development of interactive websites.

If your server stores its sensitive data in a MySQL database, you will most definitely want to backup that information so that it can be restored in case of any disaster.

Below is a backup script for MySQL databases (please make sure you will change MYSQL_PASS):

#!/bin/sh
# backup mysql databases shell script
# UNIX LINUX BSD
# by Adi https://blog.up-link.ro
# March 2010

DATE=$(date +%Y-%m-%d)
MYSQL=$(which mysql)
MYSQLDUMP=$(which mysqldump)
MYSQL_USER="root"
MYSQL_PASS="password"
HOSTNAME=$(hostname)
GZIP=$(which gzip)
ARG="-u $MYSQL_USER -p$MYSQL_PASS"
DATABASES=$($MYSQL $ARG -s -e "SHOW DATABASES;")
BACKUP_PATH="/home/backup/$DATE/mysql"

! [ -d $BACKUP_PATH ] && mkdir -p $BACKUP_PATH

for DB in $DATABASES
do
BACKUP_FILE="$BACKUP_PATH/$HOSTNAME-mysql-$DB-$DATE.sql.gz"
$MYSQLDUMP $ARG $DB | $GZIP -9 > $BACKUP_FILE
done

Download the script from here.

Print This Post Print This Post
24Mar/100

How To Reset MySQL Password

1. Stop MySQL server

# /usr/local/etc/rc.d/mysql-server stop

2. Start MySQL server  with skip grant table mode

# mysqld_safe –skip-grant-tables &
Output:
[1] 5187
# Starting mysqld daemon with databases from /var/db/mysql

3. Login as user root without password

# mysql -u root -p

Print This Post Print This Post
4Mar/100

N. Korea develops own OS

North Korea's self-developed software operating system named the "Red Star" was brought to light for the first time by a Russian satellite broadcaster yesterday.

North Korea's top IT experts began developing the Red Star in 2006, but its composition and operation mechanisms were unknown until the internet version of the Russia Today-TV featured the system, citing the blog of a Russian student who goes to the Kim Il-sung University in Pyongyan.

read more via koreaherald.co.kr.

Print This Post Print This Post
15Feb/100

How To Improve the Speed of Firefox 3 in Linux

We all know Firefox is a memory hog. To speed things up, do the following:

Open Firefox and type about:config in the address bar.
Click the “I’ll be careful, I promise“ button
Use the search bar above to look for network.http.pipelining and double click on it to set it’s value to True.
Create a new boolean value named network.http.pipelining.firstrequest and set it to True.
Find network.http.pipelining.maxrequests and change its value to 8.
Look for network.http.proxy.pipelining and set it to True.
Create two new integers named nglayout.initialpaint.delay and content.notify.interval, set them to 0.
Restart your browser.

Enjoy!

Print This Post Print This Post
12Feb/100

10 Linux Tips and Tricks

Here you will find a collection of usefull tips and tricks for Linux-based Operating Systems.

1. How to remove a file with a dash as first character?

If you accidentally created a file with a "-" in the beginning then you want to remove it, you have to do :

# rm ./-filename

or

# rm -- -filename

2. How to set-up nice welcome messages?

It's not actually a tip, it's just a nice thing that will make every login more cooler.
Go to http://www.fi

Print This Post Print This Post