Tuesday, 27 November 2012

Mysql Hot Backups using Percona's Xtrabackup and innobackupex script

Percona's Xtrabackup is one of the hot tools used in the industry for taking mysql backups of live systems. Facebook is using Xtrabackup for their mysql backup needs so you can understand the importance of Xtrabackup.

But we are not directly using Xtrabackup for live hot backups. We are using innobackupex wrapper for taking the backups as Xtrabackup tool can only take the backup of innodb. What if we are also using myisam engine? But by using innobackupex wrapper, we can not take the backup of innodb, but also whole different type of mysql engine like myisam,archieve etc. Innobackupex is a wrapper script which will call Xtrabackup program and will take care of the different type of databases.

Convert the files from Windows os to unix/linux format and vice versa using tofrodos

The problem we face in linux or unix world is that we will be working in linux but rest of the world depends on Windows. So like the files we get. Most of the files are from Windows and we need to process these files in linux.

It is just too much expensive to have Windows copy running side by side or in Virtual Machine to process these Windows files. Luckily we already have the solutions for this. Here comes the software called tofrodos handy for all of us.

Monday, 26 November 2012

Changing time zone and time in Ubuntu/Linux

This is a quick tutorial. Here we check how to change time zone in linux as well as changing the server time using terminal.

For changing the time zone:

Your server time is in UTC and you want to change it to IST (Indian Standard Time). For this follow the below steps:

Friday, 23 November 2012

How to enable internet connectivity to remote server which is not connected to internet using port forwarding [port forward local port to remote machine using ssh tunneling]

Last time we saw that we can port forward the remote port to local machine and use it for testing the apps in the remote server. The opposite of this is also true. Yes, we can port forward the local port to remote server and use it for internet connectivity in the remote machine.

This trick comes handy if the remote server is behind a firewall or in a VPN and there is no direct connectivity to the internet. So what we will do if we need to update the applications in the server. Or what if we need to install a critical security update to the server? Here again comes the port forwarding to our rescue.

Thursday, 22 November 2012

How to port forward remote port to local machine using ssh [trouble shooting remote server apps in local machine]

Some times, you may need to test a remote application (GUI app) which is running in a linux server. As it is a server, we cannot test the app from the server as there is no GUI for the server. The app can be accessed over a web browser though. But for some other reasons, you are not able to access it through the web browser using the server's ip address. So our first purpose is the trouble shoot the issue. Whether the app is actually running in the server with all the features enabled?

We can ssh to the server and check the whether the app is running using ps -ef | grep appname command. Then we found out that the app is actually running in the server. But why we are not able to access it through server's ip address and the port? Here comes the rescuer in the form of port forwarding.

Monday, 19 November 2012

How to enable history in elementary os luna even after the restarting the computer or closing the terminal

Note: Elementary os luna is still in development and will have many bugs still to be resolved. So these types of issues may occur. This is not to blame the developers but I hope it will be helpful to some body who is using it and has been affected by this issue.

I'm using the daily builds of elementary os luna. I use terminal a lot and uses many command line and terminal shortcuts daily to make my jobs easier. One of such command line short cut is uing Ctr+r to search for the previously used commands. But elementary luna it was not working after I have restarted my computer or even in another terminal. I did a bit of research and found out the issue and fixed it.

Saturday, 17 November 2012

How to add legal notice to your server while logging in through ssh in linux[alternate method: without using issue.net]

I had to implement the legal warning while the users are logging in to our servers. Actually there are two methods to do this. One is using issue.net and other is using motd.tail. We are going to see these two methods and their implementation here.

Thursday, 15 November 2012

How to directly login to the screen session running on your remote server using ssh

You know that I am a big fan of gnu screen utility. Also we have seen many short cuts for screen here. We used to access our screen session after log in to the remote server through ssh and then 'screen -x screenname' command. But it is actually time consuming. Yes we can directly login to the screen session using the awesome ssh. Let's find out how.

You may think that we can type the command,

ssh [email protected] "screen -x screenname"

Wednesday, 14 November 2012

Boot from usb drives even if your hardware doesn't support it using EasyBCD and plop boot manager

Last time, I have told you about an amazing software called EasyBCD. It is a boot manager editor software which gives you a easy to use interface to customize your boot loader. Its just not a boot manager configuration tool, but it also comes with the plop boot manager built in with it.

So what is the advantage of having plop boot manager?You can read about plop boot manager here.
 In short, it let you boot using your usb even if you hard ware doesn't support it. Old hardwares do not have the option boot from usb drives. I used to test a lot of linux distros but burning CDs and DVDs for this purpose is just waste of money. By using an usb to test the linux distros, I can save a lot of money and also help environment.

Restore Windows MBR even if you don't have Windows disk by using Ubuntu live cd/usb

Last time we saw how to restore MBR using windows 7 disk. But what if you don't have a Window disk but only a Ubuntu live cd or live usb disk?Yes, we can use the amazing linux to restore MBR. I have found this tip on Google plus  but never tried it my self. It is by the amazing fellow named Benjamin Humphrey who runs the most famous ubuntu blog in the planet OMG! Ubuntu!. So here is we go.

Fix MBR (Master Boot Record - Windows boot manager) after messing the grub boot manager when dual booting windows 7 and ubuntu and reconfigure it using EasyBCD

This time I decided that instead of installing Ubuntu using wubi with Windows 7, I'll dual boot the daily build of elementary os with Windows 7. I downloaded and boot eOS using a bootable usb using plop boot manager. Everything went smooth but I wrongly installed the grub over Windows 7's MBR at /dev/sda.

Grub became the boot manager and there is also windows 7 entry at the grub boot menu along with eOS menu entry. But when we select windows 7, it again comes to the first shown grub boot menu. So it created an infinite loop for the windows 7 and I was not able to boot to windows 7.