Commands by asphaltleopard (2)

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

return external ip
Get your ip address, hostname, ASN and geolocation information. If you want just one field as a text response you can also get that,eg curl ipinfo.io/ip

find established tcp connections without using netstat!!
Fast and easy way to find all established tcp connections without using the netstat command.

Show numerical values for each of the 256 colors in bash
I like the other three versions but one uses nested loops and another prints every color on a separate line. Both versions fail to reset colors before giving the prompt back. This version uses the column command to print a table so all the colors fit on one screen. It also resets colors back to normal before as a last step.

convert chinese character into wubi86 input code
This CLI requiere the uniconv package that is provided with the yudit unicode editor . The wubi86 is a way to type chinese far quicker than pinyin . More infor on wikipedia : http://en.wikipedia.org/wiki/Wubizixing , http://www.yale.edu/chinesemac/wubi/xing.html

Convert diff output to HTML ins/del

How to remove an ISO image from media database

Get AWS temporary credentials ready to export based on a MFA virtual appliance
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token. This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use: `awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'` You must adapt the command line to include: * $MFA_IDis ARN of the virtual MFA or serial number of the physical one * TTL for the credentials

Figure out your work output for the day
Figures out what has changed in the last 12 hours. Change the author to yourself, change the time since to whatever you want.

Check a server is up. If it isn't mail me.
This version uses netcat to check a particular service.

read unixtimestamp with festival
you will hear how many seconds since 1.1.1970 in english words with billions, millions and thousands. this is very useful, if you want to get over to use the unixtimestamp instead of the 24 hour clock in your dayly life


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: