Archive for the ‘Operative system’ Category

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 [...]

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

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 [...]

How to install a .deb file

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

How to run php script via putty or command line

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 &