commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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.
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:
This utilizes the Requests and BeautifulSoup libraries in Python to retrieve a user page on commandlinefu, parse it (error-tolerant) and extract all the lines of the following format:
To print them, a list comprehension is used to iterate over the values, and join() is called on a newline character.
If you tried the other Python version of Convert JSON to YAML and you end up with lines that has "!!python/unicode", this version of the command is for you.
Rainbow Stream is a smart and nice Twitter client on terminal.
Almost everything you can do with a GUI application can be done, even viewing an image.
- Tab-autocomplete, history browsing
- Beautiful built-in themes and custom configuration support
- Tweet's images directly on your terminal.
piped this to pbcopy (OSX only) you got a uuid in the pasteboard
You need to apt-get install python-sqlparse. This command simply formats a sql query and prints it out. It is very useful when you want to move a sql query from commandline to a shell script. Everything is done locally, so you don't need to worry about copying sql query to external websites.
Install twistd first with
sudo apt-get install python-twistd-web
Good because it doesn't use Sed.
Convert JSON to YAML.
Note that you'll need to have PyYaml installed.
Converts YAML file to JSON.
Note that you'll need to install PyYAML. Also some YAML data types (like dates) are not supported by JSON).
Generate a Netscape cookies file to use with Python's mechanize.
Generate a 18 character password from character set a-zA-Z0-9 from /dev/urandom, pipe the output to Python which prints the password on standard out and in crypt sha512 form.
Terminal Color tester using python, works with py2 and 3
Pre-packaged python script that comes with Debian/Ubuntu.
Uses pygmentize and python to create indented and colorized JSON output
Sample USAGE: f = open(os.path.join(__location__, 'bundled-resource.jpg'));
vs. map(unicodedata.name, u'\u2022')
(1) required: python-googl ( install by: pip install python-googl )
(2) get from google API console https://code.google.com/apis/console/
Realtime lines per second in a log file using python ... identical to perl version, except python is much better :)
You can use "decode()" in a similar manner:
python -c 'print "68656c6c6f".decode("hex")'