Nov 28, 2011

ubuntu 11.10 plus plasma widget

I recently install the ubuntu 11.10. I spent some time to get used to the unity interface.
But the unity shell is lack of widgets and therefore I decided to install the plasma-desktop to my ubuntu. :P

1. install the package by the following command:
   apt-get install plasma-desktop plasma-scriptengine-python
2. create launcher to start the plasma desktop:
   type gnome-desktop-item-edit ~/Desktop --create-new
   and it will popup a dialog box.
   select "application" in the type field,
   filled "plasma-desktop" or whatever u like in the name field,
   filled "plasma-desktop" in the command field,
   and press ok.
   P.S u can also create a launcher to stop the plasma by filled the command field with killall plasma-desktop.
3. Let plasma looks better in unity
   a. System Settings > Application Appearance > Widget Style > GTK+
   b. System Settings > Workspace Appearance > Desktop theme > Get new theme
   c. Search for ‘Ambiance’
   d. install it and use it.
   e. remove the bottom panel if u don't like it.
4. Use the nautilus as default folder manager
   control center(system setting) > file associations > inode > directory [ then add: "nautilus --no-desktop" ]
   or you can just install dolphin if u don't like the nautilus.

That's it enjoy!!

reference website:

Nov 12, 2011

setting linux as a gateway

Since my school project need to set up an ethernet environment. I need to create an internal network under virtualbox. The first step is to setup the gateway inside a virtualbox. After google for a while, I finally setting up my linux as a gateway.
Environment :
linux distribution: alpine linux 2.3
kernel version:    3.0
virtualbox network adapter setting:
     1. host-only network=> eth0 for internal network.
     2. bridged network => eth1 for internet.
the connection state is like the following figure:
<<internet>>----------<<alpine linux>>------------<<internal>>
            eth1 pppoe                 eth0 NAT

The reason why I use alpine linux instead of other distribution is that it is tiny but contains the utilities that to set up my environment.
alpine linux download link:
alpine linux installation guide:

I'll write down all the steps that I configure the internet.
1. package requirement
2. configure the network interface
3. setting up the iptables
4. enable packet forwarding
 1.package requirement:

rp-pppoe => pppoe client side program
iptables => firewall
ppp  => ppp deamon
that's all. 

2.configure the network interface
   2.1. the internal network:
      configure the /etc/network/interface
      add the following line to the file.
auto eth0
iface eth0 inet static
      the address, netmask, network and broadcast can be changed according to you network setting. 

   2.2.pppoe configuration:
      pppoe-setting => to start pppoe configuration. 
      After setting up type 
      pppoe-connect => connect to the internet via pppoe. 
      You can check the result by typing:
      ifconfig | less

3.setting up the iptables:
   type the following command to set the iptables rules:      
   iptables -A FORWARD -o eth1 -i eth0 -s -m conntrack --ctstate NEW -j ACCEPT
   iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 
   iptables -A POSTROUTING -t nat -j MASQUERADE

4.enable packet forwarding:
    echo 1 > /proc/sys/net/ipv4/ip_forward
    cat /proc/sys/net/ipv4/ip_forward => check the result.

reference website: