Category Archives: Linux

Share network drive on rdesktop

If you want to share clipboard and map your local drive as server’s network drive, you can do this using rdesktop.

Once you get connected your home directory will be available on the server as network drive.

Backup MySQL Databases

If you are running a database driven website then your data sitting in MySQL database id most important for you. In most of shared hosting there is no provision for scheduled backup of databases. So I have written a script to take backup of all databases associated with the account.

How to install latest node.js on Ubuntu

Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

In most linux distributions Node.js is available in a repository which can be accessed via a package manager such as apt-get or aptitude.

However in the repository of the latest Ubuntu 12.10 the nodejs package has the version number 0.6.19 while the current version is 0.8.16 as of this writing. Unfortunately many nodes — that’s how node.js applications are called — are constantly under development and often depend on a newer version.

To install latest version of node you need to execute following commands:

Install LAMP in UBUNTU 12.10 / 13.04 / 13.10

I installed Ubuntu 12.10 on my new laptop and now I have to setup LAMP on it. To setup LAMP I need to install Apache Web Server, PHP and MySQL.
For installation issue following commands:

Above command will download and install Apache Web Server. It will ask for permission to download the setup file. After completion of above command open the browser and browse following URL:

If it is opening properly, your web server is installed properly. Now we will install PHP:

Above command will download and install PHP and apache integration library. It will ask for permission to download the setup file.
To check the installation of php issue following command:

Write following code in this file and save it:

In the browser open following URL:

It will display PHP configuration details. We have installed PHP and integrated it with Apache Web Server.
If you are not getting required page the you need to restart Apache:

Our next task is to install MySQL server and PHP-MySQL connector. For this issue following command:

If you are running Ubuntu 13.10, issue following command:

It will download and install MySQL Server. After installation it will ask to setup root password for database server.
Now we have installed Apache Web Server, PHP and MySQL. For database management you may need phpMyAdmin. To install phpMyAdmin issue following command:

After installation open following URL:

You will get the login screen of phpMyAdmin.

Congrats, You are done!!

Android USB Tethering in UBUNTU 12.04

I was struggling to use the internet connection of my Android in my laptop. I
searched on google and fond that Ubuntu recongnize it automatically if USB
tethering is enabled on the connected Android phone. Then I tried to enable the
USB modem interface usb0 using following command:

it gave me following error:

Ignoring unknown interface usb0=usb0.

Then I checked the file /etc/network/interfaces. I found there is no entry for
usb0. I added following lines at the end of the file:

and again tried the above command but this time it gave me following message:

Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service smbd reload

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the reload(8) utility, e.g. reload smbd

Then I tried following command and was able to use internet on my laptop.