Monthly Archives: October 2012

Swap file creation

Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):

dd if=/dev/zero of=/swapfile bs=1024 count=524288

Set up a Linux swap area:

mkswap /swapfile

Activate /swapfile1 swap space immediately:

swapon /swapfile

To activate /swapfile after Linux system reboot, add entry to /etc/fstab file.

vim /etc/fstab

Append the following line:

/swapfile swap swap defaults 0 0

nmap – scan an ip range for a single open port

nmap -p80 192.168.0.0/24 -oG - | grep 80/open

Example

[modinfo@arch-pc ~]$ nmap -p80 192.168.0.0/24 -oG – | grep 80/open
Host: 192.168.0.1 (router)    Ports: 80/open/tcp//http///
Host: 192.168.0.100 (aaa)    Ports: 80/open/tcp//http///
Host: 192.168.0.126 (nsa310)    Ports: 80/open/tcp//http///
Host: 192.168.0.133 (arch-pc)    Ports: 80/open/tcp//http///