The SAFE Act and Sensationalism

On December 5th, the House of Representatives approved the Securing Adolescents from Exploitation-Online (SAFE) Act by a vote of 409 to two.

In “House vote on illegal images sweeps in Wi-Fi, Web sites”, CNet News’s coverage of the SAFE Act that made the internet rounds today, Declan McCullough opens with quite a hook:

The U.S. House of Representatives on Wednesday overwhelmingly approved a bill saying that anyone offering an open Wi-Fi connection to the public must report illegal images including “obscene” cartoons and drawings– [sic] or face fines of up to $300,000.

McCullough’s opener, while successfully generating a comment thread fueled by anti-Federalists who didn’t bother to read the remainder of the article or the act itself, severely misrepresents the SAFE Act with an egregious omission.

The SAFE Act specifies punishment for “an electronic communication service provider or remote computing service provider that knowingly and willfully fails to make a report” of illegal traffic on its network. The operative words here are “knowingly” and “willfully,” and McCullough knowingly and willfully chose to ignore them.

It is not until the 356th word of his article, “learn,” that McCullough even alludes to the SAFE Act’s limitations—so I’ll clear things up for him.

The Securing Adolescents from Exploitation-Online Act absolutely does not apply to network traffic service providers are unaware of, nor does it require or even encourage service providers to become aware of illegal activity they would be required to report:

Nothing in this section shall be construed to require an electronic communication service provider or a remote computing service provider to:

  1. monitor any user, subscriber, or customer of that provider;
  2. monitor the content of any communication of any person described in paragraph (1); or
  3. affirmatively seek facts or circumstances described in subsection (a)(2).

The most amusing quality of the SAFE Act is that it’s not even anything new (a fact it cost me five minutes of poking around in the United States Code to discover). Before December 5th, anyone knowingly distributing child pornography was already a criminal under a number of laws, including Title 42’s Section 13032 and Title 18’s Section 2252A:

Any person who…knowingly mails, or transports or ships in interstate or foreign commerce by any means, including by computer, any child pornography…shall be punished as provided in subsection (b).

All in all, I’d say McCullough must be pretty satisfied with himself for creating a good amount of ruckus over an essentially redundant law.

Congress must intend the SAFE Act as a clarification on reporting illegal traffic, but service providers will see it as another disincentive to monitor their network traffic. By further regulating responsible network monitoring, the government is encouraging an “ignorance is bliss” philosophy when it comes to illegal activity over the internet—a service provider assumes risk proportional to its knowledge about user activity.

The lesson for America’s average e-citizen is this: it’s best not to leave your WiFi network open, but if you must, be sure not to check up on it.

How I Use Quicksilver III: Plugins

Quicksilver is the first program any self-respecting Mac user should install on their box. Instead of giving a general overview of its features (there are already plenty of those), I’m going to prove Quicksilver’s worth by going over exactly how I use it.

This is part three, on plugins.

If cool Quicksilver plugins are your thing, googling will reveal that most nerd blogs have already catered to you. I’m going to avoid my own “top plugin” list and instead write about exactly how I use a few choice plugins. The way I see it, the tricky part isn’t downloading and installing QS plugins, but knowing how to take advantage of them.

Social Bookmarks

After I became a fairly hardcore del.icio.us fan, I realized it was sort of silly to keep a few local bookmarks specifically so I could access them using Safari’s hotkeys (Safari will assign the leftmost bookmark in the bookmarks bar to command-1, the second to command-2, and so on).

Enter the Social Bookmarks plugin, which indexes my del.icio.us bookmarks — making them accessible as triggers or from the standard QS interface. The beauty of this plugin is that it takes all of the pain out of storing data in the cloud: my del.icio.us bookmarks are now just as easy to use as locally-stored bookmarks.

The Social Bookmarks plugin also indexes tags, so if I can’t remember a certain bookmark’s title I can still find it from within QS.

The plugin works with Ma.gnolia as well as del.icio.us. If you run into trouble, make sure your account password contains only alphanumeric characters.

Fumo Interface

Ankur Kothari’s Fumo Interface is my QS skin of choice. It’s just slick.

My version is a bit different than the default. Since I really like Primer’s wider style, I opened up Fumo’s .nib file in Interface Builder and stretched out its elements.1 The interface still works fine, but now it’s much better for searching items with long names and inputting text:

A wider Fumo

Transmit Module

I use Panic’s excellent FTP client Transmit, but the trick I’m going to cover here can easily be accomplished with the free client Cyberduck and its QS plugin.

The Transmit Module allows me to index FTP locations and upload files to them with the “Upload…” action. I created a folder in my webspace specifically for random files that I need while away from my computer, and the Transmit Module makes it ridiculously easy to access.

I can simply select a file in the Finder, press command-escape to bring QS forward with the selected file as an object, and choose “Upload…” to my dropbox. It doesn’t get any easier than that — I will never email myself a file again!

File Attribute Actions

The File Attribute Actions plugin offers seven actions for, surprise, changing file attributes. “Set Icon…” and “Set Comment…” are interesting, but where I get mileage out of this plugin is with “Make Invisible (hide)”.

Certain applications — P2P programs and Microsoft Office, I’m looking in your direction — like to put their data outside of ~/Application Support/ where it belongs. When I don’t want these support files cluttering up my hard drive but I’m afraid moving them will cause their messy application to run improperly, I can easily hide them using the make invisible action. I am positive there is a terminal command to do exactly this, but it can’t possibly be as fast or as unix noob-friendly.

Image Manipulation

The Image Manipulation plugin is absurdly useful. It enables QS to change images’ filetypes and dimensions, and quite intelligently so. You can specify a percent reduction or desired width in pixels.

With Quicksilver, any action has the potential to be a batch action, so batch resizes and conversions are a snap: select some images in Finder and press command-escape to apply an Image Manipulation action to each of them. I most recently used this method to size the thumbnails for my post on useful QS scripts.

I really hadn’t planned for how many sections this guide to QS would include, but I want to write at least one more about what sort of things I keep in my catalog. Keep posted for that next installment. Considering finals are right around the corner, it probably will be some time in coming.

  1. QSFumoInterface.nib’s location:
    ~/Library/Application Support/Quicksilver/PlugIns/QSFumoInterface.qsplugin/Contents/Resources/QSFumoInterface.nib

Stanford 20, Cal 13

Stanford wins its first Big Game since 2001, in exciting fashion. Defense ruled the day, as we traded three-and-outs with Cal for most of the fourth quarter while the clock slowly ran down.

The new stadium was an awesome venue, and of course when time finally did expire we stormed the field to congratulate our players. Though the team has been disappointing in general this year, they’ve pulled off some huge upset wins.

I’m optimistic that new coach Jim Harbaugh can return Stanford’s football program to greatness.

Cal sucks!1

  1. OK, not really. I have to hand it to Cal fans this year for being sportsmanlike and friendly. And, truth be told, their football team is much better than ours.

How I use Quicksilver II: Scripts

Quicksilver is the first program any self-respecting Mac user should install on their box. Instead of giving a general overview of its features (there are already plenty of those), I’m going to prove Quicksilver’s worth by going over exactly how I use it.

This is part two, on scripts.

As I mentioned in the first installment of this bit, I’m going to devote this entire post to explaining how I use scripts with QS. I want to go over some general tricks for employing Quicksilver to run Applescripts and commands as well as discuss some useful QS actions, which are just more complicated scripts that accept inputs from the QS interface.

Useful Trigger Options

Most of the scripts I use are simple Applescripts that I have hotkeyed using standard QS triggers with the “run” action. There are two more advanced trigger options that make these sorts of triggers flashier and easier to use. (Noob note: to view options for a trigger, select it and hit the “i” button in the lower right.)

If the “Show Window” option is on, QS will produce a flashy bezel when this trigger is activated. I’m usually not a fan of stupid eye-candy, but visual feedback is essential for many of these scripts because they perform functions that will run in the background.

I noticed early on that the Show Window bezel displays the icon of the script that its trigger executes. This means that you can identify a script by changing its icon to something relevant to its function. If you’re not sure how to do this, go over this Macinstruct article or use the IconGrabber QS plugin (at the risk of creating a hole in the space-time continuum). I will go over some examples of the Show Window bezel in action to illustrate its practicality.

The second trigger option worth noting is the “Delay:” field, which allows you to specify a time (in seconds) that you will need to hold the trigger’s hotkey before it will activate. This feature safeguards against accidental keypresses and gives the Display Window bezels more screen time.

iTunes Scripts

Quicksilver lets me search through my entire 41 GB music library without ever having to bring iTunes forward. I can play, pause, skip tracks, and shuffle artists, songs, and albums through QS’s interface. I use scripts to accomplish the remaining iTunes tasks I perform with any regularity, so that I can manage my music library almost exclusively through Quicksilver. A key element of this system is Growl, which displays track information in temporary on-screen notifications.

For Rating Tracks

I use command-option-1 through command-option-5 to set the currently playing song’s rating to a corresponding number of stars. The applescripts to perform this task are included in the iTunes Module plugin:

~/Library/Application Support/Quicksilver/Plugins/iTunes Module.qsplugin/Contents/Resources/Scripts/

I mention the scripts’ location because this is one instance where the Show Display bezel is absolutely necessary. I navigated to the above directory and slapped each of my five rating scripts with an icon that, when it appears in the Show Display bezel, will confirm I’ve just rated the currently playing song a certain number of stars.

For Displaying Track Information

Because Growl’s song information notification only lingers on my screen for a few seconds and I shuffle often, I’m sometimes left wondering exactly what I am listening to. Luckily, Growl is fully Applescriptable, so I can use a QS trigger to force it to display the currently playing track’s information again. Specifically, I use command-option-? to execute this script (credit to RavenDuck at the Blacktree Forum).

For Adjusting Volume

Using my function keys for application launching is convenient, but it left me wanting for an easy way to change the system volume. Since OS X doesn’t allow hardware functions to be mapped anywhere outside of F1-F12, I turned to these two scripts. I have them hotkeyed to command-. and command-/, with Display Window on. You’ll notice that the scripts in that archive already have icons to reflect their functions.

For Tagging Tracks

The last bit of scriptery I use to control music playback is the TuneTag action suite by Chris Brown. The Tag and TagSelected actions allow me to tag my iTunes tracks, and the PlayTag action plays back tracks with a specified tag. All of these actions are accessible entirely from the Quicksilver interface, though the TagSelected action is designed for batch tagging while songs are selected in iTunes.

TuneTag’s tags are just strings in the Comment field preceded by an asterisk, but they offer unlimited control over the organization of my music library. I can do cool things like tag loud, aggressive music with “angry” so I can play it immediately after I’ve been in my Windows partition for a while.

Shell Scripts

I use shell scripts to take care of certain hardware functions. Though Quicksilver can handle shell scripts directly using the Terminal Module plugin, I prefer to pipe the scripts through Applescript with the do shell script command, because then I can assign them icons for use in Display Window bezels.

For Booting into Windows

I explained this script in a more detailed Macinstruct article, which is a generally good reference if you are interested in more specific information about how to set up scripts for activation via Quicksilver. In short, I use control-B to trigger this script after a two second delay. The script first sets my startup volume to my Windows partition (named “XP” — you must replace this string with your partition’s name if you want the script to work properly) and then restarts my computer.

It’s a true luxury not to have to wait around to hold down the option key during boot to specify my Windows partition, and when I power down Windows after using this script I will boot back into OS X (i.e. the startup volume change is not permanent).

For Forcing a Time Machine Backup

Time Machine is an optimal backup solution because it requires no user input, but instead runs automatically in the background on a regular schedule. For someone who leaves their Time Machine-stamped external drive plugged in all the time, the regular, scheduled backups work like a charm.

However, I rarely power on my external, and when I do I’d like to be able to tell Time Machine to interrupt its usual schedule and back up my data immediately. Logan Rockmore uncovered a shell script to do exactly this, and it was short work for me to stick it in an Applescript, apply Time Machine’s icon, and create a QS trigger: when I hold command-ctrl-T for two seconds, Time Machine will spring to life.

For Toggling AirPort Power

I turn my AirPort on and off frequently, depending on my power source and access to ethernet cable. My general aversion to using the mouse for common actions sent me looking for a way to toggle my wireless card’s power with a hotkey. What I turned up was this script, which uses GUI scripting to identify the AirPort menubar item and select its topmost option.

I have no idea where I found the script originally and Google doesn’t have any answers, so I can’t credit it properly. Works like a charm, though.

For Stripping Text Formatting

Pasting from a website into a rich text document used to drive me nuts. The copied text would drag its hideous font and wacky formatting into whatever I was working on. I ran across a command that strips whatever text is on the clipboard down to plain text by re-copying it:

pbpaste | pbcopy

I skipped the AppleScript and Display Window bezel for this one, opting simply to create a “Run Command in Shell” trigger with pbpaste | pbcopy as the object. I mapped the trigger to control-u, and have already used it to save plenty of time and frustration.

For Swapping Preferences

There exists a fairly popular piece of shareware called RooSwitch that allows users to shuffle preference files around so they can create multiple user “profiles” for any single application. Though I’m certain RooSwitch is best at what it does, you can achieve its basic functionality by using scripts and Quicksilver, and you can do it for free.

The reason I know this is because USBOverdrive’s application-specific settings don’t work properly in Leopard. I need USBOverdrive to map my mouse buttons to crouch, use medkit, re-arm, and walk so I can properly dominate in the excellent Quake3-based FPS Tremulous. These functions aren’t so useful while I’m cruising around in OS X, so I wrote an Applescript to swap out my global USBOverdrive settings for my Tremulous-specific settings:

do shell script "mv ~/Library/Preferences/com.usboverdrive.mouse.prefs ~/Library/Preferences/com.usboverdrive.1/"
do shell script "mv ~/Library/Preferences/com.usboverdrive.2/com.usboverdrive.mouse.prefs ~/Library/Preferences/"
do shell script "mv ~/Library/Preferences/com.usboverdrive.1/com.usboverdrive.mouse.prefs ~/Library/Preferences/com.usboverdrive.2/"
tell application "USB Overdrive X" to activate
tell application "USB Overdrive X" to quit

The script is probably somewhat clumsy because I’m a unix noob, but it gets the job done and you can easily adapt it to any other application’s preferences. It will switch the .plist file in my ~/Library/Preferences folder with a second .plist file in a dummy folder, effectively toggling between global settings and Tremulous settings. I hotkeyed the script to command-option-F9, because command-1-3-3-7 isn’t possible.

Web Scripts

These last few scripts make browsing and interacting with web-based services convenient. I plan to get into a little more detail on how Quicksilver can help you access remote data when I go over plugins in the next, third part of this series.

For Tweeting

I love Twitter. Now that Twitterriffic is adware, Coda Hale’s Tweet action for Quicksilver is undoubtedly the slickest way to post updates to Twitter. It will accept text input directly from the QS interface and post it to my Twitter feed.

The Tweet action I use is a modification by Joe Carroll that provides length-checking before posting (Twitter will reject Tweets over 140 characters) and Growl notification upon posting. These improvements make the Tweet action’s featureset par with that of Twitter’s web interface, meaning I don’t have to sacrifice functionality for convenience.

Update: Commenter Alex noticed that the script I’ve mirrored above doesn’t work if the tweet’s first character is “@”. His improved version fixes the error, and I’m using it now. Thanks Alex!

For Shortening URLs

Complex websites can spit out obnoxiously long URLs that are a chore to email or enter in text fields. URL-shortening services like the excellent, bare-bones Metamark use redirection to change obnoxious, long URLs to cute, concise ones like http://xrl.us/bbz66.

Macworld honcho Jason Snell whipped together a handy Applescript that retrieves the URL of Safari’s frontmost page, sends it to Metamark for shortening, and places the new, cute, URL on the clipboard. I have his script hotkeyed to control-I, and use it most often when I am posting a link to Twitter (with the Tweet action, of course!).

For Navigating Page-Based Sites

Daniel Jalkut of Red Sweater Software has written quite a few useful Applescripts. Amongst them is Safari Next Page, which examines the URL of Safari’s frontmost page to determine if it is one in a series of pages (usually URLs of paged articles and content will have some indicator like page=2). If Safari Next Page recognizes the URL’s format, it will load the next page in the series.

This script is quite useful for navigating websites that enjoy compromising their usability by splitting articles into multiple pages, and I have it mapped to command-right arrow while Safari is the frontmost application.

How to Download YouTube With Safari

I always find it pretty hilarious when whole leagues of software pop up to perform functions most people could accomplish with the programs they already use. Software like this feeds on its own stupidity, because its very existence perpetuates the idea that it has unique features.

A perfect example is the countless applications dedicated to downloading videos from YouTube (and other such flash-based video sites). Some of them even cost money.

It turns out you can use Safari to pull .flv video files from YouTube, and it’s even easy to do. Open any YouTube page in Safari and hit command-option-A (command-option-A) to open Safari’s activity window.

The activity window is a generally useful tool that basically nobody knows about. It is simply a list of all the individual files that make up Safari’s open webpages. If you’re curious about a site’s structure, want to grab a particular image, or just want to know why something is loading slowly, check the activity window.

The activity window will look something like this when a YouTube page is open:

Safari's activity window

One of these files is not like the others, and that’s the relatively massive (14.7 MB in the above example case) “get_video” .flv video file that you want to download. Select its line in the activity window and copy it (command-C). This puts the .flv’s URL on your clipboard.

Now comes the haxxery. Bring forward Safari’s downloads window (command-option-L) and paste the .flv’s URL (command-V). I’m listing all the keystrokes because they make this little trick very fast.

Wait for your download to complete, and bam! You’ve got the video. However, OS X won’t recognize it as a .flv file quite yet, and that’s because it’s missing a proper file extension. Rename the mystery “get_video” file with a “.flv” at the end.

Now that OS X recognizes the video file, you can play it. I recommend using VLC or Quicktime with Perian.

Update: Rolf points out that it’s possible to save all of the copying and pasting business and cut to the chase by simply double-clicking an item in the activity window while holding the option (alt) key. This action will automatically download the item.