Blogwatch: cURL, ImageMagick, Network tools and Pizza

9 September 2005

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!

1 himal says...

Thanks for linking my ImageMagick article, nice to see that I'm reaching an appreciative audience. :D

Posted at 2:14 a.m. on September 15, 2005


2 x says...

wowwwwooooo pizza with command line only ?

Posted at 12:33 p.m. on November 3, 2007


What do you have to say?

Show Editing Help

About

Hello, my name is Zeth, I'll be your host here.

Command Line Warriors is about taking control of your own technology, it looks at our experiences of computing; especially using GNU/Linux, the Python programming language, the command-line and issues such as techno-ethics, best practices and whatever is cool now. If you take control of your technology then you are a Warrior too!

This site is your site too which means that you can contribute and get involved. You can leave comments using the facility provided. For me, the comments and discussions are by far the best part of the site. So please do have your say!

Latest Discussions

Cupcake

July 31, 2010
Good post! You helped me a lot with my school project! CountryField(blank = True) < (K)
Countries in Django

LeshaShampoo

July 30, 2010
it was very interesting to read commandline.org.uk I want to quote your post in my blog. It can? And you et an account on Twitter?
Email Syntax Check in Python

vemma2018

July 30, 2010
I find myself coming to your blog more and more often to the point where my visits are almost daily now!
On Comment Spam

layecenda

July 30, 2010
Hello. And Bye.test :) http://idfjhvihdfiphvlajbvhalibv.com
PuTTY Series: Adding PuTTY to your system path

scuba

July 30, 2010
I’ve been visiting your blog for a while now and I always find a gem in your new posts. Thanks for sharing.
On Comment Spam

Businesking

July 30, 2010
Great site and articles for hack for win, I said Amazing post
How not to program WSGI

Tehnoking

July 30, 2010
This is Great post to learn about the hack Thumbs-up for you :D
How not to program WSGI

Syabiltech

July 30, 2010
I think this articles for master...because very hard to learning, As blogger beginners like me.
How not to program WSGI

coffeeatea

July 30, 2010
Are you looking for coffee gifts? We can tell you more about the coffee gifts including coffee machines and coffee pods.
Introducing Soturi - yet another Django blog application

noni juice

July 30, 2010
I just sent this post to a bunch of my friends as I agree with most of what you’re saying here and the way you’ve presented it is awesome.
On Comment Spam

Dion Moult

July 29, 2010
What I do know is that ever since I tried out Opera and put their tab bar on the left as a column, I've loved that layout. Back on Firefox ...
We need a thoughout integration of the desktop and the web - not Tab Candy superfast jellyfish

ZonaEntertainment

July 29, 2010
Wow useful articles, I'm read to learn about this and now I bookmark this to my Facebook, thanks for share!
How not to program WSGI

Giacomo

July 29, 2010
Honestly, I think both Mozilla and you are wrong :) This sort of concept adds overhead. A user would have to manage all this crap, constantly dragging and dropping, creating ...
We need a thoughout integration of the desktop and the web - not Tab Candy superfast jellyfish

Matija "hook" Šuklje

July 29, 2010
As a minimalist, you'll probybly moan if I mention KDE, but I'll do so anyway ;) The future I want (and actually see slowly fold out before me) is to ...
We need a thoughout integration of the desktop and the web - not Tab Candy superfast jellyfish

tahitian noni

July 28, 2010
Thank You For This Blog, was added to my bookmarks.
On Comment Spam

Rick

July 28, 2010
I already have piles. It's called A New Window.
We need a thoughout integration of the desktop and the web - not Tab Candy superfast jellyfish

Tech News

July 25, 2010
Thanks for this short tutorial...was auto-FTPing my files from my appserver to webserver for my tech news website. Everything was OK until someone hacked it. Hosting provider is now recommending ...
SFTP in Python: Really Simple SSH

naypalm

July 24, 2010
During the past 3-4 years, I and many others have enjoyed unlimited 2G/3G internet. But ever since the massive cult-like following of i Phone users in the US, most cellular ...
Calling time on mobile internet nonsense?

Steve

July 15, 2010
Very occasionally, you will run into a Java program that uses a lot of memory just to hold all the classes used. It turns out that the JVM uses a ...
Three classic command line tips

no

July 14, 2010
1. number one 2. number two 4. number four 3. number three 6. number six # first # second ## second-ay ## second-bee ### second-bee-one ### second-bee-two
An Introduction to ReStructuredText