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.
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:
Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:
When bundle install sucks ...This runs isuckat_ruby.rb and when stderror matches find gem ' it will gem install what ever is missing ...
List all dependencies manifests so you can install them.
In a scenario where you want to deploy a number of web applications and run their dependency managers, how could you run all of them in a systematic order.
One of the complexity is to ensure you get only your own top level dependencies. That way, you don recursively call development dependencies of your own dependencies.
Otherwise you might end up discovering dependency management manifests that are already been pulled by your own projects.
# Using this command
This command helps me find them and I can then run what?s required to pull them from their respective sources.
This command assumes the following:
1. Your code checkouts are in a flat repository layout (i.e. not nested).
2. Finds manifests for:
- NPM (nodejs),
- Composer (php),
- requirements.txt (Python), and
- git submodules
Extracts 2nd-level domain part (or 3rd level, for co.* or com.*) from the URI's hostname. See sample output.
Ruby Version Manager (RVM) - https://rvm.io/
Here's how to serve a directory in one line of Ruby.
Handy for sharing files at a conference, for example.
Shows a list of all installed cows saying a fortune. Also lists the cows names. Pic your favorite cow!
Needs cowsay, fortune and ruby installed. The path only applies to OS X with cowsay installed using homebrew. On Linux it might be /usr/share/cowsay/cows/ or similar. Uses ruby just because.
You can also deploy a specific tag:
cap -s tag=my_tag deploy
. a Ruby SSH helper script
. reads a JSON config file to read host, FQDN, user, port, tunnel options
. changes OSX Terminal profiles based on host 'type'
put 'ash' ruby script in your PATH
modify and copy ashrc-dist to ~/.ashrc
configure OSX Terminal profiles, such as "webserver", "development", etc
run "ash myhostname" and away you go!
v.2 will re-attach to a 'screen' named in your ~/.ashrc
Commandline perl filter for, using a production.log from a rails app, display on realtime the count of requests grouped by "seconds to complete" (gross round, but fair enough for an oneliner) :)
"-n" loops around ; "-e" executes the given quoted string ; "$_" is the current line ; "split" creates an array on white space; each item of the array is "collected" to be then "capitalized" ; the array is "joined" back into a string.
Also, a perl version:
perl -e 'printf("%.2x.",rand(255))for(1..5);printf("%.2x\n",rand(255))'
Can be useful to granulary flush files in a CDN after they've been changed in the S3 bucket.