Commands by sxiii (12)

  • This commands does just two things: fakes user agent (the one was taken from recent Android app) and sends the (possibly) listener ID (it can be any - I put "1" here because it works like a charm - after the name of stream ?1 as you can see). Look for the list of stations here: Or here: Best regards, sxiii :) Show Sample Output

    mplayer -user-agent "AudioAddict-di/ Android/5.1"
    sxiii · 2016-04-29 23:41:17 4
  • Just run this command and it will printout all the info available about your current distribution and package management system. Show Sample Output

    echo /etc/*_ver* /etc/*-rel*; cat /etc/*_ver* /etc/*-rel*
    sxiii · 2016-02-19 12:12:38 2
  • Replace the with your URL, for example and it will show likes number Show Sample Output

    curl -,%20total_count,%20share_count,%20click_count,%20comment_count%20FROM%20link_stat%20WHERE%20url%20=%20%27<URL>%27 | awk -F\" '{ print $7 }' | awk -F":" '{ print $2 }' | awk -F"," '{ print $1 }'
    sxiii · 2015-08-19 20:01:15 1
  • Replace KEY with GPG key. This command will load GPG key and add it to your system so you can use software from third party repos etc. Show Sample Output

    x=KEY; gpg --keyserver --recv $x; gpg --export --armor $x | sudo apt-key add -
    sxiii · 2013-11-26 10:49:32 0
  • Processes biglion quantity of sold ebay coupons/bonus codes, so you can know approximate count of users who buyed the coupons and when sales are come up again. You can change sleep parameter so script will work slowly or faster (default is 5 seconds). Additional requirements: curl Standart tools used: awk, date, cat, grep (bash) Show Sample Output

    while true; do date; (curl -s -o 1.html &); sleep 5; cat 1.html | grep "&#1082;&#1091;&#1087;&#1086;&#1085;&#1086;&#1074;" | awk -F"<div>" '{print $2}' | awk -F"<span>" '{print $1}'; done
    sxiii · 2013-11-08 12:40:05 0
  • Requirements: curl, grep, awk, internet connection with access to wikipedia Loaded page: If you can make shorter version of this listgetter, you are welcome to paste it here :) Show Sample Output

    curl | grep "<li>" | awk -F"title=" '{ print $2 }' | awk -F\" '{ print $2 }'
    sxiii · 2013-01-09 21:40:11 1
  • Oneliner to get domain names list of all existing domain names (from wikipedia) Show Sample Output

    curl | grep "<tr valign=\"top\">" | awk -F">" '{ print $5 }' | awk -F"<" '{ print $1 }'
    sxiii · 2012-12-24 21:00:36 0
  • Fixes MP3 tags encoding (to UTF-8). Batch fixes all MP3s in one directory.

    find . -iname "*.mp3" -execdir mid3iconv -e <encoding> {} \;
    sxiii · 2011-12-14 18:10:27 2
  • Outputs pseudo-random sounds to speakers (stereo mode because of -c 2) when there are any kind of network activity. Show Sample Output

    tcpdump | aplay -c 2
    sxiii · 2011-08-27 15:03:02 1
  • This command kills all wine instances and each EXE application working on a PC. Here is command info: 1) ps ax > processes = save process list to file named "processes" (we save it because we don't wont egrep to be found in the future) 2) cat processes | egrep "*.exe |*exe]" = shows the file "processes" and after greps for each *.exe and *exe] in it 3) | awk '{ print $1 }' > pstokill = saves processes PID's to file "pstokill" using awk filter 4) kill $(cat pstokill) = kills each PID in file pstokill, which is shown by cat program 5) rm processes && rm pstokill = removes temporary files Show Sample Output

    ps ax > processes && cat processes | egrep "*.exe |*exe]" | awk '{ print $1 }' > pstokill && kill $(cat pstokill) && rm processes && rm pstokill
    sxiii · 2011-02-26 16:13:58 2
  • This can be used in scripts, to find out the origin of target IP etc. Show Sample Output

    x=; whois $x > $x.txt
    sxiii · 2011-01-17 03:33:49 1
  • Mplayer starts a webcam capture using ASCII art. Only mplayer required

    mplayer -tv driver=v4l2:gain=1:width=640:height=480:device=/dev/video0:fps=10:outfmt=rgb16 -vo aa tv://
    sxiii · 2010-12-07 05:17:00 3

What's this? 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

Turns red the stderr output

convert a web page into a png
This requires the command-line print extension (see #2861 for more details). I use it to make up complex images with formatted text using CSS and whatnot. It's a lot slicker than imagemagick for certain things. Now imagine using a local webserver with PHP and a database to generate the images. Oh, the possibilities...

MP3 player
I tried a few curses based mp3 players for playing back choir practice songs for my wife. Unfortunately none of the ones I tried were capable of scrubbing a track. Firefox saves the day.

Extract a IRC like chat log out of an Adium xml logfile

Content search.
Grep will read the contents of each file in PWD and will use the REs $1 $2 ... $n to match the contents. In case of match, grep will print the appropriate file, line number and the matching line. It's just easier to write $ ff word1 word2 word3 Instead of $ grep -rinE 'word1|word2|word3' .

Continue a current job in the background

Show memory usage of all docker / lxc containers

List empty any directories

tail: watch a filelog
-f file(s) to be monitorized -n number of last line to be printed on the screen in this example, the content of two files are displayed

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

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.


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: