jump to navigation

Command Line Capture of Web Pages to PDF, PNG, SVG, etc January 5, 2010

Posted by Robert Harder in : Utility , add a comment

If you’re on a Mac, you probably know that in any application that prints, you can “print” to a PDF file — handy to be sure — but from the command line, it’s not so easy. Enter CutyCapt, a cross-platform tool that lets you capture web pages in a variety of formats including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP using WebKit as the rendering engine.
(more…)

Jam Resistant Communication Without a Shared Key December 7, 2009

Posted by Robert Harder in : Utility , 2comments

BBC Decoding TreeSome US Air Force Academy (USAFA) and National Security Agency (NSA) smart guys (Baird, Bahn, and Collins – BBC) have come up with a way to achieve the kind of jam resistance that shared keys provide (like spread spectrum) but without the need for a shared key. For the crypto guys out there, this would be analogous to what the Diffie-Hellman key exchange brought to the world of symmetric cryptography. In fact one would probably use such a key exchange over BBC and then revert to traditional jam-resistant communication techniques, just as we do with asymmetric/symmetric crypto. Their ideas extend beyond jam resistance, but that’s what we’ll look at here.

(more…)

Atlas Shrugged Essay Contest November 2, 2009

Posted by Robert Harder in : Uncategorized , add a comment

Atlas Shrugged logoSince I’m a student for a little while again, I posted an essay for this year’s Atlas Shrugged essay contest. There’s nothing like writing an essay to really make you feel like a student! [Update: I didn't win. =( ]

(more…)

Create Animated GIFs with Mac OS X Preview.app October 22, 2009

Posted by Robert Harder in : Utility , add a comment

If you open an animated GIF in Mac OS X’s Preview application, the default application for viewing images and PDFs, you may know that you can see individual frames of the animation, but did you know you can also create animated GIFs with Preview? Here’s how.

All Your Base Are Belong To Us
(more…)

Stream iTunes over SSH September 28, 2009

Posted by Robert Harder in : Utility , 10comments

After (mostly unsuccessful) Googling for how to stream iTunes over SSH, I finally tracked down the difficult bits myself and put together a four-line script (five if you count “shebang”):

#!/bin/sh
dns-sd -P "Home iTunes" _daap._tcp local 3689 localhost 127.0.0.1 "Arbitrary text record" &
PID=$!
ssh -C -N -L 3689:localhost:3689 myusername@blahblahblah.dyndns.org
kill $PID

itunes-sharing

(more…)

ImageSnap: Capturing a Video Image with QTKit on Snow Leopard September 14, 2009

Posted by Robert Harder in : Utility , 8comments

ImageSnap is a Public Domain command-line tool that lets you capture still images from an iSight or other video source. You might remember Axel Bauer’s original isightcapture tool (that is no longer supported but still works on most systems). I wanted a similar tool with source available so I could make feature changes or at least recompile with Apple’s ever-changing architectures.

At some point Apple introduced QTKit, a new and oh-so-welcome abstraction bringing QuickTime programming into the 21st century. Nothing against die-hard ANSI C programming, but it fits awkwardly into what are otherwise clean Objective-C Cocoa programs.

Rather than provide a detailed tutorial about using QTKit (sorry if you wanted one), I’ll just point you to the ImageSnap code so you can take a look at a few useful things like starting a QTCaptureSession, capturing output with QTCaptureDecompressedVideoOutput, and saving an NSImage to disk.

Deleting Flash Cookies Daily Using Snow Leopard’s Semi-Broken Periodic Scripts September 8, 2009

Posted by Robert Harder in : Utility , add a comment

I was trying to find a convenient way to delete Flash cookies every day and wanted to run two simple lines automatically:

rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/\#SharedObjects
rm -rf /Users/rob/Library/Preferences/Macromedia/Flash\ Player/macromedia.com/support/flashplayer/sys

There are many ways to do this of course: launchd, cron, at, etc, but I thought it would be most elegant to tie into the Mac’s periodic maintenance scripts, and what a time I had debugging why I couldn’t get it to work.

(more…)

Two Factor Authentication in Snow Leopard SSH with Perfect Paper Passwords September 2, 2009

Posted by Robert Harder in : Utility , 2comments

If you’re nobody special like me, you probably “only” get a few thousand failed SSH logins to your computer each day. If you run a high profile system, it’s probably worse. Of course you have a good password for your account (right?), but should someone actually get your password, like with a keystroke logger on the remote computer you’re using to log in, what protection do you have then?

Two factor authentication can increase your security by requiring more than just your password (one factor) to log in. I like using Perfect Paper Passwords from Gibson Research Corporation (GRC.com). With this system after entering my username and password (even a wrong password) in an SSH session, I am then prompted for a four-digit passcode that I’ve previously printed out and stashed in my wallet. Each code is only used one time, and protects me even if someone manages to get my password. In the case where attackers are guessing my password, they cannot tell if the password or passcode was guessed incorrectly.

Sample PPP passcard (courtesy grc.com)

Sample PPP passcard (courtesy grc.com)

There’s only a little bit of trickery involved to compile it for Mac OS X 10.6 Snow Leopard, and if you had it working before in Leopard, you’ll need to recompile the PAM module (I know, it’s like “ATM machine”) for 64-bit mode.

(more…)

Java 6 and librxtxSerial.jnilib on Intel Mac OS X August 18, 2009

Posted by Robert Harder in : Utility , 8comments

[UPDATE: This library works with Mac OS X 10.6 Snow Leopard.]


In order to access a serial port in Java, you need the RXTX libraries compiled for your specific hardware. Java uses the Java Native Interface (JNI) to bridge between your platform-independent application code and the hardware-specific serial port drivers.

If you’ve tried this on an Intel Mac (perhaps to play with a Sun SPOT), you may be disappointed, since software keeps shipping from people that is either PowerPC only or isn’t compiled for 64-bit Intel. You’ve probably seen the UnsatisfiedLinkError message. Here you’ll find a librxtxSerial.jnilib file with support for both 32- and 64-bit PPC and Intel architectures, fitting the bill perfectly for both Java 5 and Java 6 on the Mac.

$ file librxtxSerial.jnilib
librxtxSerial.jnilib: Mach-O universal binary with 4 architectures
librxtxSerial.jnilib (for architecture x86_64):	Mach-O 64-bit bundle x86_64
librxtxSerial.jnilib (for architecture i386):	Mach-O bundle i386
librxtxSerial.jnilib (for architecture ppc7400): Mach-O bundle ppc
librxtxSerial.jnilib (for architecture ppc64):	Mach-O 64-bit bundle ppc64

(more…)

Installation Notes for Openfire July 28, 2009

Posted by Robert Harder in : Uncategorized , add a comment

Following Google’s release of a reference implementation of the Wave protocol in Java form, I thought I’d give it a try, but installing Openfire, the XMPP-based backend, turned out to be the biggest challenge. Using the default installation, I could not log in to the admin console page. Many other people seem to have this same problem, and I could not find a solution online. I found the problem or rather, a workaround.

(more…)