commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
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.
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 "firstname.lastname@example.org" 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.
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.
works the same, but uses festival instead of espeak
allows command to use switches
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".
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.
combination of several of the above
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.