
Terminal - Commands tagged scan - 9 results
scanimage -p --resolution 250 --mode Gray -x 215.9 -y 279.4 | pnmtops -imageheight 11 -imagewidth 8.5 | ps2pdf - output.pdf
This is sample output - yours may be different.
Adjust the --resolution and --mode as required (if these options are available for your scanner).
The size options (-x, -y, -imageheight, -imagewidth) are for US letter paper. For A4, I think the command would be:
scanimage -p --resolution 250 --mode Gray -x 210 -y 297 | pnmtops -imageheight 11.7 -imagewidth 8.3 | ps2pdf - output.pdf
checkport() { sudo nmap -sS -p $1 $2 }
This is sample output - yours may be different.
$ checkport 80 commandlinefu.com
Starting Nmap 5.21 ( http://nmap.org ) at 2011-12-13 11:41 GMT
Nmap scan report for commandlinefu.com (74.207.251.129)
Host is up (0.17s latency).
rDNS record for 74.207.251.129: li93-129.members.linode.com
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.71 seconds
Check to see if a port is open or closed on a given host.
arp-scan -I eth0 -l | perl -ne '/((\d{1,3}\.){3}\d{1,3})/ and $ip=$1 and $_=`nmblookup -A $ip` and /([[:alnum:]-]+)\s+<00>[^<]+<ACTIVE>/m and printf "%15s %s\n",$ip,$1'
This is sample output - yours may be different.
pdftk A=odd.pdf B=even.pdf shuffle A1-end Bend-1S output duplex.pdf
This is sample output - yours may be different.
Joins two pdf documents coming from a simplex document feed scanner. Needs pdftk >1.44 w/ shuffle.
nmap -v -sP 192.168.0.0/16 10.0.0.0/8
This is sample output - yours may be different.
Starting Nmap 5.21 ( http://nmap.org ) at 2010-07-01 XX:XX EDT
Initiating Ping Scan at XX:XX
Scanning 4096 hosts [2 ports/host]
Completed Ping Scan at XX:XX, 1.50s elapsed (31 total hosts)
Initiating Parallel DNS resolution of 4096 hosts. at XX:XX
Completed Parallel DNS resolution of 4096 hosts. at XX:XX, 0.00s elapsed
Nmap scan report for 10.0.0.1 [host down]
[... snip ...]
Nmap scan report for host1.localdomain (10.0.0.21)
Host is up (0.00031s latency).
Nmap scan report for host2.localdomain (10.0.0.22)
Host is up (0.00041s latency).
Nmap scan report for 10.0.0.23
Host is up (0.00039s latency).
Nmap scan report for host3.localdomain (10.0.0.24)
Host is up (0.00037s latency).
Nmap scan report for 10.0.0.25 [host down]
Nmap scan report for 10.0.0.26 [host down]
Nmap scan report for 10.0.0.27 [host down]
Nmap scan report for host4.localdomain (10.0.0.28)
Host is up (0.0047s latency).
Nmap scan report for 10.0.0.29 [host down]
Nmap scan report for 10.0.0.30 [host down]
Nmap scan report for 10.0.0.31
Host is up (0.0033s latency).
Nmap scan report for 10.0.0.32
Host is up (0.0031s latency).
Nmap scan report for 10.0.0.33 [host down]
Nmap scan report for 10.0.0.34 [host down]
Nmap scan report for 10.0.0.48 [host down]
[... snip ...]
Nmap scan report for 10.0.0.49 [host down]
Nmap scan report for 10.255.255.255 [host down]
Nmap done: 4096 IP addresses (7 hosts up) scanned in XXX seconds
nmap for windows and other platforms is available on developer's site: http://nmap.org/download.html
nmap is robust tool with many options and has various output modes - is the best (imho) tool out there..
from nmap 5.21 man page:
-oN/-oX/-oS/-oG : Output scan in normal, XML, s|
sudo arp-scan -I eth0 192.168.1.0/24
This is sample output - yours may be different.
FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i "Reply">> c:\ipaddresses.txt
This is sample output - yours may be different.
c:\ipadresses.txt:
Reply from 10.254.254.1: bytes=32 time<1ms TTL=255
Reply from 10.254.254.2: bytes=32 time<1ms TTL=255
Reply from 10.254.254.3: bytes=32 time=5ms TTL=255
Reply from 10.254.254.30: bytes=32 time<1ms TTL=128
Reply from 10.254.254.31: bytes=32 time<1ms TTL=128
Reply from 10.254.254.32: bytes=32 time<1ms TTL=128
Reply from 10.254.254.33: bytes=32 time<1ms TTL=128
Reply from 10.254.254.34: bytes=32 time<1ms TTL=128
Reply from 10.254.254.60: bytes=32 time<1ms TTL=64
Reply from 10.254.254.61: bytes=32 time=3ms TTL=60
Reply from 10.254.254.62: bytes=32 time<1ms TTL=64
Reply from 10.254.254.63: bytes=32 time=1ms TTL=64
Reply from 10.254.254.90: bytes=32 time<1ms TTL=128
Reply from 10.254.254.201: bytes=32 time<1ms TTL=128
Reply from 10.254.254.202: bytes=32 time<1ms TTL=128
Reply from 10.254.254.204: bytes=32 time<1ms TTL=128
Reply from 10.254.254.205: bytes=32 time<1ms TTL=128
Reply from 10.254.254.206: bytes=32 time<1ms TTL=128
Reply from 10.254.254.207: bytes=32 time<1ms TTL=128
Reply from 10.254.254.208: bytes=32 time<1ms TTL=128
Reply from 10.254.254.209: bytes=32 time<1ms TTL=128
Reply from 10.254.254.212: bytes=32 time<1ms TTL=128
Reply from 10.254.254.213: bytes=32 time<1ms TTL=128
Reply from 10.254.254.214: bytes=32 time<1ms TTL=128
Reply from 10.254.254.215: bytes=32 time<1ms TTL=128
Reply from 10.254.254.217: bytes=32 time<1ms TTL=64
Reply from 10.254.254.221: bytes=32 time<1ms TTL=128
documents all active ips on a subnet and saves to txt file.
for i in {21..29}; do nc -v -n -z -w 1 192.168.0.$i 443; done
This is sample output - yours may be different.
(UNKNOWN) [192.168.0.21] 443 (?) : Connection refused
(UNKNOWN) [192.168.0.22] 443 (?) open
(UNKNOWN) [192.168.0.23] 443 (?) : Connection refused
(UNKNOWN) [192.168.0.24] 443 (?) open
....
...
Simple one-liner for scanning a range of hosts, you can also scan a range of ports with Netcat by ex.: nc -v -n -z -w 1 192.168.0.1 21-443
Useful when Nmap is not available:)
Range declaration like X..X "for i in {21..29}" is only works with bash 3.0+
gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=test.pdf multipageproject.pdf
This is sample output - yours may be different.
Xsane produces PDFs that are too large - particularly multipage PDFs. This command compresses them. If you do not use A4, remove the -sPAPERSIZE flag.