Colin Robinson

Just another guy on the internet

IPv6 Subnet Calculator

I wrote a tool to organize subnet addressing for IPv6

Demo | Source Code

A little about IPv6

An IPv6 address is 128-bits and commonly represented as eight colon separated groups with each group consisting of four hexadecimal digits. For the general unicast address format, the first 64-bits are used for routing and the second 64-bits are the interface identifier (RFC 4291). Of the first 64-bits, the first 48 are used for regional routing and the next 16 are used for subnetting. Thus for practical subnet planning, you can assign blocks from /49 to /64. My calculator only lets you select a prefix up to /63 because if you can’t subnet a /64 block, you can only assign it.

How to use this calculator

Step 1)

You can enter the network IP to be subnetted as a full address or in the shortened form with leading zeros removed and consecutive groups of zeros removed.

Either 2001:09fe:000a:0000:0000:0000:0000:0000 or 2001:9fe:a:: is fine.

Step 2)

Enter the number of subnets you want created at each level and press “Add Level.” Example: your university has 10 colleges, each college has 3 buildings, and each building has 8 departments. Add 10, then 3, then 8.

Step 3)

Build it! Then use the + button to show / hide subnets. The position string on the left hand side should help you identify who the network is subnetted to (eg. the subnet in position 4.2.3 is the 3rd department in the second building of the 4th college).

Step 4)

Post questions in the comments and bugs on GitHub.

How to make Chrome use Deluge for magnet links in Fedora

Sep 2014 update: This was written for Fedora 17. Apparently the desktop file has been renamed to deluge.desktop (the sane choice).

The three things you need to know:
1) Unlike Firefox, Chrome uses xdg-open to choose the default program to open a file.
2) You can set the default application for each type by using xdg-mime.
3) The Fedora desktop file for Deluge is fedora-deluge.desktop and not deluge.desktop.

xdg-mime default fedora-deluge.desktop x-scheme-handler/magnet

How to install Compiz on Fedora 17 XFCE Spin

Let’s just be clear, this is not for the faint of heart.

Why isn’t Compiz in the Fedora 17 repos?

Compiz is a replacement window manager for the GNOME window manager called Metacity. When GNOME 3 came out last year, they replaced Metacity with Mutter. Apparently there are library incompatibilities that prevent Compiz from replacing Mutter. I didn’t look into the details because we don’t care about GNOME issues, we’re XFCE users!

I’ll also note that Red Hat is currently reviewing the situation and might bring Compiz back. Who knows. I for one think it’s silly to drop a package just because it doesn’t work with one desktop environment out of many.

Continue reading “How to install Compiz on Fedora 17 XFCE Spin” »

iPad and iPhone Web Frameworks

Sencha Touch

This is the gold standard of iPad web frameworks. It’s amazing (and free!), check out the kitchen sink demo.

Project Page

Continue reading “iPad and iPhone Web Frameworks” »

Draughts, my first android game

Made with Unity3D, coded in C#


How to free up space in rootfs on Arch Linux

Is your rootfs partition at 100% and causing you problems?

I’ve been hovering around 95%-100% for a few weeks now. Being at 95% is fine, but 100% can cause all kinds of problems. I was testing a form on my local web server and couldn’t do file uploads because “the disk was full.” I was writing code and my editor couldn’t save the file because “the disk was full.” Its frustrating because you have hundreds of free gigs where you’re saving the file, but because rootfs is full, you can’t!

I’ll start by showing you the output of df

$ df
Filesystem     1K-blocks     Used Available Use% Mounted on
rootfs          10209220  9625988     71164 100% /
/dev             4055116        0   4055116   0% /dev
run              4058036      252   4057784   1% /run
/dev/sda3       10209220  9625988     71164 100% /
shm              4058036      796   4057240   1% /dev/shm
tmpfs            4058036     3160   4054876   1% /tmp
/dev/sda1          99590    34166     60205  37% /boot
/dev/sda4      449789792 23726068 403549860   6% /home

Not good, but its my own fault. I only allocated about 10g to /dev/sda3 when I setup the OS. I should I have predicted that I would need more.

The real solutions is to boot to a livecd and resize /dev/sda3. This can take a long time, break your grub install, and cause other headache inducing effects.

Here are some tricks I’ve picked up to get your rootfs down from the dreaded 100% to something you can actually work with.

Continue reading “How to free up space in rootfs on Arch Linux” »

Code Review

Where I work, we have a lot of new developers and people still learning the languages. When learning a language, being able to get feedback on your code is an invaluable learning asset. It lets the more experienced programmers help teach the newer ones.

Most code review software is designed for pre-commit comments. A reviewer looks at the code before it gets added to the version control system and then approves or denies the changes. This is obviously vital for large projects involving multiple developers, but what about small shops where people work mostly independently and on different projects? What if you don’t have the resources or the need for an extensive review process and would rather casually browse your colleges code to add constructive criticisms or notify them of best practices which they might be unaware of?

To me the ideal tool will interface with subversion and allow reversion specific and line specific post-commit comments. I want to be able to browse our source code whenever I feel like it, write a comment about a specific line, and then have the author notified of the comment.

The PeerReviewPlugin for Trac looked like a winner, until I read this review

PeerReview Plugin for Trac

PeerReview Screenshot

In my company, we looked briefly at the “peerreview” plugin on TracHacks, and were very disappointed with it.

It seems obvious to us that a code-review plugin would naturally default to assuming that an entire Subversion commit should be code-reviewed. Unfortunately, the peerreview plugin forces you to manually identify the lines of code that you want to review. It doesn’t even give you hints in which lines might have changed with a particular commit, which means that if you don’t enter the line that changed carefully, you could end up re-reviewing the same lines of code over and over.

It still looks promising, and I don’t expect to find an out-of-the-box solution that is perfect for my specific situation. Right now ReviewBoard is looking up and I could always modify the PeerReview plugin to suit my needs (hooray, opensource). Please, leave a comment about how you and your company do code review. What code review systems have you worked with? What other solutions might I have passed over?

How do you measure productivity?

How do you measure your productivity while writing code? Judging a program’s success by lines of code (LOC) is like judging how successful an airplane is by its weight. Consider a more modern approach from Agile development called Weighted Micro Function Points.

Permalinks for Hierarchical Custom Post Types

June 2013 update:

This plugin is not actively developed. If you want to use this plugin with the latest version of WordPress, you should reference the source code on github and hopefully that will help you develop your own solution. I’m also open to pull requests.
End of update

I wrote a WordPress plugin that lets you have a hierarchy of custom post types where the post types are different. This is the plugin here. I see a few people marked the plugin is broken, it works, but its impossible to figure out how without instructions. I don’t know why the descriptions and stuff I added don’t show up on the WordPress site, so I’ll provide instructions and support on this blog.

Its worth pointing out that I made this other developers. If you’re looking for a plug and play solution, this isn’t quite it. But if you’re a developer with the same problem, I’ve done the heavy lifting for you.

Continue reading “Permalinks for Hierarchical Custom Post Types” »

Setting up a LAMP for local development on Arch Linux

Just installed Arch Linux (after leaving Ubuntu due to Unity/GNOME 3). Now I need to setup my development environment. This should work for most distros, not just Arch. I want Apache, MySQL, PHP, phpMyAdmin, and SSL. Because its easy and I’m lazy, we’re going to setting up XAMPP. As always, first reference the wiki (Xampp – ArchWiki).

The steps break down like this:

1) Download the latest version from here.

2) Extract and move to /opt/

# tar xvfz xampp-linux-*.tar.gz -C /opt

3) Set passwords for MySQL and stuff

# sudo /opt/lampp/lampp security

4) Only listen for local connections
– Open /opt/lampp/etc/httpd.conf
– Change “Listen 80” to “Listen”

You could stop here, but I’m going to make a virtual host (with SSL).

Continue reading “Setting up a LAMP for local development on Arch Linux” »

Previous Posts Next posts