Posted on August 9, 2010, 11:09 pm, by Van Nhu.
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 gui emacs [...]
Posted on February 6, 2010, 10:35 am, by Van Nhu.
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
Posted on December 26, 2009, 10:32 pm, by Van Nhu.
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 [...]
Posted on November 22, 2009, 5:19 pm, by Van Nhu.
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 [...]
Posted on November 15, 2009, 4:51 pm, by Van Nhu.
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 in case link above is not [...]
Posted on November 15, 2009, 12:31 pm, by Van Nhu.
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 /NoExecute=OptIn
c:\wubildr.mbr="Ubuntu"
If we wish to start with [...]
Posted on November 3, 2009, 9:34 pm, by Van Nhu.
To install package called package.deb type the following command (make sure that all dependencies are installed)
sudo dpkg -i /path/to/folder/package.deb
Posted on October 21, 2009, 11:02 pm, by Van Nhu.
If you need to run a php script in Linux environment via putty or other clients and want to close client without terminating the running process of php script you may need to do as bellow. The keyword is nohup …
nohup php policyserver.php > /dev/null 2>&1 &