How to find Harddisk UUID (Universally Unique Identifier) on linux?

What is UUID? UUID stand for universally unique identifier which is an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). UUIDs can be used to identify DVD drives, removable media (USB flashsticks) and each partition on any of your hard drives.

UUID is unique and never changes even if you switch the harddisk ordering. It is recommended to use UUID instead of traditional block name (/dev/hda1, /dev/hda5, /dev/sdb) to uniquely identify harddisk or other storage medium such as SAN, iSCSI, DAS, scsi disks volumes.

Continue reading

How to Backup and Restore MySQL Database Using mysqldump

Nowadays we store our web applications data in databases. Do you backup your databases? t is very important to make regular backups of your data to protect it from loss. I store all my web application data in to MySQL database, so i going t show how to backup and restore the data in your MySQL database.

There are 2 way to perform backup and restore MySQL database. The easier way to perform backup and restore MySQL databases is use phpMyAdmin. phpMyAdmin is open source GUI tool to manage MySQL databases. phpMyAdmin allows users to save database dump as file and import it. But it probably won’t be a good idea if your database size too huge.

Another method to perform backup and restore MySQL database is using mysqldump command. I prefer use mysqldump command to perform backup and restore MySQL database cause it easy to use it. I can done the backup and restore by just enter 2 command.

Using mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command.

How to backup MySQL database Continue reading

Useful Commands in Ubuntu

Below are the list of commands needed when using Ubuntu:

Command privileges.

sudo command – run command as root
sudo su – root shell open
sudo su user – open shell as a user
sudo -k – forget your password sudo
gksudo command – sudo visual dialog (GNOME)
kdesudo command – sudo visual dialog (KDE)
sudo visudo – edit / etc / sudoers
gksudo nautilus – root file manager (GNOME)
kdesudo konqueror – root file manager (KDE)
passwd – change your password

Command Network

ifconfig – displays information network
iwconfig – displays information from wireless
sudo iwlist scan – scan wireless networks
sudo /etc/init.d/networking restart – reset the network
(file) /etc/network/interfaces – manual configuration
ifup interface – bring online interface
ifdown interface – disable interface

Commands Display

sudo /etc/init.d/gdm restart – reset X (Gnome)
sudo /etc/init.d/kdm restart – reset X (KDE)
(file) /etc/X11/xorg.conf – show Configuration
sudo dpkg-reconfigure – reconfigure xserver-xorg-phigh – reset configuration X
Ctrl+Alt+Bksp – X display reset if frozen
Ctrl+Alt+FN – switch to tty N
Ctrl+Alt+F7 – switch back to X display

Commands for Service

start service – service to start work (Upstart)
stop service – service to stop working (Upstart)
status service – check if service is running (Upstart)
/etc/init.d/service start – start service (SysV)
/etc/init.d/service stop – stop service (SysV)
/etc/init.d/service status – check service (SysV)
/etc/init.d/service restart – reset service (SysV)
runlevel – get current runlevel

Commands for Firewall.

ufw enable – turn on the firewall
ufw disable – turn off the firewall
ufw default allow – allow all connections by default
ufw default deny – drop all connections by default
ufw status – current rules and
ufw allow port – to allow traffic on port
ufw deny port – port block
ufw deny from ip – ip block


Command for get System information.

lsb_release -a – get the version of Ubuntu
uname -r – get kernel version
uname -a – get all the information kernel
df -h – displays filesystem disk space usage for all partitions (in Megabytes(M) & gigabytes(G))
free -m – displays the amount of free and used memory in the system in megabytes.
top – command displays information on your GNU/Linux system, running processes and system resources, including CPU, RAM & swap usage and total number of tasks being run.

Commands for Package Manager.

apt-get update – refresh updates available
apt-get upgrade – update all packages
apt-get dist-upgrade – version update
apt-get install pkg – installing pkg
apt-get remove pkg – uninstall pkg
apt-get autoremove – removing packages obsotletos
apt-get -f install – try to fix packages
dpkg –configure -a – try to fix a broken package
dpkg -i pkg.deb – install file pkg.deb
(file) /etc/apt/sources.list – list of repositories APT