Ubuntu 16.04 LTS First Impressions

I've been an Ubuntu user for a while. Currently I use 14.04 LTS on my main laptop. Last month 16.04 LTS came out, I put it on a spare laptop that's currently sitting in my media center connected to my TV. The laptop is a stock Asus N56VJ. It has a TP-LINK WN722N USB wifi dongle, and a wireless keyboard attached.

Package Manager Issue

After installing, I couldn't install any applications that weren't in the default repositories. Chrome, etc just wouldn't install using the software manager. I ended up installing some packages and their dependencies using dpkg -i. I'm wondering how a bug like this was shipped, possibly a rush to get this release out the door?

Hardware Support

Hardware support is about the same as other releases of Ubuntu - good but not great. The Atheros wifi drivers aren't as fast as they should be, and I cannot get sound from the HDMI port. After messing around with configuration files for a few hours I gave up on both of these issues.

On a more positive note, I did manage to set up a wifi repeater using the network manager app. It worked right with no messing around. I connected a USB wifi dongle to an external network, and selected 'shared with other computers' along with 'hotspot mode' for the internal wifi chip. Previously in similar situations I would have had to set up hostapd for an AP, dnsmasq for DHCP/DNS, and iptables for NAT. One quirk I found while doing this was that the network manager app would disable the save button without any explanation if the wifi password wasn't long enough.


This release is about the same as other recent Ubuntu releases, nothing special. It's not any faster and the user interface isn't any better. That being said, it is better than Windows and most other distributions I've tried, so I'll keep using it.

Speeding Up Line Drawing on HTML5 Canvas

A while ago (maybe a year) I made a crappy little game called Space Cave. It's nothing special, mainly just programmed it to learn about the HTML5 canvas and how to interact with it using Javascript + jQuery.

The game basically draws a bunch of lines and the player cannot let a spaceship come into contact with the ends of the lines.  The initial version was super slow and choppy, so I recently decided to speed it up a bit.

Double Buffering

Double buffer by drawing changes to a canvas created in Javascript, then draw that canvas on the main one.  This improved smoothness quite a bit.

Clearing the Canvas

There is a lot of conflicting information about this, likely just from differences in browsers. From what I've read, there are two ways to clear a canvas: clearRect(...) and resetting the canvas width. Some sites say never reset the width, some say it's alright but not ideal, some say it's the best way.

In the end I just went with clearRect(), it works fairly quickly on all the browsers I've tried. Resetting the width honestly seems like a dirty hack.


Instead of setting a timeout of 1000/fps to call a draw method, some websites say simply calling this method is faster. I honestly didn't do much of a scientific test, but when I first made the game it seemed that setTimeout was smoother. Now when I go back and use this method it does seem a bit smoother. Possibly a difference in the browser versions? It's a mystery :)

Using Duplicity for Manual Backups In Linux

I use duplicity and an external USB drive to do simple and secure manual backups.

How to Backup

  1. If you're on Ubuntu, skip this step. Duplicity is installed with the default desktop environment. Otherwise, install duplicity.  It's included in most package managers.
  2. Put all of your stuff that you'd like to backup into one directory. In the example below, I used /home/profit/my_data/
  3. Create a temporary directory. In the example below, I used /home/profit/tmp/.  This is required to prevent out of space errors while backing up.
  4. As a normal user, run this command. Replace /home/profit/my_data/ and file:///home/profit/to_hdd/ with your directories.  The file:/// part is the destination.
    duplicity full --tempdir /home/profit/tmp/ /home/profit/my_data/ file:///home/profit/to_hdd/
  5. Type a pass-phrase when it asks.
  6. If it finished with no errors reported, congratulations you've backed up your stuff.  You'll have a directory full of encrypted archives.

How to Restore

Always test that your backup works :) Here's the command to run. Make sure that you're either logged in as root, or as the same user that performed the backup.

Replace file:///home/profit/to_hdd/ with your backup directory and /home/profit/tmp_restore/ with your destination.

duplicity restore --tempdir /home/profit/tmp/ file:///home/profit/to_hdd/ /home/profit/tmp_restore/ 

Choosing Blog Software: Blogger vs Wordpress vs Custom Built

I considered a few platforms for this blog.  My requirements are:
  • Reasonably secure
  • Easy to update
  • Easy to port data if I decide to leave
  • Low cost
  • Visitors should be able to comment


Self Hosted

I have access to a PHP/MySQL host, and installing Wordpress is easy.  The deal breaking issue is that I simply don't trust it to be secure.  Even when kept up to date, I've had off-the-shelf content management systems hacked on websites I've maintained.  Won't be going down that road again.


Wordpress.com offers free hosting. They charge way too much to have a custom domain pointed at your blog though.

Custom Built

I seriously considered this option. I'm confident that anything I programmed would be simple and bare bones.  This would limit many security related problems. I'm very aware that nothing is bug free though :)

There is also a lot of time involved in the creation and maintenance of a custom blog.  A few years ago I had a personal blog programmed in Java using Spring MVC, it took a lot more work to program and maintain than I was willing to put in.  I'm the kind of programmer who loves to refactor and redesign code, it took time away from the actual purpose of the blog.  After about a year, I was tired of it.


For now, I'm using Blogger. It meets all of my requirements fairly well. Nothing is set in stone though. If I decide to leave, it shouldn't be to hard to export my data either using the Atom feed or the export blog feature.

First Post

Hello! This blog will be a kind of a hub for projects I'm working on.