Here is a round up of what I have noticed in the blog world about the command-line recently, if you know anymore good new links then let me know!
cURL tips
cURL is one of my favourite command-line applications. It is similar to wget but with all the features a modern browser would have, e.g. cookies, ssh, etc. You can use it to do anything a browser would do and script routine tasks that you may need to do.
World O' Matty has many posts of interest to those using the command-line. 'Grabbing a protected webpage' was a nicely-written practical example of how to use cURL:
> Ever needed to grab a password protected page from the command line? This can be accomplished with curl's -u option:
$ curl -k -i https://www.daemons.net/secret -u me:somethingstrong |more
The username and password can be passed as an argument to the -u option. If you are paranoid about your password being visible on the command line, you can omit the password, and curl will prompt you for it:
$ curl -k -i https://www.daemons.net/secret -u me password:
In case you are curious, the-k option forces curl to dump the HTTP headers. I use both options to debug web server issues.
I have been using cURL a lot myself, and I plan to do a series on it in the future.
Introduction to ImageMagick
Another great tool that we have not yet touched on here is ImageMagick which is a great tool that allows you to work with images at the command-line.
Himal, the Essex boy that runs the Optimus blog, has a useful introduction, imagemagick and the strengths of the command line:
> Most people don’t think of the command as a place to do image manipulation. They are wrong.
Let's say I have a situation where I've got about 50 images at 1024x768 in png format that I need to quickly turn into small jpg thumbnails. I could use Photoshop Actions, or perhaps some other tool. But that would be reinventing the wheel, why not do it all with the UNIX command line and ImageMagick?
Himal goes on to give practical examples of how to resize images. He also points out that ImageMagick can be used in server-side web-scripting to create image galleries 'on the fly'. The first example that he gives is the a simple one image job:
> convert someimage.png -resize 25% someimage.jpg
The above will take a png image called someimage.png and turn it into a jpg, scaling it down 25% from it's previous size. Or this:
convert someimage.jpg -resize 640x480 -quality 40 someimage_1.jpg
That will create a scaled 640x480 image from someimage.jpg and save it as someimage_1.jpg, with jpg compression of 40%.
Network commands
Frank Teegelbeckers has a blog called Network+ and it has an interesting ` ">post about basic network commands: Ping, Traceroute, ifconfig/ipconfig, netstat, Telnet, and FTP.
Most of these utilities have been ported over to DOS and so Teegelbeckers gives both Unix/Linux and MS-DOG based explainations for them all. For example:
> Ping can tell you if the TCP/IP stack of another system on the network is functioning normally. The ping program generates a series of Echo Request messages using the Internet Control Message Protocol (ICMP) and transmits them to the computer whose name or IP address you specify on the command line. The basic syntax of the ping program is as follows:
ping target
Bash with pepperoni
I am a bit fan of providing custom interfaces to Internet applications and sites. This website explains how to order Pizza using Bash!
The application works with Dominos' website and I found that the command-line modifiers in the man page were quite amusing!
I have not tried this yet so do not know if it will work with Dominos' non-us sites; if you try it out then do let us know if it worked, and of course whether it tasted any good!
<p>Thanks for linking my ImageMagick article, nice to see that I'm reaching an
appreciative audience. <img src="/static/forum/img/smilies/big_smile.png"></p>
<p>wowwwwooooo
pizza with command line only ?</p>