The ^python$ is a package name patten. You can change whatever you want. Show Sample Output
A cronjob command line to email someone when a webpages homepage is updated.
You don't need to create an intermediate file, just pipe the output directly to tar command and use stin as file (put a dash after the f flag).
Currently Facebook has updated their headers to display 127.0.0.1 but if you have saved e-mails from messages and FB related mail you can still reveal the IP. :) Tested on Mac OS X 10.6.3 Show Sample Output
Rebuild flv files that are broken (can't seek). This method probably works for other video/audio formats that can become broken in the same way.
See the cols and lines and make sure the console it correctly configured for the screen size. Show Sample Output
Netcat is used to serve a log-file over a network on port 1234. Point a browser to the specified server/port combo to view log-file updates in real-time.
Can be useful to granulary flush files in a CDN after they've been changed in the S3 bucket. Show Sample Output
Simple way to backup your LDAP entries: put this line on your crontab. The -n switch identifies the dbnum you want to backup (alternatively you can use -b suffix. Check man slapcat for your personal switches)
easy way to setup an "internet radio sation", pre-requisite, create an account at an icecast server, in this example, just created beforehand an account at giss.tv. Change the word password, with the respective real password you created at server. Make sure to have installed rec, oggnec, oggfwd and tee. I have a mixer connected at line in, so I can mix music and microphone. This also will produce a local recorded copy of the session, it will be called "streamdump.ogg" Show Sample Output
-d, --delete Delete a user?s password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless.
Some servers don't have ssh-copy-id, this works in those cases. It will ask for the destination server, this can be IP, hostname, or user@hostname if different from current user. Ssh keygen will let you know if a pubkey already exists on your system and you can opt to not overwrite it.
It just colorizes the line based on if it has 0, 1 or 2 tabs at the beginning of the line. Won't work so well if lines already begin with tabs (too bad comm doesn't have an option to substitute \t for something else). Don't forget comm needs input files to be sorted. You can use a shortcut like this with bash: comm Show Sample Output
It is safe when there is "PermitEmptyPasswords no" in /etc/ssh/sshd_config. This command is useful when there is no need to have a password.
Counts TCP states from Netstat and displays in an ordered list. Show Sample Output
Alternative command for performing an sha1 hash for a given set of files matched by a wildcard Show Sample Output
This is useful when you got a reserved IP address like 192.168.0.100 and want to find out what IP address is used to access the Internet. You have to know a server with 'efingerd -n' configured, like www.linuxbanks.cn as above. Other method to find out this information are for example access www.tell-my-ip.com and grep the output. The finger method have the advantage that it is easy to deploy a service like www.tell-my-ip.com, as you only need to get efingerd installed.
Requires the GNU tar ignore zeros option. http://www.gnu.org/software/tar/manual/html_section/Blocking.html Show Sample Output
in "a.html", find all images referred as relative URI in an HTML file by "src" attribute of "img" element, replace them with "data:" URI. This useful to create single HTML file holding all images in it, as a replacement of the IE-created .mht file format. The generated HTML works fine on every other browser except IE, as well as many HTML editors like kompozer, while the .mht format only works for IE, but not for every other browser. Compare to the KDE's own single-file-web-page format "war" format, which only opens correctly on KDE, the HTML file with "data:" URI is more universally supported.
The above command have many bugs. My commandline-fu is too limited to fix them:
1. it assume all URLs are relative URIs, thus works in this case:
<img src="images/logo.png"/>
but does not work in this case:
<img src="http://www.my_web_site.com/images/logo.png" />
This may not be a bug, as full URIs perhaps should be ignored in many use cases.
2. it only work for images whoes file name suffix is one of .jpg, .gif, .png, albeit images with .jpeg suffix and those without extension names at all are legal to HTML.
3. image file name is not allowed to contain "(" even though frequently used, as in "(copy of) my car.jpg". Besides, neither single nor double quotes are allowed.
4. There is infact a big flaw in this, file names are actually used as regular expression to be replaced with base64 encoded content. This cause the script to fail in many other cases. Example: 'D:\images\logo.png', where backward slash have different meaning in regular expression. I don't know how to fix this. I don't know any command that can do full text (no regular expression) replacement the way basic editors like gedit does.
5. The original a.html are not preserved, so a user should make a copy first in case things go wrong.
Prints current runlevel and system start time. On older systems it also shows the last init state. Pretty useful on remote systems, pretty useless on local ones :) Show Sample Output
Debian-specific but very useful as cron files are prone to very subtle gotchas
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session. Show Sample Output
if you need a quick way of printing out all the packages that contain classes this command will print the directory structure and replace '/' with '.' It will also ignore CVS directories (we use CVS here)
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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: