Posts Tagged ‘command’

Howto: Making Your Mac Talk Via Command Line

Thursday, May 15th, 2008

Did you know you can make your Mac speak out loud whatever you want via command line? I didn’t.

Here’s how:

  1. Open a terminal (Applications>Utilities>Terminal).
  2. Type in say eat my balls (or whatever you want, just put “say” in front of it).
  3. Sit back, listen, giggle and waste your entire day making your computer say really dirty things.
  4. Know you are really, really cool.

You can also have your mac read entire text files by using this command:
say -f PATH/TO/FILE.TXT

Sweet! You may find that for some words, in order for your Mac to pronounce them correctly, you’ll need to spell them phonetically, but whatever…

Type the command man say for the manual on how to use this command and the various options and things you can do with it.

Command Line Ejections

Tuesday, March 11th, 2008

Nice. I just figured out how to eject my CD/DVD drive on my Linux desktop (Xubuntu) via command line!

First, display your fstab file to see what the drive is named: ’sudo cat /etc/fstab’

Then look for your disc drive. Mine was called ‘cdrom0′.

Once you’ve found it, type ‘eject [name of drive]‘ and watch the magic.

I mapped that command to my keyboard. Gnome, Xfce and KDE all have a an interface to help you map keyboard shortcuts in their system preferences, or you can just edit the config files manually with a little googling. I mapped ‘ALT-Shift-F12′ to run ‘eject cdrom0′. Easy.

EXIF, jhead and the joys of hidden thumbnails

Friday, June 30th, 2006

I was doing some reading about EXIF data and came across a quirk that I’ve been having some fun fooling around with.

Most digital cameras embed EXIF data into every image, listing such things as the type of camera, date and time the photo was taken and other details as well as a thumbnail of the image so that the file previews faster.

Most of the time, this information is lost or at least updated when an image is edited. However, sometimes the original EXIF data will carry over. Depending on the editing tool or circumstance, an image file that’s been cropped, re-sized, oriented or otherwise edited will sometimes still carry an embedded thumbnail of it’s original state, fresh off the digital camera.

There’s a few tools out there for pulling he thumbnails out of an image’s EXIF data. I decided to use jhead with my Kubuntu laptop (there are OSX and Windows clients as well, but I’ve never used them). After installing, fire up a terminal and type:

jhead -st 'thumbnail-output-filename' 'desired-image.jpg'

If there is a thumbnail embedded in the image it will be extracted to whatever filename you specify. You can then view it with whichever program you choose.

Now understand that there may not be a thumbnail and nine out of ten photos that do have them will be exact miniatures of their parent files. Still, one out of those ten photos can yield some interesting shit. Just take a minute to think of the various and plentiful reasons why a person or organization may need to edit, obscure or otherwise change an image’s original state and you might get the point of this.

To give an example, I took this image from Wikipedia, (mainly because of it’s not under some restrictive copyright and work safe) and after saving it locally, used jhead to extrat the EXIF thumbnail giving me the image below.

[image: An example of an EXIF thumbnail.]If you compare the thumbnail below to the image linked in the paragraph above, you can clearly see that it has been rotated ninety degrees right with parts of two additional statues and a window being completely cropped out of the image.

Here’s a link to a page where someone uses a script to search the internet, checking for and displaying images with EXIF thumbnails whose dimensions are not perfectly scaled (like the file has been cropped or otherwise changed since it’s creation) and displays them for your amazement/boredom.

So many wacky possibilities. Go spend some time on Flickr, Friendster, or MySpace. Try it on documents that have had sections digitally blacked out for confidential reasons. Go forth and be snoopy.