Friday, October 7, 2011
How to install kubuntu-desktop
Sunday, June 26, 2011
To find out what application is listening on a port
lsof -i :80
Tuesday, June 22, 2010
How to install VPN Client on Ubuntu 10.04
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.patchpatch < ./vpnclient-linux-4.8.02-64bit.patchsed -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.diffpatch < ./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 tostruct net_device_ops *netdev_ops;in the file locates atfind /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
Sunday, May 30, 2010
SSH with PHP
sudo apt-get install apache2 php5 libapache2-mod-php5sudo /etc/init.d/apache2 restart
sudo vi /etc/hostssudo vi /etc/hostname
sudo apt-get install libssh2-1-dev libssh2-php
php -m | grep ssh2
Sunday, May 9, 2010
Linux system monitoring command
Sunday, April 18, 2010
Removing Ubuntu from dual-boot with Vista
Thursday, April 8, 2010
Remote Desktop on Linux

As previously mentioned on the previous post, I'm now trying to use my Ubuntu and leave Vista.
Linux to Cisco console via USB
Thursday, September 24, 2009
My note on creating a user
Quota in Linux
Tuesday, April 7, 2009
Command of the day
Wednesday, March 18, 2009
Command of the day
Wednesday, March 11, 2009
Install FreeTDS on Ubuntu
Here is how I did it - already running working LAMP with PHP5.
sudo apt-get install freetds-dev sudo apt-get source php5 cd php5-5.1.2/ext/mssql sudo apt-get install php5-dev sudo phpize sudo ./configure --with-mssql sudo make cd modules cp mssql.so /usr/lib/php5/20051025 sudo vi /etc/php5/apache2/php.ini
extension = mssql.so
sudo /etc/init.d/apache2 restart
To test my connection tried code from PHP.net using MSSQL_CONNECT
// Server in the this format: \ or
// , when using a non default port number
$server = 'DBSERVERNAME.corp.DOMAIN.com';
$link = mssql_connect($server, 'UserName', 'UserPassword');
if(!$link)
{
die('Something went wrong while connecting to MSSQL');
}
?>
Test
Monday, October 27, 2008
How-To Change Time Zone in Linux
Steps
- Logged in as root, check which timezone your machine is currently using by executing `date`. You'll see something like
Mon 17 Jan 2005 12:15:08 PM PST, PST in this case is the current timezone. - Change to the directory
/usr/share/zoneinfohere you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory. - If you wish, backup the previous timezone configuration by copying it to a different location. Such as
mv /etc/localtime /etc/localtime-old
- Create a symbolic link from the appropiate timezone to /etc/localtime. Example:
ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
- If you have the utility rdate, update the current system time by executing
/usr/bin/rdate -s time-a.nist.gov
- Set the ZONE entry in the file
/etc/sysconfig/clockfile (e.g. "America/Los_Angeles") - Set the hardware clock by executing:
/sbin/hwclock --systohc
Thursday, September 25, 2008
Install Exim with DKIM and Domainkeys on DirectAdmin
wget http://duncanthrax.net/exim-experimental/libdkim-1.0.16-tk.tar.gztar zxvf libdkim-1.0.16-tk.tar.gzcd libdkim-1.0.16-tkcd srcmakemake installcd ..cp lib/libdkim.a /usr/libcp include/dkim.h /usr/include/
tar zxvf libdomainkeys-0.69.tar.gzcd libdomainkeys-0.69makeecho -lresolv > dns.libmakemake installcp *.h /usr/local/include/cp *.a /usr/local/lib
wget http://files.directadmin.com/services/all/exim/exim-4.69.tar.gztar xvzf exim-4.69.tar.gzcd exim-4.69/Localwget http://www.directadmin.com/Makefileperl -pi -e 's/^EXTRALIBS/#EXTRALIBS/' Makefile
EXPERIMENTAL_DKIM=yesCFLAGS += -I/usr/includeLDFLAGS += -ldkim -lssl -lstdc++ -L/usr/libEXPERIMENTAL_DOMAINKEYS=yesCFLAGS += -I/usr/local/includeLDFLAGS += -ldomainkeys -L/usr/local/lib#added April 9, 2008HAVE_ICONV=yesCFLAGS=-O -I/usr/local/includeEXTRALIBS_EXIM=-L/usr/local/lib -liconv#end add
cd ..makemake install
cp -f /usr/sbin/exim-4.69-12 /usr/sbin/exim/sbin/service restart exim
Monday, February 18, 2008
Apache prompt for pass-phrase on every start up
Found the solution as below.
How can I get rid of the pass-phrase dialog at Apache startup time?
The reason this dialog pops up at startup and every re-start is that the RSA private key inside your server.key file is stored in encrypted format for security reasons. The pass-phrase is needed decrypt this file, so it can be read and parsed. Removing the pass-phrase removes a layer of security from your server - proceed with caution!
- Remove the encryption from the RSA private key (while keeping a backup copy of the original file):
$ cp server.key server.key.org
$ openssl rsa -in server.key.org -out server.key
- Make sure the server.key file is only readable by root:
$ chmod 400 server.key
Now server.key contains an unencrypted copy of the key. If you point your server at this file, it will not prompt you for a pass-phrase. HOWEVER, if anyone gets this key they will be able to impersonate you on the net. PLEASE make sure that the permissions on this file are such that only root or the web server user can read it (preferably get your web server to start as root but run as another user, and have the key readable only by root).
As an alternative approach you can use the ``SSLPassPhraseDialog exec:/path/to/program'' facility. Bear in mind that this is neither more nor less secure, of course.
source: http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#removepassphrase
Friday, February 15, 2008
Securing MySQL step-by-step
Thursday, February 14, 2008
Instal Apache SSL on Ubuntu
- apt-get install apache libapache-mod-ssl
- dpkg-reconfigure libapache-mod-ssl
- fill in all details with your details
- cp /usr/share/doc/libapache-mod-ssl/examples/mod-ssl.conf /etc/apache/conf.d/
- cp /usr/share/doc/libapache-mod-ssl/examples/vhost.conf.gz /etc/apache/conf.d/
- cd /etc/apache/conf.d/
- gzip -d vhost.conf.gz
- edit vhost.conf and change all snakeoil references to server. ie. snakeoil-dsa.crt = server.crt
- stop apache
- start apache
Saturday, December 22, 2007
Installing SSLeay on Ubuntu
I finally realized that there are always an easy way to do it on Ubuntu, as usual, by using apt-get.
Here is the command to install SSLeay on Ubuntu
sudo apt-get install libnet-ssleay-perl
sudo apt-get install libcrypt-ssleay-perl
Tuesday, November 13, 2007
Installing Debian without any CD installer
Finally I found a very good page on Debian website, telling that it is possible to install Debian without any Debian CD. It said that Debian can be installed over the network as long as I have a working *NIX OS on my machine. It is a very good solution to me since I have Ubuntu already on my machine. Then I only need to create another partition for Debian, follow the steps, and then now I'm running Debian.
The complete instructions can be found here
There are some additional steps need to be done on my machine since the instructions above will only install Debian without the GUI.
Here are the steps:
1) Login as root
2) apt-get install x-windows-system-core
3) apt-get install gdm
4) apt-get install gnome
That's it. Have a nice try.