Microblogging

When it comes to my online lifestyle, I’m quite stodgy and old-fashioned. I like having a domain that is the canonical digital representation of me. I like running software on my own server, so that I’m in control of my own content. I prefer writing here, and having the words copied to Twitter rather than the other way around. Over the years I’ve been guilty of tweaking the URL structure here on sunpig.com (cool URIs don’t change), but I have tried to keep redirects in place for old content. The last change was four years ago when I moved from Movable Type to WordPress and settled on the sunpig.com/martin/year/month/day/slug/ format, dropping the “.html” suffix. I’m quite particular about my URLs.

And I really like WordPress! But compared to the ease of putting up a Tweet, it has always felt overcomplicated. Now that I have a lovely new (actually, not that new any more, but it still feels new) iPhone X that is capable of great feats of computing, I’ve been wanting to post to my blog more often, and more casually. And while there is a WordPress app for iOS, the image upload workflow had me stymied for a long time.

See, I don’t use WordPress’s built-in image uploading capabilities, because it puts uploaded images in the wrong place. By default, WordPress puts them under /.../wordpress/wp-content/uploads/sites/$SITE_ID/$YEAR/$MONTH/. I don’t like storing CMS content in the directory structure of the application itself. It feels like I’m tying myself to the application, and I hate that. (I also still write my HTML by hand, rather than using WordPress’s visual editor. Like I said, stodgy and old-fashioned. It’s also a position of privilege, and I’m aware of that.) Uploaded images should be served from https://sunpig.com/martin/images/$YEAR/, and I want them stored on disk in a location that maps closely to that same structure. So until today, my image workflow had been:

  • Take picture.
  • Manipulate picture, usually in Acorn.
  • Save suitably compressed picture to a folder on disk that has an OSX Automator folder action on it that does an rsync upload of any new files to the matching folder on my server. (Or, if I’m not on my home computer, use Transmit to do the upload manually.) Because I’ve got nginx serving images direct from disk, that image is now immediately available over https.
  • In WordPress, use the “Add Media” option to “insert from URL”, manually typing out the URL where I know the image lives.
  • Save the blog entry.

If this is tedious on a desktop machine, it’s ten times worse on a phone. On iOS there are plenty of really nice image editors; fewer options for scaling and optimizing images for the web; and only a few apps I’d feel happy entrusting with my ssh keys for connecting to remote servers. With Panic Software sunsetting Transmit for iOS I didn’t see the workflow getting any better. I briefly contemplated writing my own app that would do all of this in a single gulp, but…I’ve got better things to do with my time.

Today I was messing around with micro.blog, whose concept I love, and which I backed on Kickstarter. I installed the iOS app because it supports posting directly to a WordPress blog. But then I ran into the upload problem again: if I upload an image from any third-party application, WordPress would just put it in its own stupid location, and I wouldn’t be any better off.

Sigh.

But I dug a bit deeper and found that there’s actually a pretty simple answer to this. One of the great things about WordPress is how madly customizable it is. Pretty much every function in the application can be tweaked or completely overridden through the use of filter hooks, and this includes the location of file uploads. In the end, I created a child theme to hold my customizations, so that they won’t get overwritten when the parent theme is updated. In the child theme, I add a filter to the built-in upload_dir function that will replace the default upload locations with my preferred locations:

// Customize the uploads directory:
// By default, WP uploads to $WORDPRESS_DIR/wp-content/uploads/sites/$SITE_ID/$YEAR/$MONTH/
// I want to upload to $BLOG_ROOT/images/$YEAR/
//
// The $uploads parameter contains details of the uploads directory and the
// path on which uploaded files will be served. Default:
// {
//     "path":"/var/www/sunpig.com/wordpress/wp-content/uploads/sites/2/2018/05",
//     "url":"https://sunpig.com/martin/wp-content/uploads/sites/2/2018/05",
//     "subdir":"/2018/05",
//     "basedir":"/var/www/sunpig.com/wordpress/wp-content/uploads/sites/2",
//     "baseurl":"https://sunpig.com/martin/wp-content/uploads/sites/2",
//     "error":false
// }
function sunpig_martin_upload_dir_filter( $uploads ) {
    $year = date("Y");
    $uploads['basedir'] = "/var/www/sunpig.com/martin/images";
    $uploads['baseurl'] = "https://sunpig.com/martin/images";
    $uploads['path'] = "/var/www/sunpig.com/martin/images/$year";
    $uploads['url'] = "https://sunpig.com/martin/images/$year";
    $uploads['subdir'] = "/$year";

    return $uploads;
}

add_filter( 'upload_dir', 'sunpig_martin_upload_dir_filter' );

And boom ? WordPress now puts my uploaded images exactly where I want. I could have done this more elegantly, with less hard-coding, but LOL no. This is perfectly fine.

UPDATE 5 June 2018: Putting this functionality in a child theme is the wrong place, because it means that I have to make a new child theme whenever I want to change the theme of my blog. The right place for this code to go is in a functionality plugin that can operate no matter what theme is active.

The WordPress app and the Micro.blog app now sit on the home screen of my phone. I like the “messing around in photo apps” part of my blogging workflow – that bit was never the problem. Now that I’ve fixed the image uploading step, I hope that this means I’ll post more often, and in smaller chunks. We’ll see!

Stay on target

Flightstats.com is using icons of X-Wings instead of airplanes today (May the 4th) for flights in the air:

At least I hope they’re using non-representational icons. I don’t imagine a 10-hour flight in an X-wing would be particularly comfortable.

Wye Oak at Paradiso Noord, Friday 20 April 2018

Jenn Wasner – Wye Oak at Paradiso Noord

The shows I’ve been to so far this year have all been big productions (Imagine Dragons, Hamilton, Bastille) or have involved travel to get there (Thumpers, The Cool Quest, Gaz Coombes). This one on what I consider to be my home turf: Paradiso Noord at the Tolhuistuin, on the North bank of the IJ. It was a hot day, and I cycled there without a coat, and enjoyed a cold beer when I arrived super early. Early enough to grab a place right in front of the stage, in touching distance of Andy Stack’s drum kit, because I couldn’t stand to have another gig where someone squeezed in front of me and blocked my view. Selfish maybe, but I’m working on finding a way to live with myself.

I came to Wye Oak via Jenn Wasner’s side project Dungeonesse, which is super-synthy and upbeat as opposed to Wye Oak’s more earlier sombre indie/folk/rock-ish outings. But Dungeonesse heralded a change of direction for the duo, and their 2014 album Shriek was much more electronic, experimental, and filled with a kind of heavy beat-driven shimmering menace that is right in my wheelhouse (e.g. “Glory”). Their follow-up Tween in 2016 follows a similar path, but their new album The Louder I Call, The Faster It Runs takes it to another level. The syncopations that Andy Stack lays down on tracks like “The Instrument” and “Symmetry” are intense. There are times when it feels like he’s playing for a different song entirely, but then the bass catches up, and Jenn’s vocals bring it all together on a soaring chorus.

To be honest, I hadn’t really been looking forward to opening act Suno Deko. I had listened to a few tracks on Spotify, and they hadn’t grabbed me. They felt too ethereal and abstract. But watching him live was a completely different matter: he loops together guitar and vocals in a thoroughly mesmerising ensemble — a style I first remember from seeing Zoë Keating play.

Suno Deko at Paradiso Noord

This was the first night of their tour, which was another reason to be excited about it. Jenn, Andy, and their bass player tuned up on stage themselves for a bit after Suno Deko before taking a break and then coming back on stage for their own set. The stage was simple, no fancy light show, and just a large backdrop featuring the iconic sand and sky from the new album.

Andy Stack – Wye Oak at Paradiso Noord

After a prelude of “(tuning)”, they launched into “The Instrument” and I was left agog watching Andy play. It’s a fast, driving song, but it’s really hard to sway and bop along to. Because I had the best spot on the floor I was able to watch him play all of these fabulous rhythms with metronome precision in fabulous close-up the whole time. For some songs he even casually plays a keyboard with his left hand, like “oh, no big deal”. When the gig was over, I went over to him at the merch stand and gushed my admiration like a total fanboy. Fortunately, he’s just as cool and unflappable off stage as he is behind the drums.

Andy Stack – Wye Oak at Paradiso Noord

Meanwhile, Jenn was switching between guitar and keyboard as she rendered beautiful vocals throughout, her face animated and alight with expression. When she was digging hard into the guitar solos, she reminded me a bit of Ritzy Bryan of The Joy Formidable. Some songs they played just as a duo, with Jenn picking up the bass on “The Tower” and twanging aggressively through the solo parts. “Watching The Waiting”, a favourite of mine, she played in a slowed down version with barely any drum accompaniment at all. It was gorgeous.

Jenn Wasner – Wye Oak at Paradiso Noord

They didn’t play an encore. A few songs before the end of their set Jenn said they were just going to play a few more songs, and not bother with the whole leaving the stage, and coming back on again thing. I approve; it often feels a bit silly. They had already played “Civilian”, their best-known song, and they closed with “The Louder I Call, The Faster It Runs”, ending the show in up-tempo style. I loved the show, and hope I’ll get to see them again some time.

Set list:

  1. Tuning
  2. The Instrument
  3. Lifer
  4. It Was Not Natural
  5. Shriek
  6. Spiral
  7. Symmetry
  8. Say Hello
  9. Over And Over
  10. You Of All People
  11. Glory
  12. Holy Holy
  13. Hot As Day
  14. That I Do
  15. Watching The Waiting
  16. The Tower
  17. Civilian
  18. I Know It’s Real
  19. The Louder I Call, The Faster It Runs
    1. Wye Oak 420 Hamsterdam. Jenn did comment on the coincidence of being in Amsterdam on this day in particular.

Bastille (Reorchestrated) at TivoliVredenburg, Wednesday 18 April 2018

Bastille at TivoliVredenburg

I’ve been to TivoliVredenburg a couple of times before, but this was my first time in the “Grote Zaal”. It has a stage in the centre of the room, with steeply raked seating on all sides. When I booked our tickets (for Fiona and Abi and me — Alex wasn’t interested) it was clear that this was going to be a popular gig, because it sold out in minutes. But it was also on a school night, and there were going to be two support acts we didn’t know before the main event was scheduled at 21:00. We didn’t execute our Ziggo Protocol, but we didn’t show up super early to secure good seats, either. By the time we got there, the first opener (Charlie Barnes) was already on stage, and the only seats we could secure for the three of us in front of the stage were in the back row, tucked into a wedge between the wall and the ceiling.

I knew something was wrong with the sound straight away. It was harsh and unpleasant, and when Charlie Barnes spoke between songs I could barely make out his words. To Kill A King were the second opener, and it was even worse with them. High, snappy tones like the snare drums, cymbals cut through a wash of blurred guitars and vocals like gunshots. The applause between songs was even worse. It was like all the bass was being diffused before it reached to us, and all the treble was being concentrated and compressed into blasts of sound that I found physically painful.

Part-way through the set I left my seat to see if the sound was better elsewhere. I tried a few doors lower down in the auditorium, and to the back of the stage, where the view was worse and there were still spare seats. The sound was better but still not great. After To Kill A King left the stage I took my seat again in the hope that they’d been using a different sound system, and the engineers had been holding back the good stuff for the main event. Unfortunately, nope.

Abi had reassured me that it was OK if I wanted to move around and find a different seat, but I still felt reluctant to do so. But I also remembered a poor experience I had a few years ago seeing The New Pornographers at the Fox Theatre in Oakland when I didn’t move out of a bad seat, and didn’t enjoy the concert as much as I could have. Combined with the offensive acoustics, this pushed me into action. I left after a few songs, and found myself a spot slightly behind the stage with better sound, and a great view of Chris Wood on drums as well as the extra percussionist they had with them for this “Reorchestrated” tour.

The gig itself was fine. The extra musicians (horns, strings, percussion, choir) added depth and texture to the sings they played straight-up, and allowed them to deliver lovely alternative arrangements of others. However, this is the second time I’ve seen Bastille and not entirely enjoyed the experience. Hmm.

Set list:

  1. Pompeii
  2. Snakes
  3. Send Them Off
  4. Warmth
  5. Laughter Lines
  6. Blame
  7. The Anchor
  8. No Scrubs (TLC cover)
  9. Icarus
  10. Two Evils
  11. Flaws
  12. Glory
  13. Of The Night
  14. Cut Her Down (with Ralph Pelleymounter from To Kill A King — together they are the band Annie Oakley Hanging)
  15. These Streets
  16. Oblivion
  17. Things We Lost In The Fire
  18. I Know You (Craig David collab, minus Craig David)
  19. Fake it
  20. Laura Palmer
  21. Good Grief

Encore:

  1. Get Home
  2. World Gone Mad
  3. Weight of Living, Pt I