Tuesday, October 2, 2012

single mode on Solaris

To boot a solaris machine into a single mode. Execute the command below at any terminal
shutdown -i6 -y

Thursday, September 27, 2012

network troubleshooting in Solaris


I had an issue with Solaris where the OS is unable to find the network interface.
One of my college run the command below to troubleshoot:


dladm show-dev
dladm show-link
prtconf -D
vi path_to_inst


I'm not sure yet what the command are for. But I will just record it here for my reference in the future.

Friday, October 7, 2011

How to install kubuntu-desktop

I played with my laptop in struggling to install libgtk2.0-dev. Unfortunately my ubuntu-desktop crashed, I was unable to log-on via the GUI anymore and only able to have the command prompt.

I tried to reinstall ubuntu-desktop but the system doesn't happy at all.
Since I need to get this laptop going immediately, I tried to change the desktop with kbuntu.
here is the command i'm using
sudo apt-get install kubuntu-desktop

I also had to change my network setting to dhcp as well. It was using static before.

auto lo eth0
iface eth0 inet dhcp
iface lo inet loopback


Saturday, August 20, 2011

Create VIEW on MySQL

Here is the example to create a VIEW on MySQL

mysql> CREATE TABLE t (qty INT, price INT);
mysql> INSERT INTO t VALUES(3, 50);
mysql> CREATE VIEW v AS SELECT qty, price, qty*price AS value FROM t;
mysql> SELECT * FROM v;


Saturday, August 6, 2011

Move a table into different database on MySQL

I'm working with MySQL lately so I want to record some notes on the experience so I can refer back to this post when I need it again in the future.

Here is the command:
alter table old_db.foo rename new_db.foo

Simple, isn't it?

Sunday, June 26, 2011

To find out what application is listening on a port

I keep forgotten the command as mentioned on the subject of this blog.
Hopefully I can find out this command easily without having to googling anymore.
lsof -i :80

Tuesday, June 22, 2010

How to install VPN Client on Ubuntu 10.04

I was trying to install Cisco VPN client to enable my laptop -which is runing on Ubuntu 10.04- to allow this machine connect to my office via VPN.

I got several error messages when I tried to compile this application.
Fortunately, I found the page below.

Thanks to L.A.M.N.K for documenting the step-by-step so that I'm now able to use Cisco VPN client on
my Ubuntu.

First, download the source from the tuxx website.
Then, follow the steps that I copied and pasted from the L.A.M.N.K below

Cisco module again doesn’t let us compile against the new kernel in Ubuntu 9.04 and 9.10 beta:

/home/lamnk/vpnclient/interceptor.c: In function ‘interceptor_init’:
/home/lamnk/vpnclient/interceptor.c:132: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
/home/lamnk/vpnclient/interceptor.c:133: error: ‘struct net_device’ has no member named ‘get_stats’
/home/lamnk/vpnclient/interceptor.c:134: error: ‘struct net_device’ has no member named ‘do_ioctl’
/home/lamnk/vpnclient/interceptor.c: In function ‘add_netdev’:
/home/lamnk/vpnclient/interceptor.c:271: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
/home/lamnk/vpnclient/interceptor.c:272: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
/home/lamnk/vpnclient/interceptor.c: In function ‘remove_netdev’:
/home/lamnk/vpnclient/interceptor.c:294: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
make[2]: *** [/home/lamnk/vpnclient/interceptor.o] Error 1
make[1]: *** [_module_/home/lamnk/vpnclient] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-1-generic'
make: *** [default] Error 2
Failed to make module "cisco_ipsec.ko".

Before installtion I assume that you have the latest version 4.8.02.0030 and the required packages for compiling ie gcc, libstdc++6 … The kernel version should be from 2.6.30 to 2.6.32

  • Download the client and extract it
  • Go to vpnclient folder:
    cd vpnclient

  • Download patch file for 64 bit and apply it (users on 32bit systems can skip this step):

    wget http://lamnk.com/download/vpnclient-linux-4.8.02-64bit.patch

    patch < ./vpnclient-linux-4.8.02-64bit.patch

    sed -i 's/^CFLAGS/EXTRA_CFLAGS' Makefile

  • Download patch file for newer kernel (2.6.30+) and apply it:

    wget http://lamnk.com/download/vpnclient-linux-2.6.31-final.diff

    patch < ./vpnclient-linux-2.6.31-final.diff

  • Next we must edit a kernel source file

    sudo sed -i 's/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/' `find /usr/src -name netdevice.h`

    Yes, it is a one liner, you should copy & paste that command instead of typing ;)The command's translation into English: find the string const struct net_device_ops *netdev_ops; and change it to struct net_device_ops *netdev_ops; in the file locates at

    find /usr/src -name netdevice.h

  • And finally, install Cisco VPN Client:

    sudo ./vpn_install

The patch files are not from me. All credit goes to the people at tuxx-home.at forum