subota, 25. veljače 2012.
Generate a random password 30 characters long
$ strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo
petak, 24. veljače 2012.
četvrtak, 23. veljače 2012.
Check open ports
$ sudo lsof -Pni4 | grep LISTEN
$ sudo lsof -i -P | grep -i "listen"
or
$ sudo su -
# lsof -Pni4 | grep LISTEN
# lsof -i -P | grep -i "listen"
subota, 18. veljače 2012.
Show apps that are using the Internet connection at that moment
Open Terminal, CLI, Terminator , and enter this line...
$ lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2
$ lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2
petak, 17. veljače 2012.
Get your external IP address
Get your external IP address
$ $ curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"
or
$ dig +short myip.opendns.com @resolver1.opendns.com
or
$ curl ip.appspot.com
or
$ sudo apt-get install curl
$ curl ifconfig.me
$ watch -n 1 "netstat -tpanl | grep ESTABLISHED"
Monitor TCP opened connections
$ $ curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"
or
$ dig +short myip.opendns.com @resolver1.opendns.com
or
$ curl ip.appspot.com
or
$ sudo apt-get install curl
$ curl ifconfig.me
$ watch -n 1 "netstat -tpanl | grep ESTABLISHED"
Monitor TCP opened connections
How to check Linux version from command line
$ cat /proc/version
Ubuntu / Xubuntu
$ cat /etc/lsb-release
Ubuntu / Xubuntu
$ cat /etc/lsb-release
nedjelja, 12. veljače 2012.
Check if a machine is online
$ ping -c 1 -q MACHINE_IP_OR_NAME >/dev/null 2>&1 && echo ONLINE || echo OFFLINE
Pretplati se na:
Postovi (Atom)