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:
Little faster alternative.
This is a convinient way to do it in scripts. You also want to rm the ip.php file afterwards
Download Gsplitter extension, and execute it with Chrome !
Or download it here :
Useful for ripping wallpaper from 4chan.org/wg
Seeing that we get back plain text anyway we don't need lynx. Also the sed-part removes the credit line.
Download google video with wget. Or, if you wish, pass video URL to ie mplayer to view as stream.
1. VURL: replace with url. I.e. http://video.google.com/videoplay?docid=12312312312312313#
2. OUPUT_FILE : optionally change to a more suited name. This is the downloaded file. I.e. foo.flv
# Improvements greatly appreciated. (close to my first linux command after ls -A :) )
Breakedown pipe by pipe:
1. wget: html from google, pass to stdout
2. grep: get the video url until thumbnailUrl (not needed)
3. grep: Strip off everything before http://
4. sed: urldecode
5. echo: hex escapes
6. sed: stipr of tailing before thumbnailUrl
7. wget: download. Here one could use i.e. mplayer or other...
I have a server with a php requiring basic authentication, like this:
header('WWW-Authenticate: Basic realm="do auth"');
header('HTTP/1.0 401 Unauthorized');
And the basic authentication in wget do not worked:
wget --auth-no-challenge --http-user="username" --http-password="password" -O- "http://url"
wget --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cokies.txt --http-user="username" --http-password="password" -O- "http://url"
I always received the 401 Authorization failed.
The saved cookie is always empty.
With my way, I received the header from the server and save the cookie, then resend the session cookie with authentication data
Is a simple script for video streaming a movie
Get gzip compressed web page using wget.
Caution: The command will fail in case website doesn't return gzip encoded content, though most of thw websites have gzip support now a days.
Add the BackTrack repositories to your Debian based GNU/Linux distribution. Thanks to http://it-john.com/home/technology/linux-technology/add-back-track-4-repo-to-ubuntu/
Watch a video while it's downloading. It's additionally saved to the disk for later viewing.
Just added view with the eog viewer.
some other options:
much more with piggybank as scraper
works well with your favourite curses or non-curses http clients
Grabs the ip2location site and removes everything but the span tag containing the country value. Place it inside your .bashrc or .bash_aliases file.
I use this command in my Conky script to display the number of messages in my Gmail inbox and to list the from: and subject: fields.