Danny Stewart

Technology, music, and Doctor Who

iTunes being a bitch

If you’ve had album artwork in iTunes that’s disappeared, even though you know it was there previously (possibly due to iCloud or iTunes Match), try this fix: go into the album, right-click the first track on the album and go to Get Info (or just hit Cmd-I). Either the missing album art will reappear instantly and you can simply cancel out, or you’ll have to click Next to go to the next track on the album and then it will reappear. Rinse and repeat for every album missing its previously stored artwork. It worked for every last album (as soon as I noticed it, that is—after I’d already wasted a bunch of time finding new artwork).

iBooks Author

Now that iBooks Author is here, I might be working on a little something…

Screenshot of iBooks author producing a book about the Doctor Who theme

(Don’t get your hopes up, though… for legal reasons it may never become a reality.)

Alcohol-free February

My friend Sam is going alcohol-free for the month of February, and I’ve decided to join her (and I’m starting early) for all the same reasons she’s doing it.

  1. Sometimes the best way to find out how something is affecting your body is by going without it for a few weeks.

  2. Because both my wallet and my liver could use a break.

  3. To see how it affects me mentally (and socially!).

  4. To see the physical benefits of not ingesting so many “empty calories.”

  5. To prove to myself that there is still a distinction between needing a drink and wanting a drink.

I can’t remember the last time I had fewer than two beers in a day. Yesterday I only had one, and today I’m giving it up until March 1. I’ve battled with depression for a very long time and only recently (this past year) begun using alcohol as an escape. A lot of the time this seems like a good idea, but I don’t think it ever actually is. All it really does is put me to sleep and slowly undermine any progress my antidepressants are making.

So enough is enough, and let’s see what difference a month makes.

Alarms and the iPhone mute switch

I’ve kept quiet on this recent discussion about the iPhone mute switch because I think it’s pretty insignificant and overblown. However, there is one thing I haven’t heard anybody else point out. I’ve heard people say that activating the silent switch on an iPhone should present an alert if you have an alarm scheduled. I was reminded this morning while listening to The Talk Show that the iPhone already essentially does this.

Look up there in the status bar. Apple has always been extremely conservative when it comes to choosing what indicators to put up in the status bar. They only put up indicators for things that are in effect right now. In a sense, they are indications of “modes” the phone can be in—audio playback enabled, alarm(s) enabled, orientation lock enabled. (I always thought it would make sense to include an indicator for silent mode as well.) They are there to tell you how your phone is currently configured at this moment in time.

The fact that they have deemed an active alarm worthy of a permanent spot there is pretty significant. I would say that that is their warning to people using an alarm. You can’t look at your phone in any app without a constant reminder that you have an alarm enabled.

In fact, because I like to keep my status bar clear, I’ve started using Due to handle alarms for me, as I need an alarm to wake me up every weekday morning, and I don’t like having that permanent indicator taking up space.

This recent hullabaloo may have been a perfect storm of unfortunate coincidences, but I believe Apple has taken every reasonable step and made the right design decisions.

New today on the SoundCloud

Diva comparison

For anyone interested, I’ve just whipped up a quick comparison demonstrating my Doctor Who bassline with Diva set to Divine (the highest possible accuracy setting) compared with Diva set to Draft (the lowest possible accuracy setting). Not a humongous difference, but Divine is (obviously) noticeably better.

Diva: the Spirit of Analogue

Diva is a new soft synth from u-he, makers of my beloved Zebra. They emailed me about it in mid-December with a trial and an offer of a discount. I jumped on it immediately, but didn’t really have a chance to sit down with it until last night.

Here’s what they say about it:

The oscillators, filters and envelopes closely model components found in some of the great monophonic and polyphonic synthesizers of yesteryear. Modules can be mixed and matched so you can build hybrids, but what sets DIVA apart is the sheer authenticity of the analogue sound.

They’re not kidding. The sound of this synth is fantastic, and the interface is a joy to use. Zebra is a more complicated beast to tame, and its interface illustrates that pretty well. But what Diva lacks in complexity (not necessarily a bad thing, in my opinion) it more than makes up for with its sound and its wonderfully intuitive interface.

The flexibility of the modules you can “snap” together makes it hard to tear yourself away from it. When I realized what I could do last night, I started putting the pieces together to recreate my beloved Juno-6. It managed to feel like it even down to its look. (Some of the modules, like DCO for example, are specifically modeled after the Juno.)

The one regret I have about this synth is that there is no arpeggiator. That feels like quite an omission, and is one reason why it won’t be replacing my Juno any time soon. That said, though, for a lot of my projects, I may now have found something worthy of standing in for Zebra—and it seems only fitting that it’s from the same people.

Check out my Diva test to hear what Diva can do. There are no effects plugins anywhere but on the main melody. Listen to those atmospheric pads, strings, and bells behind it, and the tone of that bass. Seriously impressive.

Important Second Crack update

It’s 4:00 in the morning and I just woke up to a slew of emails informing me that my server had exploded. This was because I had majorly screwed up with the shell script I had written to move drafts. I forgot to include a section checking whether the script was already running, so the script kept running itself repeatedly until it brought the server to its knees.

I’ve corrected the script on my server and in the original post, so if you were unfortunate enough to copy that script from me, make sure you update yours as well.

Setting up Second Crack

Someone on Twitter asked me about any gotchas I ran into when installing Marco Arment’s Second Crack as the blog engine powering DannyStewart.com. For the sake of anyone else looking to do what I’ve done, I thought I’d write a little bit about my experience. (Despite what Marco says, I highly recommend Second Crack.)

Disclaimer: I did not write Second Crack and am not an expert here. I may have done this very badly. You should not necessarily trust anything I say. All I can tell you is that as of right now I have my site working the way I want it.

First of all, my server is hosted with Linode and is running Debian 6 with Apache. I checked out the Git repo on the server. I had a choice here. I could put it in /home/danny or I could put it in /srv/www where I host my site. I wasn’t as sure of what I was doing at first, so for simplicity and convenience (especially early on), I placed it in with my site (/srv/www/secondcrack). This isn’t necessary, so it’s really up to you.

Then, I installed the CLI version of Dropbox along with their dropbox.py utility, both available for download directly from the main Dropbox page. After installation, I excluded every directory in my Dropbox (using dropbox.py) except the top-level Blog folder. I didn’t want my 30+ GB of other stuff syncing across to my server.

Once everything was syncing over, I added the following lines to my crontab.

* * * * * danny /srv/www/secondcrack/engine/update.sh /home/danny/Dropbox/Blog /srv/www/secondcrack   
* * * * * danny /home/danny/.dropbox-dist/dropboxd

I did this because I wanted Second Crack running under my user. Then I restarted cron and verified that update.sh was running with a ps -A.

Finally, once I had everything working the way I wanted to, I erased the built-in www folder that Second Crack writes to by default, and I symlinked the secondcrack/www folder back to the root of my website, so that all the files would be written directly there without me having to move my Second Crack install from where it was already.

Working around permissions

The biggest problem I ran into was with the bookmarklet. When you use the bookmarklet, it tries to write a text file directly to your Dropbox drafts folder. This is no good on my setup because the danny user owns my Dropbox folder, while the user Apache runs as (www-data) can’t write to (or even see) danny’s Dropbox.

So I created a draft_temp folder in the root of where my site is hosted from, and then wrote the following shell script:

#!/bin/bash

BASH_LOCK_DIR="/home/danny/move_drafts.sh.lock"

if mkdir "$BASH_LOCK_DIR" ; then
    trap "rmdir '$BASH_LOCK_DIR' 2>/dev/null ; exit" INT TERM EXIT

    while true ; do
        inotifywait -q -q -r -t 30 -e close_write -e create -e delete -e moved_from /srv/www/draft_temp/
            if [ $? -eq 0 ] ; then
                mv /srv/www/draft_temp/* /home/danny/Dropbox/Blog/drafts/
            fi
    done

    rmdir "$BASH_LOCK_DIR" 2>/dev/null
    trap - INT TERM EXIT
else
   echo "Already running"
fi

This uses inotifywait (like Second Crack) to watch the draft_temp folder, and the moment I create a new draft using the bookmarklet, this script instantly moves it to my Dropbox folder. Just put this in your crontab like the previous entries.

Triggering a rebuild

Every time you make a global change (such as a modification to the template files), the easiest way to trigger a rebuild of the site is to first empty the secondcrack/cache folder, then just change anything in your Dropbox’s Blog folder. Delete something and then undo it, add a random word to a post then save and undo, etc. Just get Dropbox to sync the change and notice that a file is different, and then it will rebuild.

If a post breaks

If a post breaks, such as (in the example Marco cites) when you remove a post from the middle of several posts in one day and they do not re-number properly, there is an easy fix. Just drag all the posts from that month’s folder back to the drafts/_publish-now folder. They will be published again, with their original timestamps, except any broken numbering or missing posts will be fixed. Turns out, this is not such a great idea after all. It can cause duplicate posts. Instead, limit yourself to just the posts from that day, and you might be better served by moving them to _publish_now one at a time, in order.

If I did something stupid…

…and you want to help me make my setup less stupid, please feel free to email me (see my Contact page) or tweet me at @dannystewart. The same thing goes if you have questions about something I didn’t cover here. I would be happy to add it.