Archive for the ‘IT’ Category

JQuery Datatable

I use to play my faceboook app Chinese poker on my Iphone on my way home from work. My connection is not fast enough and it made the game less interest. . I felt also a litle bit frustrated. I need to do something about it and out comes JQuery Datatable. JQuery Datatable generates a [...]

JQuery history

Was curious on how window.history.pushState works and since I have been used jQuery history plugin on my Facebook application for years (Thanks to Taku Sano, Takayuki Miwa, Lincoln Cooper!) and still ran on an old version I decided to add support for new feature in HTML5 and rewrite it a litle bit. How does pushState [...]

Emacs selected command, config and practice

This is a collection of things I found usefull regarding emacs. It will grow … .emacs Add those bellow in the file ~/.emacs ;; do not make backup files (setq make-backup-files nil) ;; php syntax color (load “php-mode”) (add-to-list ‘auto-mode-alist ‘(“\\.php[34]?\\’\\|\\.phtml\\’” . php-mode)) X forwarding with ssh ssh -X your.ssh.domain.com ~$emacs somefile will start an [...]

ReferenceError #1065: can not create property 0 on … (and #1069)

Last week, I was trying to create a shuffle function on my array class which extends the native Array class. I got the ReferenceError when running the code bellow. The reason is that Array is a dynamic class and my is not. Since Array is dynamic, it will try to create new property when you [...]

Limit access with firewall ufw

Here is some links on how you can reject requests using firewall ufw. http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html http://www.ubuntu-unleashed.com/2008/05/howto-take-use-setup-and-advantage-of.html

Limit http methods

I you have an apache server which you only use GET and POST methods I think it is better that you limit the access. Since there are many methods it is more convinient to use the opposite functions, limitExcept. Bellow is an example how it would look like. The limitExcept directive allows only GET and [...]

Deny requests from specific ips, configured in virtual host

Bad thing has hapened to me this holliday. The server has been attacked from serveral ips or more precis they used my server as proxy for attacking other targets. Lucky for me that my server is not configured for this kind of attacks. However, they kept request my server and I wanted that apache would [...]

How to get/kill process in ubuntu

For example if process name is php, you can get a list of jobs by using the command bellow ps aux | grep php Result root 7749 0.0 0.1 3236 796 pts/2 S+ 16:09 0:00 grep php root 19292 1.8 5.6 90624 28528 ? S 01:36 16:09 php test.php To kill a process you can [...]

Howto enable ssl and create self-signed ssl certificate

Enable ssl In my case it was simple. I just ran this line a2enmod ssl Generate self-signed ssl certificate Solution: http://www.akadia.com/services/ssh_test_certificate.html Just follow instruction carefully. Make sure that i step 2 you need to enter a correct “Common Name”, ie your domain. Step 5 and 6 also different for different distributions and installation … Summary [...]

How to set default OS in boot.ini

This is a boot setup for Microsoft Windows XP Professional and Ubuntu (wubi) where we have Windows XP as default and will be preselected on start of computer. This content can be found in c:\boot.ini (be aware this is a hidden system file). [boot loader] timeout=15 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS   [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect [...]