Author: Petronald Green

How to setup open MySQL Port (3306) on Ubuntu 0

How to setup open MySQL Port (3306) on Ubuntu

Step 1: ensure we have mysql-server installed.

apt-get install mysql-server

Then: vim /etc/mysql/my.cnf

COMMENT OUT (with a '#'): 
"bind-address = 127.0.0.1"

Restart Server with

service mysql restart

——– To test with another linux client, use

mysql -h ip.or.hostname -u root -p

(ERROR 2003 (HY000): Can’t connect to MySQL server on ‘xyz’)

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

( ERROR 1130 (HY000): Host ‘69.80.43.240’ is not allowed to connect to this MySQL server)

Fix in phpmyadmin
Privileges Tab > root > add a new root with All hosts '%'

 

Linux rsync backup script 0

Linux rsync backup script

HOW TO USE:

  1. edit following file and set DIR as the directory you wish to backup.
  2. save as backup.sh
  3. make exceutable with ‘chmod +x backup.sh’
  4. Run with ./backup.sh /mnt/mymedia    (where /mnt/mymedia is the location you wish to backup to
#!/bin/sh

# Enter absolute path of directory you wish to backup
# DO NOT FORGET TRIALING SLASH!!
DIR=/root/importantdir/

# ---------------------- DO NOT EDIT BELOW THIS LINE-------------------------- #

if [ $# -lt 1 ]; then
    echo "No destination defined. Usage: $0 destination" >&2
    exit 1
elif [ $# -gt 1 ]; then
    echo "Too many arguments. Usage: $0 destination" >&2
    exit 1
fi

START=$(date +%s)

DAY=`date +%d`
MONTH=`date +%m`
YEAR=`date +%Y`
TIME=$(date '+%A, %d %B %Y, %T')

TODAY="$YEAR""_""$MONTH""_""$DAY"

BKDIR="$1/$TODAY"
LOG=$BKDIR/backup_$TODAY.log

if [ ! -d "$BKDIR" ]; then
        mkdir -p $BKDIR
fi

echo "Backup on: $TIME n" > $LOG
rsync -aAXvh $DIR* $BKDIR | tee -a $LOG

FINISH=$(date +%s)

echo "total time: $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds" >> $LOG

 

How to change date and timezone in linux 0

How to change date and timezone in linux

To change date:

date -s "18 JUN 2013 12:22:00"

To change timezone:

sudo dpkg-reconfigure tzdata

 

NOTE: After changing linux date/time/timezone make sure you restart cron with:

/etc/init.d/cron stop
/etc/init.d/cron start

#or in Ubuntu/Debian based OS's

service cron stop
service cron start

 

Reference: Linux ‘top’ command 0

Reference: Linux ‘top’ command

us: user cpu time (or) % CPU time spent in user space
sy: system cpu time (or) % CPU time spent in kernel space
ni: user nice cpu time (or) % CPU time spent on low priority processes
id: idle cpu time (or) % CPU time spent idle
wa: io wait cpu time (or) % CPU time spent in wait (on disk)
hi: hardware irq (or) % CPU time spent servicing/handling hardware interrupts
si: software irq (or) % CPU time spent servicing/handling software interrupts
st: steal time – – % CPU time in involuntary wait by virtual cpu while hypervisor is servicing another processor (or) % CPU time stolen from a virtual machine

0

CrownCloud – $7 Month KVM’s in Germany

Came across these guys recently when I was looking for a Germany VPS. Service is pretty cool and loving the price. What really caught my attention was the Dedicated servers. Talk about bang for your buck!

The plans I thought were especially awesome include:

KVM-1024 VPS-4096 Dedicated – Intel Atom D525
1024MB Ram 2048MB Ram 4GB Ram
10GB Storage 20GB Storage 2x 500GB Hard Disks
500GB Bandwidth 300GB Bandwidth 2TB bandwidth
$7 / Month $7 / Month $30/Month