Switch between eth0 and eth1 in debian based system

So I bought a new NIC. Putting two NICs together I was having a little annoying problem as I had to setup mac and IP bindings every time I give a new installation. Sometimes the devices was choosing their sequences randomly. I don’t know what’s the methodology behind choosing in their architecture. But they obviously put a ways to fix it.

To change the detect the ethernet in your way just do a simple editing.

 sudo nano /etc/udev/rules.d/70-persistent-net.rules 

and change the NAME as you want it e.g. eth0 or eth1.

Reboot the machine. That’s it!

Installing Vim from source in Ubuntu

Vim can be easily found in Synaptic Package Manager. But sometimes that is the oder version. Like I need Vim 7.3 where the available version in synaptic package manager is 7.2. Then I thought I should go for the source file available on the site. I downloaded the file and tried to run as the site said. But it was showing some errors. Then I googled again to get some more idea. I found a simple process. Which says four steps after going to the vim directory:
1. ./configure
2. make
3. sudo make install
4. sudo ln -s /usr/local/bin/vim /usr/bin/vim (process 4 is optional)
But then I got a new error message telling me something like these You need to install a terminal library: for example ncurses. Or specify the name of the library with –with-tlib
This particular error informs us that we need an additional dev library to compile the file.
To get the library simply type:

sudo apt-get install libncurses5-dev

Then follow the four simple steps mentioned earlier in the post.
Now new version of Vim should be installed in your system.

Setting up Virtual Host

Few days ago, while working on a project, I was in need of a vhost/virtual host. Then, I searched Google and found so many answers. I just didn’t know which one to try. All of them seems important. While working on my favorite lappy I tried most of those and now I forgot the places I edited.

However, I got a small process to make the thing done. I guess, when ever Name-based Virtual Host Support is needed, it’s gonna work.

I’ll be telling about *nix system.

From terminal.

sudo gedit /etc/apache2/httpd.conf

A new window is supposed to be visible. Go to the end of the file and paste the following lines or you can modify as needed.

<VirtualHost *:80>
	ServerName www.shaon.com
	DocumentRoot /www/shaon

Then save and close this one and type on terminal,

sudo gedit /etc/hosts

put this your desired name for vhost just after localhost.	localhost   www.shaon.com

Now restart apache by typing

sudo /etc/init.d/apache2 restart

Name-based Virtual Host is now ready to go. 🙂 Check it on your browser.

VirtualBox full screen problem for ubuntu

start ubuntu on Virtualbox. go to terminal and type
cd /media/
sudo sh ./VBOXADDITIONS_3.2.6_63112/VBoxLinuxAdditions-x86.run

wait for the process to complete.
shutdown ubuntu and restart VirtualBox.
when ubuntu is started press command+F to full screen and command+L to get it back.

Install phpmyadmin in ubuntu

In the previous article you’ve seen how to setup a LAMP server. Now if you want to install phpmyadmin open your terminal and type
sudo apt-get install phpmyadmin
follow the screen.

Now, open browser go to http://localhost/phpmyadmin/

you are done with your phpmyadmin installation. now, login with the password you provided earlier.