The Blog of Maxim Porges
  • Speak and Spell Samples

    I was looking for a complete set of Speak and Spell samples to use for making amusing ringtones and such, and I had a surprisingly hard time finding them.

    There are a few sample sets out there, of course. Most you have to pay for (lame) and are in proprietary software sampler formats (just plain stupid). Others you’ll find posted on musician’s forums with links to files that were once on RapidShare or MegaDownload (or any of those other bootleg CDNs), all of which have been purged from existence.

    Well, I finally found a nice clean set of samples with the complete alphabet, a huge collection of words, and the startup tones. They are WAVs. The audio quality is superb. And I’m hosting them right here on my site for free, unadulterated download.

    You’re welcome.

    2011.10.08 - / 12 responses / add a response

  • Eulogizing the Insanely Late Steve Jobs

    I came to be a Mac owner by happy accident about nine years ago when I needed a computer for my project studio. It was a Quicksilver 2002 G4 tower. After two weeks of using OS X, using Windows at work felt like going back to the Stone Age.

    Some months later, I arrived to work just in time for a meeting to start. We all sat there for ten minutes waiting for my standard-issue work laptop to wake from sleep so we could begin. That same laptop had pulled a similar trick on stage at a conference I was speaking at earlier in the year.

    It was the last act in a long history of abuse I’d endured from Windows PCs. I handed that shitty Dell contraption back in to the IT department and shelled out over $2K of my own money for a sleek new PowerBook G4, just so I could finally get some work done without wanting to constantly punch myself in the face.

    I’ve never used a PC since.

    I’ve been called an Apple fanboy, but the truth is far simpler: I’m impatient and I like well-made things. Things like Japanese cars. German synthesizers. Modern furniture. The Ritz-Carlton pens I steal when I stay at their hotels. I value efficiency and aesthetics enough to pay extra for items that are a pleasure to use, do what they’re supposed to, and last long enough to deliver value for my money.

    Put simply, our time on this Earth is finite and there’s no point in wasting it putting up with schlock.

    Steve Jobs understood this principle so intrinsically that he built an entire corporate culture around it.

    I believe there’s a widespread misconception about Apple. They’re not innovators: they’re exceptional Monday-morning quarterbacks. With every invention that’s shown up in the last ten years, the team at Apple watched, waited, secretly refined, and weren’t afraid to throw away everything they had done until their product represented the essence of an idea’s simplicity in functional form. Then they rolled it out in high style and crushed the competition.

    They didn’t get it all right. MobileMe was kind of a flop, AppleTV never really took off, and they still haven’t fixed the Finder. But their successes far outweigh their failures.

    Apple became masters of showing up late to nearly every party and stealing the spotlight.

    First, they took a stable, cryptic, 30-year-old operating system and made it so amazingly simple that my mum can use it, while leaving in all the power-tools goodness that so many techies such as myself have come to rely on for their livelihoods.

    Then they remade the music player. In the same act, they achieved the seemingly-impossible by pulling the music industry’s head out of its own ass and introducing it to the Internet.

    The iPhone was such an incredible step forward in mobile computing that it might as well have been delivered to us by an advanced civilization. Do you remember what cell phones were like before that thing came along?

    And most recently, tablet computing. I once used a WiFi-enabled Windows CE tablet. It was a touchscreen slate running what looked liked Windows NT for the desktop, which was totally inappropriate for the form factor. In fact, it was so bad of a product that it took those genius bastards at Apple another ten years to do it right with the iPad. The tablet industry had already collapsed upon itself, but Apple recycled the whole thing with the Big Bang of the iPad.

    And then there’s the technologies and standards Apple had to invent and/or heavily embrace to get the rest of the universe into a state where it was ready to receive their Next Big Thing (TM). Things like WiFi, Firewire, Thunderbolt, and an entire cloud-based app store.

    You could say that these are just products – technological idols fawned over by a Western civilization that’s lost touch with real issues like poverty, war, and world hunger. And you’d be right.

    But that doesn’t mean that Apple products haven’t had a meaningful impact on people’s lives. I no longer fight with my computer when I’m at work, so I get more done and come home happier. I get more done when I get home, whether it’s scanning and archiving years of family photos, making music, editing videos, or programming. I can carry 1,000 photo albums, my entire music library, and nearly every book I’ve ever owned on a device smaller than a single paper notepad. I can stream a movie, catch up on news, or just goof off and play GeoDefense Swarm while waiting in line. When wandering unfamiliar streets on trips far away from home, everything the city has to offer is right there under my fingertips.

    In short: I get more enjoyment out of the things I enjoy, and I get to enjoy those things wherever I may be.

    As he makes his way up to the iCloud in the sky, I’d like to thank Steve Jobs for everything he’s done to advance technology & entertainment, and for the positive impact his company’s products have had on my life and the lives of so many family, friends, and colleagues. But greater than this, I’d like to thank him for showing us just how great we can be as a species when we come together with a common purpose, an unwavering vision, and a solid commitment to not give up until we’ve found the perfect solution. The way things are in the world right now, a little more world-changing could go a very long way.

    2011.10.06 - Tags: Apple / 1 response / add a response

  • How to find old Airport Express/Extreme/Time Capsule firmware

    Most of the time using Apple products is a pleasure, but just occasionally they make things unnecessarily complicated and obscure. Finding legacy Airport Extreme firmware falls into the latter category.

    I ran into this issue today. There’s a new 7.5.2 firmware update that I’d like to apply to my base station, but before I do that, I wanted to make sure I had the old firmware version as a backup. This is because I’ve had issues in the past where Time Machine has stopped backing up to my Airport Disk after a firmware update (when going to 7.4.2 specifically), and if this happens again, I want to be able to downgrade back to 7.4.1 (which is what I’m on today).

    Apple has a few articles on their site that list the various versions of Airport Extreme firmware and Airport Utility downloads, but the older firmware download links just send you to an article about updating your Airport, and provide no links to download the software. Awesome.

    After digging around for the last hour, I found this forum post where Bob Timmons (bless his soul) explains the super-secret handshake necessary to find old firmware versions.

    And so, without further ado, here it is (drumroll please).

    To start with, figure out what version of the Airport/Time Capsule you have: you don’t want to download and install the wrong firmware for your base station or bad things could happen. When you open Airport Utility and select your base station from the list, it will tell you what hardware revision you have. Mine says “Airport Utility found an Airport Extreme 802.11n (1st Generation).” So, I now know that the only firmware I am interested in is that for the Airport Extreme 802.11n (1st Generation).

    To see a list of all the firmware for all Airport/TIme Capsule devices, open Airport Utility, open the File menu, hold down Option, and click “Check for Updates.” Doing so presents you (after a few seconds of load time) with a list of firmware for every Airport product Apple has ever made. You can scroll through the list looking for the firmware version you want. Some of the firmware version names were abbreviated cutting off the generation of the device, and you can’t resize the window (awesome UI, guys… seriously, somebody at Apple was asleep at the wheel with this whole firmware thing). The good news is that if you mouse over the abbreviated firmware entry, a tooltip will pop up to show you the details you can’t see.

    To download one or more firmware packages, check the boxes for the items you want and click the “Download” button. The files are downloaded to the path /Users/yourusername/Library/Application Support/Apple/AirPort/Firmware/ and shoved into a sub-directory for the product ID of your Airport (which in my case is 104). Firmware files are named version.basebinary.

    Finally, to install a firmware version, open up the Manual Setup window for your base station, open the Base Station menu, select “Upload Firmware…”, and select the version you want to install from the list.

    Easy as kicking yourself in the face with both feet.

    2011.08.25 - / no responses / add a response

  • async-http-client

    I was looking around for a way to intercept low-level HTTP events (such as time-to-first-byte) with Apache’s HTTPClient library as part of a new integration testing suite we’re developing at work, but to no avail.

    Then I stumbled across the async-http-client library from Ning. It’s lightweight, uses Netty under the hood, can be used synchronously or asynchronously as you see fit, and has a much more intuitive builder-based API than HTTPClient.

    I’d provide code samples, but the little PDF manual included in the source distro is more than enough to get you going in style. I think this is going to be my defacto HTTP client library for Java moving forward.

    2011.04.15 - / no responses / add a response

  • Using curl with a web site secured by Rails Authenticity Token

    There’s a third-party hosted service that we use at work. It has a great browser-based UI which allows us to generate reports in Excel.

    This is all great, but we wanted to integrate the data this web app captures into some internal dashboards. The app has an API, but the API doesn’t give me a way to pull the information out as succinctly as the Excel reports I can pull through the browser-based UI. My goal was to figure out a way to programmatically log in to the web site, pull an Excel document using curl, and feed it into Pentaho’s excellent Kettle tool for ETL into a data warehouse that I can use to back our internal dashboards.

    I figured I could just post my login information to the server using POST parameters with curl. Unfortunately, the web site is not very curl-friendly. It uses a Rails method for securing login forms called Authenticity Token. The way this works is that every time you load the login page, Rails generates an authenticity_token which gets stored in your session and written out to the login form. Unless you submit the exact same authenticity_token that was generated in the login form, your login will fail. In order to maintain session continuity, Rails uses good old-fashioned cookies, so the cookies need to be maintained between the request and login as well. This is a great security mechanism to prevent people from hijacking your session, but not great when you’re trying to programmatically log into a web site with curl.

    To get around this, I needed to do the following.

    1. Load the login page using curl, piping the resulting HTML through grep and cut to parse out the authenticity_token. I also need to save the cookies set by the server as the login page loads.
    2. Post to the login form’s action with the cookies from Step 1, including all the login credentials and hidden fields (all of which can be hard-coded) and appending the URI-encoded authenticity_token (which must be dynamic since it is generated fresh on every page load).
    3. curl the URI that the web site would generate to load the Excel report that I want to pull down, redirecting the output to a file.

    Below is the shell script I came up with to do this, which I thought I would share with the world in case anybody else runs into this issue. I’m not a great shell scripter and regexs confuse me (hence the ghetto cut method for pulling the auth token out), but this approach works.

    Note the character positions 287-330 in the first curl. These positions relate to the location of the value of the authenticity_token in the login page of the web app I’m authenticating against. Make sure to tune these values to your needs as necessary, or use another way to pull out the value. The tokens are always the same length and appear to be Base64 encoded strings.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    #!/bin/bash
     
    # Pulls the login page and strips out the auth token
    authToken=`curl -L -c cookies.txt --silent 'https://railsapp.com/path/to/login/page' | grep 'something unique to the line of HTML code with authenticity_token, such as the form field ID' | cut -c 287-330`
     
    # Posts all the pre-URI-encoded stuff and appends the URI-encoded auth token
    curl -L -c cookies.txt -b cookies.txt --silent --data 'pre-uriencoded key value pairs for everything in the form except for the auth token' --data-urlencode authenticity_token=$authToken 'https://railsapp.com/path/the/login/form/submits/to' > /dev/null
     
    curl (whatever URL you need to hit after logging in to get what you need - in my case, the Excel report spreadsheet)

    2011.03.02 - / 6 responses / add a response

  • An AppleScript to Toggle Sleep Modes

    I have a 2008 unibody MacBook Pro, and the battery is starting to show its age. When I leave it in sleep mode, I maybe get a day and a half before the battery is completely drained. Putting my laptop into hibernation keeps the battery charge longer, but takes longer to start up as well. Depending on what I’m doing with my laptop (i.e. putting it to sleep at home for a few hours vs. traveling with it) I like to change the power mode accordingly so that I can go longer without having to plug it in.

    You can change the power-down mode from sleep to hibernate and vice versa using the pmset command line utility, but I kept forgetting the options to pass in, so I wrote a little AppleScript that does it for me. The script prompts you for your admin password, checks the current sleep mode, and gives you the option to toggle the other mode if you want to.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    
    set loggedInUser to system attribute "USER"
    set userCancelled to false
    try
    	set sudoPasswordResult to display dialog "Please enter your password: " default answer "" with title "Password" with icon caution with hidden answer
    on error number -128
    	set userCancelled to true
    end try
     
    if not userCancelled then
    	if text returned of sudoPasswordResult is not equal to "" then
    		set sudoPassword to text returned of sudoPasswordResult
    		set currentModeText to do shell script "pmset -g | grep hibernatemode" user name loggedInUser password sudoPassword with administrator privileges
    		set currentMode to item 16 of currentModeText
     
    		set selectedButton to 1
    		set currentSleepModeName to ""
    		if currentMode is equal to "1" then
    			#Hibernate mode - default selection toggles to Sleep
    			set selectedButton to 1
    			set currentSleepModeName to "Hibernate"
    		else if currentMode is equal to "3" then
    			#Sleep mode - default selection toggles to Hibernate
    			set currentSleepModeName to "Sleep"
    			set selectedButton to 2
    		end if
     
    		set sleepModeResults to display dialog "Current sleep mode is " & currentSleepModeName & ". Select new sleep mode." with title "Select new sleep mode" buttons {"Sleep", "Hibernate"} default button selectedButton
    		set newSleepMode to button returned of sleepModeResults
    		if newSleepMode is "Sleep" then
    			set sleepModeFlag to 3
    		else if newSleepMode is "Hibernate" then
    			set sleepModeFlag to 1
    		end if
     
    		do shell script "pmset -a hibernatemode " & sleepModeFlag user name loggedInUser password sudoPassword with administrator privileges
    	end if
    end if

    2011.01.23 - Tags: AppleScript / no responses / add a response

  • Jamming on the Arduinome with mlrv

    I wile away many an evening jamming out loops on my Arduinome with mlrv, so I thought I’d capture a little on tape.

    Each track in mlrv holds a sample, and relates to a horizontal button row on the Arduinome. The sample is sliced up in to sections, and my Arduinome controls the triggering of the first 8 sections (since it’s only 8 buttons wide). mlrv has a basic loop recorder that I use at the beginning of the video to capture the baseline.

    This was recorded by piping the output of mlrv to Soundflower, routing Soundflower in to Logic, capturing mlrv with iShowU, and editing in Final Cut Express.

    2010.12.31 - Tags: Arduinome Electronics Gagdets Making / 3 responses / add a response

  • SammichSID Finished

    I just finished my latest electronics project, which is a synthesizer that uses the chips from a Commodore64 for the sound engine. It’s totally awesome, makes lots of blinky flashing lights, and sounds like a bunch of retro game consoles having a drunken orgy.

    I’ll post some more pics and videos soon, but here’s a little teaser.

    2010.12.21 - Tags: Electronics Gadgets Making / 1 response / add a response

  • Greater Orlando Hackerspace

    After I started getting in to electronics and realized that I was only going to get so far on my Make: Electronics book alone, I looked around for maker groups in the Orlando area.

    As it turns out, there’s one right in my back yard in Altamonte Springs: the Greater Orlando Hackerspace. My first attempts to contact them a few months back were in vain, but I hit them up again today after seeing some activity on their blog, and learned that they are still going strong just with a little restructuring taking place. They still have “Microcontroller Mondays” every Monday at 7 PM so I hope to go out there in a week or two to show my Arduinome, and maybe help some other people build one while learning some stuff myself.

    If you are interested in getting engaged, check out their membership page and drop them an email. If you don’t want to join but want to do a little good for the community, please send them a donation for their laser cutter. Any amount is welcomed, but only $10 gets you a keychain!

    2010.08.15 - Tags: Electronics Making / 3 responses / add a response

  • My Arduinome Build in Pictures

    Get the flash player here: http://www.adobe.com/flashplayer

    2010.08.14 - Tags: Arduinome Electronics Making / no responses / add a response