Saturday, September 8, 2007

Wifi Card du jour

Wireless cards that are supposed to do it all, packet injection and the like. As high power as is legal ~300mW

Manufacturer:
http://www.ubnt.com
Local Retailer:
http://www.echotechwireless.com
Recommended Card:
http://www.ubnt.com/downloads/srcdatasheet.pdf

There are also mini-pci cards that one could install into their Dell latptop. Pricetags are > $100, so pony up , or watch E-Bay.

A testimonial of the Ubiquity card I've formatted it a little:

"I've tried 4 different wireless cards on Back|Track2 with varying levels of success.

[...]

UbiQuiti SRC Range Max

Without a doubt the best card available IMHO.

  • A massive 300mW power
  • comes with 2 x MMCX connectors and now shipping standard with a 5dB aerial
  • Can support OMNI and Directional at the same time
  • Uses the madwifi driver, supports packet injection
  • Support for ABG networks; Great sensitivity

Only draw back is the price, ... If you don't mind the money, then this is the only choice."

Here is a site listing cards and drivers that are known to work with BT2 (Backtrack 2). This list includes the following entry for the Ubiquity:

Ubiquiti SRC

  • Driver : Madwifi-ng
  • Chipset : Atheros AR5212 a/b/g
  • FCC ID: SWX-SRC
  • lspci : 03:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

In stock in the Salt Lake City area at EchoTech Wireless, 740 W. 1700 S., Unit #6, Salt Lake City, UT 84104. (801) 649-6400 (order@echotechwireless.com)

Monday, September 3, 2007

Images on the command line

I have used imagemagick as a command line tool in the past; you know, for batch image processing and tweaking in various scenarios. It has always come through for me and generally saved me a lot of time.

Since recently purchasing my Cannon SLR, I now have a lot of very large (3MB jpeg) pictures to manage. Imagemagick was an easy choice for things like shrinking to a size you can share with grandma via email, and cropping for the perfect fit on your desktop.

I would be interested if any of you have tricks to optimize / automate such tasks. Some of my imagemagick notes are as follows:

KNOWLEDGE IS POWER

Working with images, it is often helpful to verify what your commands have done. Use the identify command to tell you the image format, dimmensions, etc.: identify filename.jpg

  • Very useful in making robust scripts that handle different formats or sizes.

RESIZE AN IMAGE

To resize an image you can just use a simple: convert filename.jpg -resize 50% newfilename.jpg

  • This will resize the image to 50% of the original size and maintain aspect.

To resize to a particular width and maintain aspect use the following: convert filename.jpg -resize 800 newfilename.jpg

To resize to a particular height and maintain aspect use the following: convert filename.jpg -resize x600 newfilename.jpg

To resize in a fit in screen type mode, specify both width and height: convert filename.jpg -resize 800x600 newfilename.jpg

  • This maintains aspect and fits the image within that square

To force the image to a certain size, or "stretch" the image, you can use: convert filename.jpg -resize 800x600 ! newfilename.jpg

  • This will result in a perfect size image, but the image may be distorted.

CROP AN IMAGE

As with resize above, you can specify width or height to crop to.

width
convert filename.jpg -crop 50% newfilename.jpg
convert filename.jpg -crop 800 newfilename.jpg
height
convert filename.jpg -crop x50% newfilename.jpg
convert filename.jpg -crop x600 newfilename.jpg
both
convert filename.jpg -crop 50%x40% newfilename.jpg
convert filename.jpg -crop 800x600 newfilename.jpg

NOTE: the above commands will not discard anything, but rather give multiple output files of the original in pieces no larger than what is specified in your crop command. Think "tiles".

If you want ONLY a specific portion of the original, you can follow the dimensions with an offset x and y (+x+y). The x is measured from left to right by default and y is measured top to bottom. The upper left corner is +0+0. The picture saved is then measured from the +x+y reference point, again, the default is to the right and down.

convert filename.jpg -crop 800x600+0+0 newfilename.jpg

  • This gives the specified area measured to the right and down from the top left corner (+0+0). Everything else is discarded.

convert filename.jpg -crop 800x600+100+50 newfilename.jpg

  • This moves the upper left corner of the kept picture to the right 100 and down 50. Then measures to the right 800 and down 600 for the picture to be saved. Everything else is discarded.

COMBINE STEPS IN ORDER

You can actually combine steps in order on the commandline. Just give the name of the output file as the last argument like so: convert filename.jpg -resize x1024 -crop 1280x1024+0+0 filename-sm-crop.jpg

FINAL NOTE

There are a million more things that imagemagick can do... countless formats are supported and so are conversions between formats. If you have to process large numbers of images you should check it out.