Synology denies Transmission permission

I use Transmission, a popular BitTorrent client developed for OS X and Unix platforms. I also own a Synology DS415+; whilst it’s possible to run Transmission directly on a Synology NAS, I run Transmission on my iMac and set the NAS as the destination folder for my downloads.

The other day, I began to encounter a problem. Whenever I added a new torrent, Transmission would stop downloading at about 1%, with the error Permission Denied (/Synology/Downloads). This was, naturally, quite irritating, so I set out to find out what was happening.

This error is caused by a bug in Yosemite. If you go to the terminal and type

ls /Volumes

you’ll see a list of the names of the volumes connected to your iMac. In my case, something was immediately a little weird; Synology appeared in the list as it should have done, but Synology-1 was also listed. Ejecting the network drive meant that Synology-1 disappeared, but Synology was still listed.

So, the next Terminal command I typed (based on this Ask Different post) was

sudo rmdir /Volumes/Synology

before remounting the Synology from the Finder. This fixed the problem with Transmission and my torrenting can continue in peace. Hooray!

Unpacking .pkg files in OS X with BetterZip

I had cause today to try to unpack a .pkg file. I had installed PDF File Unlocker and found it was a bit pants1. Unfortunately, it installed from a .pkg file and there was no uninstaller or list of files that get installed, so I wanted to make sure I’d efficiently purged it from my system.

I have BetterZip, which is a really good utility for unzipping basically any file on the planet for OS X. I will just note at this stage that I have an older version of the utility and I haven’t upgraded to BetterZip 2, but I’ve got a lot of use out of the app. The below steps rely on having BetterZip. If you’d like to do it without BetterZip, I found this blog post and this Stack Overflow post to be very helpful in informing my actions.

  1. Change the extension from .pkg to .xar.
  2. Open the file with BetterZip. This took a while on my system but did eventually work.
  3. Three files should appear: Payload, Bom, and PackageInfo.
  4. PackageInfo: Just open this in your favourite text editor.
  5. Payload:
    • Add the extension .cpio.gz.
    • Open the file with BetterZip.
  6. Bom:
    • Open Terminal.
    • Navigate to the file.
    • lsbom Bom

Hopefully that all helps somebody else, too!


  1. If you generate a PDF with the free trial, it’ll be the first half of the PDF and every time you open it Adobe Acrobat will give you a little pop-up window. I disliked it. 

Modifying epub files to include ‘sort by’ metadata

As most people know, books are usually organised by the surname of the (first) author, alphabetically. As some others will know, ebooks are not always great at this; iTunes sometimes thinks it should sort a book by first name instead of last name, and my Nook sorts by the last word of the first author’s name regardless of where their surname is. I’ve written about my tinkering with Calibre and ebooks before and this blog post is a short snippet that builds on that. As before, I’m using Calibre to perform the tweaks.

I’ve been trying to fix this problem by including something that looks like the following in the OPF file of my epub files:

<dc:creator opf:file-as="Beagle, Peter S." opf:role="aut">Peter S. Beagle</dc:creator>

The dc:creator tag is used by the epub specification to identify the contents of the tag as a creator of the work. The opf:role="aut" is there to identify http://www.honeytraveler.com/pharmacy/ Peter S. Beagle specifically as the author of the work. opf:file-as="Beagle, Peter S." is obviously there to make it clear what the sort criterion should be for this file.

There’s only one problem with including this line: it doesn’t always work. Sometimes it does, but often my Nook will complain of an unreadable file (even though Calibre will read it just fine). So, what’s up? I have been puzzling over this issue for ages, and today I finally cracked it.

At the start of your book, there will be a <package> tag, and then below that a <metadata> tag. In order for your epub to be able to use the opf:role and opf:file-as attributes, the <metadata> tag has to look like this (or at least include this part):

<metadata xmlns:opf="http://www.idpf.org/2007/opf">

Making sure that your <metadata> tag is correct solves the problem. Wahey!

Further notes on Markdown and WordPress

For a long while, my blog post on one of Amanda Palmer’s Kickstarter projects was my most popular blog post, thanks in no small part to AFP herself tweeting a link to it, providing a very nice uptick in my hits for the day! However, a different blog post recently overtook it — I am, as you’ve almost certainly worked out from this post’s title, talking about my previous blog post about using Markdown with WordPress, which I’m happy to see is proving to be useful to so many people.

However, things have changed in the way I use Markdown with WordPress since then. Michel Fortin has announced that his PHP Markdown Extra will no longer be updated as of 1 January 2014. He’s introduced PHP Markdown Lib 1.3 to replace it, partly because he no longer wants to maintain the WordPress elements. This is fair enough, but it introduces a fly to the ointment. One annoying thing about PHP Markdown Extra is that, if you have it installed on WordPress but then deactivate it or uninstall it, your blog no longer knows how to handle Markdown. This results in all of your blog posts displaying raw Markdown, rather than the HTML that they should show to visitors. Therefore, when a plugin is depreciated, it can be a real pain in the backside to get everything back to where it was.

As a result, as a WordPress user I have been casting around for a replacement for PHP Markdown Extra that won’t create the same problem if you need to deactivate it. I am here to tell you I believe I’ve found something that fits the bill perfectly.

An image showing the Markdown on Save Improved pane in the WordPress editor.

I’d like to recommend Markdown on Save Improved as a solid replacement for PHP Markdown Extra on WordPress. It addresses the concern I’ve outlined above very elegantly, by maintaining the database of Markdown separately to the database of blog posts. This means that if you write a blog post in Markdown and then uninstall it, the blog post will still display as HTML to the audience of your website — obviously a huge improvement over the ‘naked’ display that could occur with other Markdown plugins.1 Markdown on Save Improved is maintained by Matt Wiebe, who works for WordPress.com’s parent company Automattic — which presumably means he knows his stuff — and uses PHP Markdown Extra to parse Markdown, so it should produce identical output.

Markdown on Save Improved has one major drawback: when I installed it, it didn’t know which of my posts were Markdown and which were not, so I had to trawl through my database and hit ‘Update’ on each post. Whilst this isn’t a huge problem for someone like me who has a relatively small number of blog posts, someone who has more might find it a little clunky. Also, it assumes that you want to use Markdown every time you create a new blog post; perfect for me, but not great if you don’t want it to do that.2

What else has changed about my use of Markdown in the time since I wrote my original post? Whilst I’m still using the same beloved TextWrangler to edit my Markdown, I’m now using it in conjunction with the excellent Marked, which works with any text-editing app. The way it works is simple: you set your .md files to open in Marked, and then when you open them you see the rendered text displayed. Hit ⌘E and it’ll open the source in your editor of choice. Whenever you save the file in the editor, not only will Marked update the display, but it’ll indicate the paragraph of your latest edit so you can instantly focus on where your changes are appearing. It’s an incredibly elegant and useful app, and a snip at £2.49 on the Mac App Store.

So, in summary, go check out Markdown on Save and Marked. Both are incredibly useful tools that will make your Markdown even easier to write than it is at the moment.

A screenshot of this blog post and what it looks like in Marked.


  1. It’s also, I think, a huge improvement over WP-Markdown, which converts your Markdown to HTML when you save a blog entry and then converts that HTML back into Markdown when you come back; there are a couple of threads on that plugin’s support board that complain about this process badly mangling their Markdown and making it much harder to work with. 
  2. There is an alternative plugin called Markdown on Save, coded by Mark Jaquith, which is the plugin that Improved is based upon. This means you turn the option on for each blog post, rather than having to turn it off for each one. It’s prettier, but it contains a bug which causes footnotes to break on any WordPress page which displays more than one blog post (such as the front page or any category’s page). That’s why I’m not using it. 

Setting a cover image on an ePub ebook

As some of you may already know, I recently received a Barnes & Noble Nook for Christmas. This has been a great gift and I’m thoroughly enjoying using it to read a lot more literature, but there’s a problem that has been recurring: some publishers don’t properly set the cover art on an e-book, meaning the cover doesn’t show up on my Nook. Since, for me, everything really should be perfect (it’s a disease, trust me), I have been attempting to rectify this problem with my ebooks and I’ve finally come upon the solution. It’s fairly simple to do, as long as you’re a little comfortable with editing in HTML.

The first thing to do if you’re having trouble is to download Calibre and install it. Calibre is a fairly clunky piece of open-source software but it’s very full-featured and allows for ebooks to be edited. Once you’ve installed Calibre, run it and drag the problematic ebook into the library. Now, there are two ways to proceed.

One way (and arguably the easy way) is to click ‘Edit Metadata’, set the correct cover image and then convert the file into an epub; Calibre will embed the correct cover image into the new file. However, this method doesn’t sit well with me and so I’m going to outline how I do it below.

Right-click on the ebook and click ‘Tweak Book’, then click ‘Explode Book’. Look for a file that ends in ‘.opf’ (this will probably be in a folder called OEBPS) and open this file in your favourite text editor.1 There will be, somewhere in this file, a line that says <manifest>. You want to find the ID of the cover within this tag. It’ll probably be something like

<item id="cover_image" href="cover.jpg" media-type="image/jpeg">

and so the ID is cover_image in this case. Now go up to the <metadata> tag and insert a piece of text before the end:

<meta name="cover" content="cover_image"/>

This will let the ePub file know where the cover image is contained, and should therefore show up properly on your Nook. It’s important to note that it has to be in this order: if content comes before name, it will not display correctly. This is because of a bug in the Nook’s implementation of the EPUB specification.


  1. I use TextWrangler on my Macs and Notepad++ on my PCs; your mileage will vary.