Commands using ssh (347)

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

Generate a random text color in bash
The expression $(( $RANDOM * 6 / 32767 + 1 )) generates a random number between 1 and 6, which is then inserted into the escape sequence \e[3_m to switch the foreground color of the terminal to either red, green, yellow, blue, purple or cyan. The color can be reset using the escape sequence \e[0m. The full list of colors can be found here: https://wiki.archlinux.org/index.php/Color_Bash_Prompt#List_of_colors_for_prompt_and_Bash

Mark packages installed with build-dep for autoremove (on Debian/Ubuntu)
Replace PACKAGE with desired package name. Found here: http://mikebeach.org/2011/04/undo-apt-get-build-dep/

Record camera's output to a avi file
video.avi is the resulting file. Press Ctrl+c to stop the recording. You can change the OVC option to another to record into a different format.

Create a persistent remote Proxy server through an SSH channel
Create a persistent remote Proxy server through an SSH channel.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Sort netflow packet capture
Sort netflow packet capture by unique connections excluding source port.

Check host port access using only Bash:

View facebook friend list [hidden or not hidden]
There's no need to be logged in facebook. I could do more JSON filtering but you get the idea... Replace u=4 (Mark Zuckerberg, Facebook creator) with desired uid. Hidden or not hidden... Scary, don't you?

Paste hardware list (hwls) in html format into pastehtml.com directly from console and return URI.
In this Linux box i need to become root to get the complete hardware list, so either become root before or call it with sudo as i did, your choice.

burn an ISO image to writable CD
Does life get much easier? Read up about wodim for an understanding of its origins in relation to the older `cdrecord` utility


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: