Installing TrueCrypt on Yosemite

October 28th, 2014 20 comments

I have a few projects around TrueCrypt but I’ve never written about them here on my blog, for instance I’ve contributed a lot to the truecrypt-archive project on GitHub, and I have a PPA for Ubuntu.

For my PPA, I wrote a patch to support Ubuntu’s appindicators, without which TrueCrypt is a lot harder to use on Ubuntu. I was updating the PPA this weekend for 14.10 and I took the opportunity to add bash completion as well. I recently discovered that the PPA is quite popular, which makes me happy.

Anyway, back to the point of this blog post. Mac OS X 10.10 (Yosemite) was recently released, and both TrueCrypt 7.1a and 7.2 are unable to install on it due to a version check. Instead of posting a new binary that people don’t trust, here are steps you can take to remove the installer check from your own binary. You need to know how to use the terminal to perform these steps.

The easy way is to first extract TrueCrypt 7.1a.mpkg from TrueCrypt 7.1a Mac OS X.dmg and then run this command in the terminal:

sed -i '' 's/<installation-check .*>//' 'TrueCrypt 7.1a.mpkg/Contents/distribution.dist'

Or, if you want to create a new dmg archive with this fix, you can follow these steps:

hdiutil convert 'TrueCrypt 7.1a Mac OS X.dmg' -format UDRW -o 'TrueCrypt 7.1a Mac OS X writable.dmg'
hdiutil attach 'TrueCrypt 7.1a Mac OS X writable.dmg'
sed -i '' 's/<installation-check .*>//' '/Volumes/TrueCrypt 7.1a/TrueCrypt 7.1a.mpkg/Contents/distribution.dist'
hdiutil detach '/Volumes/TrueCrypt 7.1a'
hdiutil convert 'TrueCrypt 7.1a Mac OS X writable.dmg' -format UDBZ -o 'TrueCrypt 7.1a Mac OS X Yosemite.dmg'

I hope this is useful to people.

Edit: See here for more of my TrueCrypt Mac patches:

Tags: , ,

ShutdownGuard featured in PC Welt magazine

May 10th, 2014 No comments

The German magazine PC Welt featured ShutdownGuard in edition 5/2014. Compared to when AltDrag was featured in another german magazine back in 2012, this time there’s good chunk of text in the pages! My only complaint is that they didn’t put my name in there, but otherwise I’m very happy!

What magazine is next?

Google Project Hosting is dead, long live GitHub

January 16th, 2014 No comments

Yesterday Google Code Project Hosting shut down the ability for projects to add new downloads, just as they announced back in May. The reason they say, is because the “downloads have become a source of abuse”. I have no doubt they were having problems, but this move — basically killing Project Hosting instead of fixing it — shows that they really see no future in the product. I had some trouble with this back in March and a rather unpleasant experience trying to get Google to correct it.

It was perhaps no coincidence that GitHub less than two months later announced “releases”, finally making it possible to ship binaries to end users (they did have a downloads section for a while, which has since been removed). With this launch, GitHub is offering a lot more than Google has ever offered with Project Hosting.

Last weekend I spent some time to finally migrate my repositories over to Git and GitHub. All my repositories on Google were using Subversion, the first VCS that they offered (they now also offer Mercurial and Git). It has been clear for a while now that Git has won the DCVS fight, so this feels very familiar to the days when people were moving from CVS to Subversion.

GitHub suggests that you use svn2git to migrate from Subversion to Git. The only issue I had with this is that it is impossible to use it to migrate your Project Hosting-specific /wiki directory, and I had a lot of trouble finding a good solution. Finally I stumbled over Google’s instructions on converting your repository from Subversion to Git. What I ended up using is a combination of the two.

You really only have one good option: import the /wiki directory as a separate branch.

You could also import your /wiki directory as a GitHub wiki, but they suck. Another option is to use git subtree to add your /wiki directory into your master branch, but I don’t recommend it.

First, use svn2git to transfer everything except your /wiki directory. Your /trunk will become your master branch, /branches will become their own branches and /tags will automatically be tagged. Be sure to build your ~/.svn2git/authors file first, and always run svn2git with the verbose flags, since otherwise you might not see important conversion errors. If your branches and tags are not correctly converted, watch out for this bug.

mkdir altdrag
cd altdrag
svn2git -v

Then, use “git svn clone” to transfer your /wiki directory to its own little git repo. Use --no-metadata to get the commit messages in the same format as svn2git.

cd ..
git svn clone --authors-file=$HOME/.svn2git/authors --no-metadata
git branch -m doc

I also decided to rename my tags from the traditional “altdrag-0.1” Subversion syntax to semantic versioning, commonly used with Git.

git tag v0.1 altdrag-0.1
git tag v0.2 altdrag-0.2
git tag -d altdrag-0.1 altdrag-0.2 ...

Now you should be all set to push your repository to GitHub. Create your repo on GitHub, then add it as a new remote and push everything.

git remote add origin
git push -u origin --all
git push --tags

Now all you have left to do is to move over your binaries to the release tags that were automatically created.

There is one thing that GitHub is still missing; download counters. GitHub is targeting the developer community, where the number of stars your repo has is your indicator of how popular your project is, but many of us also build programs intended for ordinary mortals who don’t have GitHub accounts. I suggest that you build a page that is more user friendly that the GitHub repository page, and use a JavaScript-based analytic tool to track the number of downloads, and then try to funnel most of your users there (e.g. like this).

Update: GitHub actually has download counters, but the stats is only available through the API. E.g. search for “download_count” here:

I will still have to go back to Google Project Hosting from time to time during this transition. I still have lots of issue reports on Project Hosting that I intend to resolve there. And when I release the next version, I have to transfer the feature that checks if a new version has been released to GitHub.

It feels really good to finally move over to GitHub. Google Project Hosting was fun while it lasted, but I hereby pronounce it dead.

How to get a frame from a private YouTube video

July 3rd, 2013 1 comment

You sometimes follow a link to a YouTube video, but instead of watching a video, you are greeted by this familiar screen.


However, there is a trick to get a single frame from the video. The embed player fetches a single frame to display before you press the play button, and it is still available even though the video has been marked private. This is the url to it:

If the video was uploaded in 720p or higher, you can use sddefault.jpg to get a higher quality image. From what I can tell, there is no hddefault.jpg. The thumbnails displayed on YouTube are mqdefault.jpg.

Another issue that happens quite frequently is that sometimes videos in my playlists are marked private (usually music). Because YouTube removes the name of the track from my playlist, I have no idea what song it was, and that makes it really difficult to replace. I wish YouTube wouldn’t hide the track name in the playlist, it’s enough that the video is inaccessible.

When a video is blocked due to a copyright infringement, then YouTube sometimes displays part of the title. Not always, though.


If anyone has a consistent trick to get the video title when it’s private or has been deleted, please post in the comments.

Tags: ,

Keeping tabs on new YouTube Live events

May 5th, 2013 No comments

Hello YouTubers.

I’ve been looking for a way to get notified on new YouTube Live events somehow. I’ve been subscribed to the GData feeds for YouTube Live Events since Coachella, but it hasn’t worked that well since it’s not meant to be used directly by a feed reader for humans.

So I decided to code a quick PHP script that converts the feeds to something that is readable in most feed readers, where the entries link directly to the YouTube watch page of the event. As the GData API has four different feeds, featured, upcoming, live_now and recently_broadcasted, my script supports the same:

I find it interesting that the Google I/O keynote has been scheduled already, which will be live in 10 days and 17 hours: watch?v=jpQFnqpETy0. I’ll be there, will you? Let me know. =)

Another interesting thing in Feedly is that the service associates feed articles (the feed link) with likes on social media networks, so you will instantly get a measure on how popular an event is from a glance.

The featured feed only lists the latest 15 events, while the other feeds list 25 events, so some events that have completed may not be updated since they didn’t fit in the results. To fix this a backend service needs to keep tabs on events and check the event’s individual feeds if they have been updated, and so on. But this is only a quick hack and that would be too much work.

I’ve also posted the code for the script as a Github Gist: stefansundin/5519170. Put any suggestions either in the comments here or on the gist.

I hope you guys like it!

P.S. This may not be the time, but I want to add that XML processing sucks in most languages. SAX parsing is a pain and makes for ugly code (and it’s pointless if performance and size is not an issue). JavaScript had a small chance with E4X, but that has been abandoned by all browsers now. Bah. What you usually end up doing in these languages is that you just use regular expressions, which work surprisingly well. D.S.

Tags: ,