Misc


How to share a LaserWriter 300 with OS X

Posted on: 28 June 2008

So I have an old Apple Personal LaserWriter 300 from about 14 years ago. It is in surprisingly good condition, works like a champ, and I have about 5 extra toner cartridges for it. Awesome.

So I went to Google to see what I needed to do to make it accessible as a network printer. Here's the snag: it only supports QuickDraw. Which meant that it would only work on an OS 9 computer, and could only be shared to OS 9 computers. Damn.

So I thought about it for a bit, and came up with a way to make it work. (It's kinda clunky, but my method works.)

1. Get an old OS 9 machine and set up your LaserWriter normally. (In my case, I used my old PowerMac 7600.)

2. Give it a static IP address and turn on Apple File Sharing over TCP/IP.

3. Create two folders on the desktop. One called "Print Drop Box" and one called "Completed". Open sharing and give the drop box guest access.

4. Download and install James Davis' AutoType / AutoClick plugins for AppleScript

5. Make the following AppleScript and name it "Print". (Note that the AutoClick command I have listed here assumes that you are running with a resolution of 1024x768 on the server computer. If your resolution is different, you may have to play around with the click coordinates.)

on adding folder items to this_folder after receiving added_items
	repeat with this_item in added_items
		tell application "Finder"
			set name of this_item to (time of (current date) as string) 
& "-" & name of this_item
			open this_item
			AutoType "p" holding "command"
			AutoClick {730, 50}
			AutoType "w" holding "command"
			move this_item to folder "Completed"
			beep
		end tell
	end repeat
end adding folder items to

6. Add the "Print" script as a Folder Action on the "Print Drop Box" folder.

7. Download Adobe Acrobat Reader 4.0 for OS 9 and install it. (Don't worry about using a copy from 1999. It's worked fine with the documents I've sent to it. Plus, it's only 4.9MB and loads up in two seconds, which is better than I can say for Adobe's current version of Reader.)

8. Mount the drop box on your OS X machine via "Go > Connect to Server" by typing in "afp://192.168.0.11" (or whatever IP you gave it) and selecting "Guest"

9. When you go to print on your OS X machine, select "Save to PDF" and throw it into the "Print Drop Box". The file will print and be moved to the "Completed" folder when it's done!

And there you have it. You now have a server that will accept PDF files and send them off to your QuickDraw-only printer. Great way to make use of an old, previously unsharable printer. I've put the machine in my closet, made it headless and installed OS9VNC for remote administration. Works great.

How to manually add missing podcast episodes so they show up correctly in iTunes

Posted on: 15 June 2007

UPDATE: A commenter and I worked out a much easier method here. The original "hosts file method" is much more cumbersome, but left here for historical purposes.

This one has been bugging me for a long time. I'd googled for the solution, and found that others have had the same issue, but no one had found out how to fix it. How do you manually add episodes to a podcast so that they show up in the "Podcasts" section of iTunes? You can add individual MP3 and AAC files by choosing [Add to Library...], but they show up as music and don't list with the other episodes of that podcast, which is really annoying.

The problem I had was that I was missing a number of episodes from one of my favorite podcasts, Security Now.



See how episodes 66, 67, 68 and 69 are missing?

I can download them from GRC or TWiT, but they won't go in this list if I add them to iTunes. They'll just show up as music. And that bugs me.

Well, after messing with it for a while, I figured it out....

1. Find the URL of the XML file that the podcast uses

In this case, it was http://leoville.tv/podcasts/sn.xml

2. Setup a webserver

In OS X, you just "Enable Personal Web Sharing" in System Preferences.

The directory where you put the files is in /Macintosh HD/Library/WebServer/Documents/

3. Put the MP3s of the podcast on the webserver

In my case, the names were SN-066.mp3 through SN-069.mp3

4. Craft a fake XML file for iTunes to read

What you do here is take a look at the actual XML file, then make one that instead of containing entries for say, the last 20 episodes, contains entries for the old episodes that you want to add. Here's an example of what you would insert for one episode:

    
      <title>Security Now 66: Vista Security!</title>
      <link>http://192.168.0.10/podcasts/SN-0066.mp3</link>
      <description></description>
      <author>leo@leoville.com (Leo Laporte)</author>
      <pubDate>16 Nov 2006</pubDate>
      <category>Technology</category>
      <category>Security</category>
      <comments>http://twit.tv/sn66</comments>
      <enclosure url="http://192.168.0.10/podcasts/SN-066.mp3" type="audio/mpeg"/>
      <itunes:author>Steve Gibson with Leo Laporte</itunes:author>
      <itunes:subtitle>Leo and I describe the new security features Microsoft
has designed and built into their new version of Windows, Vista.</itunes:subtitle>
      <itunes:explicit>no</itunes:explicit>
      <itunes:duration>37:45</itunes:duration>
    </item>

So you go through and add XML entries for each MP3 you have to add. Notice how the URL for the MP3 is changed to point to the MP3 hosted on our webserver here.

5. Change your hosts file

Change the hosts file (in OS X, it's at /private/etc/hosts) on your machine, so that iTunes will go to your webserver instead of the actual one hosting the podcast.

(Be sure to change this back when we're done so that it updates properly)

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
192.168.0.10    leoville.tv 

That's what mine looked like. 192.168.0.10 is my PowerMac G4. You could do this on your own machine if you wanted to by using 127.0.0.1 instead.

6. Now, update the podcast in iTunes

Instead of going to the actual website to fetch the XML file for the podcast, it's now going to your computer to get it.

And now you have the option to add those long lost episodes to your list:



It is incredibly annoying that there isn't an easy way to do this in iTunes. But in the meantime, I guess this works.

The weakness of WEP

Posted on: 21 April 2006

In the past, on my home network, I had been using WEP, or Wired Equivalent Privacy for encryption of wireless traffic. When I read about the security flaws in WEP, I immediately switched to WPA encryption. But today, I decided to set it back to WEP and see just how flawed it is...

I downloaded an OS X app called KisMAC (derived from the Linux tool Kismet, used for the same purpose.) What it does is it takes your wireless card, and puts it in listening-only mode, recording every packet that goes by in the airwaves, without sending anything at all.

So I installed KisMac on my iBook, and put it into listening mode. Within ten minutes, it picked up about 29393 packets, or about 23MB of data – not enough to deterimine a 128-bit WEP key. So I did a few things to generate some additional traffic. First, I sent an authentication flood. This simulates a lot of computers trying to access the router, by randomly generating MAC addresses, in an attempt to get the router to respond with some packets. Another method is to reinject packets. This resends packets that were already sent by another machine to get the router to respond even more. Within another ten minutes, I had 130123 packets, or about 107MB of data. 

Now, I could continue at this rate, injecting packets and spoofing clients, and within an hour, I could easily have enough to rebuild the WEP key. But I decided to speed up the process a bit. I went over to my PC, and sent a 700MB video over to my file server via wireless. Within minutes, I had more than enough packets captured. About 457434 of them had unique IVs (initialization vectors), and I was ready to extract the key.

I executed a weak scheduling attack against the data I had captured, and in seconds, to my surprise, I had the WEP key!

 

Seeing the very key that I thought was keeping me safe in my dialog box was quite a surprise.

A neighbor, or even someone sitting in a car a few hundred from my house running a similar program could, in less than an hour, discover what my WEP key was. Pretty scary.