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:
Please install aria2c before you try the above command. On ubuntu the command to install aria2c would be:
sudo aptitude install aria2
Can be used in a working copy to output the URL (extracted from svn info), or as part of another function, as $(svnurl some/path). Saves a lot of time in my SVN workflow.
Comcast is an ISP in the United States that has started hijacking DNS requests as a "service" for its customers. For example, in Firefox, one used to be able to do a quick "I'm Feeling Lucky" Google search by typing a single word into the URL field, assuming the word is not an existing domain when surrounded by www.*.com. Comcast customers never receive the correct NX (non-existent domain) error from DNS. Instead, they are shown a page full of advertising. There is a way to "opt out" from their service, but that requires having the account password and the MAC address of your modem handy. For me, it was easier just to set static DNS servers. But the problem is, which ones to choose? That's what this command answers. It'll show you the three _non-hijacked_ Comcast DNS servers that are the shortest distance away.
Perhaps you don't have Comcast (lucky you!), but hopefully this command can serve as an example of using netselect to find the fastest server from a list. Note that, although this example doesn't show it, netselect will actually perform the uniq and DNS resolution for you.
Requires: netselect, curl, sort, uniq, grep
Same thing just a different way to get there. You will need lynx
For the record: I didn't build this. Just shared what I found that worked. Apologies to the original author!
I decided I should fix the case where http://example.com is not matched for the next time I need this. So I read rfc1035 and formalized the host name regex.
If anyone finds any more holes, please comment.
Quick and kludgy rss parser for the recent tracks rss feed from last.fm. Extracts artist and track link.
Run this as root, it will be helpful to quickly get information about the loaded kernel modules.
If used without arguments, returns own IP info.
If used with argument, returns info about the parsed argument.
trying to copy all your dotfiles from one location to another, this may help
Of course, you can adjust "Maildir" to your config...
but you can't see the colors in that sample output :(
Work for me on CentOS, grep and print ip addresses of ssh bruteforce attempts
Handles everything except octets with 255. Ran through ip generator with variable octet lengths.
search argument in PATH
accept grep expressions
without args, list all binaries found in PATH
works on all Unices
works one bash and ksh.
xargs can be used in this manner to download multiple files at a time, and xargs will in this case run 10 processes at a time and initiate a new one when the number running falls below 10.
just bored here at work ... if your are daring ... add '| bash' .... enjoy