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:
Change *.ext to the appropriate extension
Nice command to create a list, you can create too with for command, but this is so faster.
This will start the x11vnc server, scale it at 6/7, will use the vncpass file to authenticate and wont shut down as soon as a client disconnects
on this way we can define the body too
given lines of the form
each 'XXXX' will be replaced with a serial number between 0001 and 0004.
Just use your system preinstalled file
Something I pulled off 4chan, it plays a tune.
I sometimes have use an usb stick to distribute files to several standalone "internet" pc's. I don't trust these machines period. The sticks I have do not have a write protection. So as a added security measure I fill the unused space on the (small) usb stick with a file with randomly generated bits. Any malware that tries to write to this stick will find no space on it.
Tested on slackware 14
Note: you may need root access to write to the device. This depends on your mount options.
To get the list of tickets in a comma-separated list, pipe the above into:
sort | uniq | perl -pe 's/\n/, /' | sed 's/, $//'
srchpymod cairo Surface
['ImageSurface', 'PDFSurface', 'PSSurface', 'SVGSurface', 'Surface', 'SurfacePattern', 'XlibSurface']
./* is for copying files starting with -
.[!.]* is for copying hidden files and avoiding copying files from the parent directory.
..?* is for copying files starting with .. (avoids the directory ..)
/path/to/dir the path to the directory where the files should be copied
Can also be used as a script. Input argument is /path/to/dir
in tcsh, replace .[!.]* with .[^.]*
This command will determine an individuals local weather, based on their I.P. address. I had to learn a lot about SED and a little about XMLStarlet in order to achieve this. This command is my original work and there is much room for improvement; I look forward to any constructive feedback.
This function uses timetrans from the dnssec-tools to calculate the remaining time until a dns entry reaches its time to live and is fetched from the authoritive nameserver again.
Put this command on /etc/rc.local.
-i sets the source file
-r sets the output frame rate, set it to the same frame rate as the input to output each frame
-f sets the output format, trough it might be guessed by the extension
Created to deal with an overzealous batch rename on our server that renamed all files to .jpg files.