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

http://kratosellas.blogspot.com

September 8, 2010
http://kratosellas.blogspot.com ?????????? ?????????
Bremen Travel Snaps

kristengreen

September 8, 2010
Hello,http://www.jumancuso.info - May i sex dating with you?
OOXML Vote Coverage

play solitaire online

September 8, 2010
Thanks for sharing this link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my post if you do! I would ...
Better Python Console 0.2.5

tixartich

September 7, 2010
http://thesecretstofarmville.com - Farmville Cheats
Burning an iso to CD on Windows

kristengreen

September 7, 2010
Hello,http://www.jumancuso.info - May i sex dating with you?
5 Homebrew Python Games

Johnathon Alston

September 7, 2010
hello great forum lots of helpful people just what i need can anybody tell me how they have built there list for people interested in marketing hopefully this is just ...
OOXML Vote Coverage

thrhtrurth

September 7, 2010
epvmqyauvloxitvmszkrv. http://www.acnetreatment2k.com/ - acne treatment npympx
Introducing Soturi - yet another Django blog application

nexium uk

September 7, 2010
Nexium Latest News: Nexium <a target="_blank" class="ext" href=http://mysoccerspace.ning.com/profiles/blogs/generic-nexium-generic-nexium>cheap generic nexium</a> Nexium <a target="_blank" class="ext" href=http://www.wfmtintroductions.com/profiles/blogs/buy-generic-nexium-buy-generic>buy nexium 40mg</a> Nexium <a target="_blank" class="ext" href=http://www.interdojo.com/profiles/blogs/buy-cheap-nexium-buy-cheap>nexium buy cancun</a> Nexium <a target="_blank" class="ext" href=http://www.translatorsgroup.com/profiles/blogs/nexium-generic-buy-nexium>nexium generic ...
SFTP in Python: Paramiko

payclickk

September 7, 2010
?????? ???????? ????????? ??? ???????????: http://pay-click.ru/?ref=3871 - http://pay-click.ru/?ref=3871
SFTP in Python: Really Simple SSH

Erotikalia

September 6, 2010
Ihr habt eine schoene Webseite hier, und vielciht schaut Ihr euch auchmal meine an, ok Sex im Internet ist nicht jedermans Sache, aber eben meine erste Homepage. Danke und macht ...
Introducing Soturi - yet another Django blog application

SonIntuivetut

September 5, 2010
I enjoyed reading your blog. Keep it that way.
The Pirate Bay Trial Begins

hgfllkj

September 4, 2010
?????????? ???? ?????????? ??? ???????????, ???? ?????????? ?????????, ?????????? ???? ??????????, ???? ???? ?????????, ?e?? ??a??????a ?e? ?e?????a???, ???? ?????????? ??? ???????????, ???? ?????????? ??? ???. ???? 24lux.ru
Include ODF support in the Linux Standard Base?

SemeRuppy

September 3, 2010
JACKELINE HERMINE you go, there's an KAREY
PyCon UK 2008 this September

neffeengard

September 3, 2010
LYN NOVELLA learned how to forgive those people and let it go, SHANON
PyCon UK 2008 this September

Essex Web Design

September 3, 2010
A lot of contract providers give you free internet usage now, but if you have Pay As You Go, then you are going to be paying heavy prices.
Calling time on mobile internet nonsense?

Krasochka

September 2, 2010
Hack again?!
Adding more terminals to your function keys

GenryFlorist

September 2, 2010
<b>Cheap flowers delivery around the world!</b> Celebrate summer with our gorgeous flowers. They?re the perfect gift for any summer occasion. From birthdays to anniversaries, we offer beautiful flowers, lush plants, ...
Burning an iso to CD on Windows

auto-financing.co.cc

September 2, 2010
auto-financing
ReStructuredText tables and doctests

rubaxa

September 1, 2010
FTP = NOT RANDOM software Dominated hands postflop suckout often on all-ins. EX. AK vs. A9 or KQ vs. K6. Both players hit top pair. Bad player goes all in ...
Burning an iso to CD on Windows

empodayaddelm

September 1, 2010
Sorry admin - my post is test
This Week: Heroes and Monsters