fbpx

Linux

MySql backup & restore commands

This article has some handy commands to backup and restore mysql databases. Some of the terms used below refer to USERNAME = your username MYSQL_PASSWORD = your password DATABASE_1 = name of the database LOCAL_DOMAIN.COM = local domain name DESTINATION_DOMAIN.COM = remote domain name Take MySql dump, gzip it and take it in a directory. mysqldump...

Read more...

MySql monitoring & optimzing commands

Some of the terms used in the article below refer to USERNAME = your username MYSQL_PASSWORD = your password DATABASE_1 = name of the database LOCAL_DOMAIN.COM = local domain name DESTINATION_DOMAIN.COM = remote domain name Restart MySql Server sudo service mysql restart Check database size mysql> SELECT CONCAT(sum(ROUND(((DATA_LENGTH + INDEX_LENGTH - DATA_FREE) / 1024 / 1024),2))," MB") AS...

Read more...

Server Monitoring Commands

Disk Stats Disk Usage detials df -h LSOF means list of open files. This command watches total open files on server. A very good article for further reading http://www.catonmat.net/blog/unix-utilities-lsof/ watch --interval=1 --differences "lsof | wc -l" Disk IO Stats iotop sar disk io stats sar -s 15:00:00 -e 17:00:00 shows the disk I/O stats watch --interval=1 iostat http://www.tecmint.com/how-to-check-disk-space-in-linux/ General Monitoring Find Out...

Read more...

Convert MySql database tables types from MyISAM to InnoDB

Conversion on dump file If you have a dump file of mysql, The easiest way is to run the command on the dump file. It will replace the tables from MyISAM to INNODB sed -i 's/MyISAM/INNODB/g' dbname.sql You can also change the command and convert INNODB to MyISAM by this command sed -i 's/INNODB/MyISAM/g' dbname.sql     Conversion on current...

Read more...

How To Create a SSL Certificate on Apache for Ubuntu 14.04

TLS, or transport layer security, and its predecessor SSL, secure sockets layer, are secure protocols created in order to place normal traffic in a protected, encrypted wrapper. In this guide, i will cover how to create a self-signed SSL certificate for Apache on an Ubuntu 14.04 server, which will allow...

Read more...

How to write your first shell script

Launch a terminal vi, nano or any other prefered editor of your choice. I will be using nano as a editor. nano /home/bash-scripts/my-first-script.sh At the top type the following code #!/bin/bash. This is known as a Shebang line. #!/bin/bash echo "start of script" ls echo "end of script" This script prints a header line then list...

Read more...

Find files on linux and move them to a temporary directory

These are the commands to search and move data on linux -iname - File name search pattern (case insensitive) Move .mp3 files and not directories, use: find / -iname "*.mp3" -type f -exec /bin/mv {} /mnt/mp3 \; Find all directories having name mp3 and move: # find / -iname "*.mp3" -type d -exec /bin/mv...

Read more...

How to install and configure SVN on Ubuntu

Subversion – another name we known as SVN, is an open source version control system. SVN is a really easy to use Revision control/version control/source control and store changes of your project files such as coding and documentation. In this tutorial we will discuss how to install subversion on Ubuntu...

Read more...

Server Migration Process

This is a tutorial for moving of server data from one server to another. i consider you have setup the server using guide http://zain.pk/setup-of-ubuntu-server-or-ubuntu-desktop-on-virtualbox/ The link shows how to install server on virtualbox. Production server is not much different then running server on virtual machine. Things we will consider moving from...

Read more...