10 Handy commands
Some linux handy commands for everyday use.
1)Convert Youtube videos to MP3:
youtube-dl -t --extract-audio --audio-format mp3 YOUTUBE_URL_HERE
2)Get your external public IP:
curl ifconfig.me
3)Get a list of IP Addresses that have failed to login via SSH:
cat /var/log/auth.log | grep -i "pam_unix(sshd:auth): authentication failure;" | cut -d' ' -f14,15 | cut -d= -f2 | sort | uniq
4)Background a wget download:
wget -b http://dl.google.com/android/android-sdk_r14-linux.tgz
5)Transfer files with rsync over ssh on a non-standard port.:
rsync -P -e 'ssh -p PORT' SRC DEST
6)Open a file explorer on a split screen inside your vim session:
:Sex
7)Change file time stamp:
touch -t [[CC]AA]MMJJhhmm[.ss]
8)Tunnel a MySQL server listening on a UNIX socket to the local machine:
socat TCP-LISTEN:5500 EXEC:'ssh user@remotehost "socat STDIO UNIX-CONNECT:/var/run/mysqld/mysqld.sock"'
9)Create .pdf from .doc:
wvPDF test.doc test.pdf
10)Generate Random Passwords.Just change 6 to 9 or 12 or more (multiple of 3) to have bigger password:
openssl rand 6 -base64
More commands will be updated in upcoming posts.
Comments
Post a Comment