Monthly Archives: October 2011

Restore panel in ubuntu

Well, this was funny though, but today I messed up the top panel of my desktop :P

So, a little search gave me some results and which actually worked for me. Just few lines of commands gave me the top panel back again.

$ gconftool-2 --shutdown
$ gconftool --recursive-unset /apps/panel
$ rm -rf ~/.gconf/apps/panel
$ pkill gnome-panel

tada!!!

Internet sharing using a gateway computer

Gateway setup:
eth0 = the network adapter with internet (IP: 10.10.10.2)
eth1 = the network adapter with client machine (IP: 192.168.20.1)
The local network card cannot have the same subnet with the internet adapter.

Now, configure the internal network card for a static IP address as you need.

Configure the NAT (Network Address Translation):
Basically, here I’ll be configuring the iptables for NAT translation so that packets can be routed through the gateway.

$ sudo iptables -A FORWARD -o eth0 -i eth1 -s 192.168.20.0/24 -m conntrack --ctstate NEW -j ACCEPT
$ sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
$ sudo iptables -A POSTROUTING -t nat -j MASQUERADE

These are the iptables rules.
Rule 1: It allows the packets being forwarded
Rule 2: Allows forwarding of established connection packets
Rule 3: It does the NAT

iptables rule doesn’t save by default. It has to be saved manually.

$ sudo iptables-save | sudo tee /etc/iptables.sav

Edit the /etc/rc.local and add the following lines so that it calls that file every time when the gateway machine is booted.

iptables-restore < /etc/iptables.sav

Run the following line

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

Uncomment the following line from /etc/sysctl.conf

net.ipv4.ip_forward=1

Client setup:
eth0 = the network adapter with the gateway pc (IP: 192.168.20.2)

Change the gateway to the host machines IP address.

To configure DNS server edit the /etc/resolv.conf file and add ISP’s DNS servers.

nameserver xx.xx.xx.xx

And Boom!! :D

apache2: apr_sockaddr_info_get() failed

While I was trying to restart apache from a VM, I was getting this weird error!

* Restarting web server apache2
apache2: apr_sockaddr_info_get() failed for ip-172-19-1-2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
... waiting apache2: apr_sockaddr_info_get() failed for ip-172-19-1-2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]
But the solution for this problem is problem is too simple :)
just try the following steps:
 sudo nano /etc/apache2/httpd.conf 
Most probably the file is empty.
Just add the following line, and done!
 ServerName localhost 

[ localhost will be the servername. ]

Quit your day job, if you can afford it

This is what we all should do!

The moral of Super Mario Bros

The moral of Super Mario Bros

Source