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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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:
compare to alternative :
- directly tests the -STOP of the process to continue or stop loop,
- background operator should be set (or not) at the call of the function
For extension i suggest a slowPID() based on kill like above and a slowCMD based on killall.
Some IO intensive process make the system unresponsive. This function periodically starts/stops a process, which hopefully releases some resources for other activities.
This function is useful when ionice is not available
This takes a webcam picture every everytime the mouse is moved (waits 10 seconds between checking for movement) and stores the picture wherever you want it.
Ideas:
Use in conjunction with a dropbox type application to see who is using your computer
Use /dev/input/mice if /dev/input/mouse* doesn't work
Use the bones of this to make a simple screensaver
Replace "[email protected]" with your carrier's SMS gateway identifier. The one in the sample is for AT&T. More here https://en.wikipedia.org/wiki/List_of_SMS_gateways. Helpful for getting notifications about long running commands. ";" executes regardless of exit status of last command. && will only notify you if the command succeeds.
A tweak using Patola's code as a base, this full-width green matrix display has all the frills (and all the printable characters).
You don't need the surrounding parens if you don't care about losing globbing capabilities. Z-shell (/bin/zsh) needs neither the parens nor the `set -o noglob`
Screen shot (animated): http://desmond.imageshack.us/Himg32/scaled.php?server=32&filename=matrixh.gif&res=landing
If it's too slow, try lowering the `sleep 0.05` or even replacing it with `true` (which is faster than `sleep 0`).
I squashed it as narrow as I could to conserve space, though somebody could probably squeeze a char or two out.
Enjoy!
Usage:
watch ls -l
Basic but usable replacement for the "watch" command for those systems which don't have it (e.g. the Solaris I'm trapped on).
Type Ctrl+V to escape the following Ctrl+L which clears the screen. It will be displayed as "^L".
Says time every 5 seconds in hours, minutes and seconds using festival.
Will finish automagically when mplayer quits. Can be run from any directory.
It seems to finish by it self rarely, probably because of some timing issue? There's probably a way around that which I can't think of right now
The previously-posted one-liner didn't work for me for whatever reason, so I ended up doing this instead.
Useful contexts :
You are doing yoga or some other physical training in which you are holding a position.
Or you practice the pomodoro productivity technique.
Or your girlfriend said "We're leaving in 40 minutes".
Design details:
sleep executes before espeak to give you a 5 seconds head start.
espeak is run in the background so it doesn't mess up the timing.
change the time that you would like to have as print interval
and just use it to say whatever you want to
Use the excellent sensiblepasswords.com to a generate random (yet easy-to-remember) password every second, and copy it to the clipboard. Useful for generating a list of passwords and pasting them into a spreadsheet.
This script uses "madebynathan"'s "cb" function (http://madebynathan.com/2011/10/04/a-nicer-way-to-use-xclip/); you could also replace "cb" with
xclip -selection c
Remove "while true; do" and "; done" to generate and copy only 1 password.
Found on https://bitcointalk.org/index.php?topic=55520.0
Checks whether your power supply is still plugged in.
If not it will trigger an alarm at maximum volume.
Yeah yeah, another "render man page in pdf", but this time it creates a temporary PDF that stays resident in memory for viewing, but is eliminated on the filesystem.
Replace evince with your PDF viewer of choice.
There are a lot of commands, which invokes your player at specified time. But I prefer not to jump from by bed, when alarm start to play. Instead, this script increases volume of mpd over time, which much more pleasant when you just woke up :)
Original submitted version would break if any filenames had whitespaces in them. The command is a Bad Idea anyhow, because you will end up `cat`ing a binary or something else specacularly bad.
The better alternative to #9756.
I don't think I'd ever use the original command, but this one was so bad I had to post this. Sorry.
1. $(ls) is dumb, and will give errors if you have an alias like "ls -Fs"
2. clear is better and more portable than reset state.
3. if you're interested in differences, then use diff, not cat.
poorman's ifstat using just sh and awk. You must change "eth0" with your interface's name.