Commands by shadyabhi (3)

  • List SAN Domains for a certificate Show Sample Output


    0
    echo | openssl s_client -connect google.com:443 2>&1 | openssl x509 -noout -text | awk -F, -v OFS="\n" '/DNS:/{x=gsub(/ *DNS:/, ""); $1=$1; print $0}'
    shadyabhi · 2020-04-10 06:56:51 88
  • Blinks LED of a NIC card. Its used when you have multiple NICs and you want to identify the physical port of a particular ethernet card.


    15
    ethtool -p eth0
    shadyabhi · 2010-10-28 16:07:18 6
  • Just add this to your .bashrc file. Use quotes when query has multiple word length. Show Sample Output


    2
    findlocation() { place=`echo $1 | sed 's/ /%20/g'` ; curl -s "http://maps.google.com/maps/geo?output=json&oe=utf-8&q=$place" | grep -e "address" -e "coordinates" | sed -e 's/^ *//' -e 's/"//g' -e 's/address/Full Address/';}
    shadyabhi · 2010-10-18 21:11:42 15

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Get a list of IP Addresses that have failed to login via SSH
This command shows a sorted list of the IP addresses from which there have been authentication errors via SSH (possible script kiddies trying to gain access to your server), it eliminates duplicates so it's easier to read, but you can remove the "uniq" command at the end, or even do a "uniq -c" to have a count of how many times each IP address shows in the log (the path to the log may vary from system to system)

Install pip with Proxy
Installs pip packages defining a proxy

hibernate

ls not pattern
I've been looking for a way to do this for a while, get a not pattern for shell globs. This works, I'm using to grab logs from a remote server via scp.

check open ports without netstat or lsof

Function to remove a directory from your PATH
Function to remove a specified path from your PATH environment variable.

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)

Find Duplicate Files (based on size first, then MD5 hash)
Finds duplicates based on MD5 sum. Compares only files with the same size. Performance improvements on: $find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate The new version takes around 3 seconds where the old version took around 17 minutes. The bottle neck in the old command was the second find. It searches for the files with the specified file size. The new version keeps the file path and size from the beginning.

Determining the excat memory usages by certain PID
this command gives you the total number of memory usuage and open files by the perticuler PID.

Check wireless link quality with dialog box
The variable WIRELESSINTERFACE indicates your wireless interface


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: