Vahid Ghafarpour's Blog

نكات جالب از نظر وحيد غفارپور!

Sunday, August 26, 2007

Enable SSH on CISCO

http://articles.techrepublic.com.com/5100-1035_11-5875046.html

(config)# ip domain-name ghafarpour.ir
(config)# crypto key generate rsa

(It's better be more than 768 for example 1024)


Tuesday, August 14, 2007

nice script to crash a linux

if you didn't set max user processes in your linux station (or server) this script will f... it

$ :(){ :|:& };:

this simple script which known as bash forkbomb can forks as many processes as possible and can crash systems where no user limits are set

you should fix it with ulimit -u

have fun with images of webpage

go to a website with many images (for example search for a name in google images)
next delete url from address bar and paste following code in your address bar:

javascript:R= 0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI= document.images; DIL=DI.length; function A(){for(i=0; i

/bin/bash: Too many open files in system

I try to use ulimit and sysctl
you can use ulimit -a to see examples or find manpage in man bash

you can set ulimit -n 2048 (for example) to increase it but it should run by root.

if you like to change for all users you can set in /etc/security/limits.conf
for example:
* soft nofile 4096

number of open files per process can be increased only by root and users can decrease it

you can find good information in this page

http://bcr2.uwaterloo.ca/~brecht/servers/openfiles.html

Wednesday, August 1, 2007

Enable sytax highlight in VIM on ubuntu

you can edit or create .vimrc file in your home directory and add this line to it
:syntax enable

or for public users you can do this:
  1. Create a root terminal
  2. Edit the file /etc/vim/vimrc
  3. Search for the word syntax
  4. Remove the double quote mark at the beginning of the line (quote marks to VIM are comments in configuration files)
also you may need to install vim-full