Error:
lamnk@lamnk:~% sudo php-fpm start
Starting php_fpm Error in argument 1, char 1: no argument for option -
Usage: php-cgi [-q] [-h] [-s] [-v] [-i] [-f ] php-cgi [args...]
-a Run interactively
-C Do not chdir to the script's directory
-c | Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f Parse . Implies `-q'
-h This help -i PHP information
-l Syntax check only (lint)
-m Show compiled in modules -q Quiet-mode. Suppress HTTP Header output.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z Load Zend extension
................................... failed
Reason:
The old config file php-fpm.conf is located at /etc. However the new config file is moved to /usr/etc.
I don’t know why is that. I’ve used the exact same old configuration directives …
Fix:
Move or copy php-fpm.conf from /etc to /usr/etc. Problem solved.
Sometimes your DHCP service is not able to pull an IP addresse, that means the network stack on Windows goes banana. To fix that, open command prompt with administrator privilege (click on Start -> type in “cmd” -> right click on the command prompt and choose “Run as Administrator”) and type these command:
netsh int ip reset C:\netsh.log.txt
netsh winsock reset
… then all your network configuration is reset.
Yesterday I wanted to clean around my home directory:
rm dmesg.txt feh_02 * boot.txt test.txt test.txt~ xxxtest.txt
And this is the result:
zsh: sure you want to delete all the files in /home/lamnk [yn]? n
zsh: sure you want to delete all the files in /home/lamnk [yn]? y
rm: cannot remove `feh_02': No such file or directory
rm: cannot remove `Customization': Is a directory
rm: cannot remove `Desktop': Is a directory
rm: cannot remove `Documents': Is a directory
rm: cannot remove `Download': Is a directory
rm: cannot remove `Dropbox': Is a directory
rm: cannot remove `Ebooks': Is a directory
rm: cannot remove `Movies': Is a directory
rm: cannot remove `Music': Is a directory
rm: cannot remove `Photos': Is a directory
rm: cannot remove `Pictures': Is a directory
rm: cannot remove `Truyentranh': Is a directory
rm: cannot remove `backup': Is a directory
rm: cannot remove `builds': Is a directory
rm: cannot remove `boot.txt': No such file or directory
rm: cannot remove `test.txt': No such file or directory
rm: cannot remove `test.txt~': No such file or directory
rm: cannot remove `xxxtest.txt': No such file or directory
Luckily i didn’t issue rm -rf as usual …
I will look at shell’s warning before press Y
I will look at shell’s warning before press Y
I will look at shell’s warning before press Y
[repeat 1000 times]
… and still press y on reflex …
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
If you can't install or have a problem please leave a comment
I always fall for this error when compile rtorrent, so … :
Error:
checking for STUFF... configure: error: Package requirements (sigc++-2.0) were not met:
No package 'sigc++-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables STUFF_CFLAGS
and STUFF_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Fix:
$ updatedb
$ locate pkgconfig | grep sigc++-2.0.pc
You will see something like /usr/lib/pkgconfig/sigc++-2.0.pc. If it is not there, then go install libsigc++ (it’s not in official CentOS repo).
Then define the PKG_CONFIG_PATH variable as the configure script suggests:
$ export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
Run configure script for libtorrent again. --prefix= should be the same for libsigc++, libtorrent and rtorrent, otherwise they will complain
./configure --prefix=/usr && make
What is R ? R is a programming language and software environment for statistical computing and graphics. It is developed by
statisticians around the world and is free software, released under the GNU General Public License.
In order to import .xls file into R, we must convert the file to csv first. One way to this is to open xls files in a speadsheet application and then export to csv format. Another way is to use a small convert program, handily available on … Google. An example: xls2csv:
xls2csv -x dataset.xls -c dataset.csv
After converting to csv, import data with
> dataset1 <- read.csv(file = "~/dataset.csv")
Picture worths thousand words …

apc cpu improvement
I have never used a PHP accelerator before. Now it is a must to install APC for every new server (if you have enough memory to throw around).
Can’t stop LOL

If you don’t know that Kamehameha is, read Dragon Ball serie.
Here we go:
- Best Picture: A curious case of Benjamin Button Slumdog Millionaire (a bit off)
- Bes Actor: Mickey Rourke Sean Penn (Sean was really good in Milk but can’t compare to Mickey. Anyway …)
- Bes Actress: Kate Winslet (spot on
)
- Best Supporting Actor: Heath Ledger (of course)
- Bes Supporting Actress: Marisa Tomei Penelope Cruz (the hardest award to guess)
- Bes Director: Danny Boyle (see the comment down there
)
If Slumdog Millionaire gets Best Picture (I highly doubt it), then Best Director would go to David Fincher. (Arrggh)
Updated.
You may have this error when require ‘xml/mapping’ in your ruby script:
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- xml/mapping (LoadError)
Solution: go to the gem directory of XML-Mapping (mine is /usr/lib/ruby/gems/1.8/gems/xml-mapping-0.8.1/lib/) and chmod all files in this directory to 644.
Who is to point finger at here ? Rubygem or XML-Mapping authors ?