Jon Thysell

Father. Engineer. Retro games. Ukuleles. Nerd.

Month: September, 2009

Starting to port PunishPad from .NET to wxPython for some cross-platform writing via negative re-enforcement

With NaNoWriMo just around the corner,  I’ve decided to take up the work of porting my PunishPad software from .NET to wxPython. The first goal being to have the existing functionality available cross-platform. Fom there, the sky’s the limit.

I’ve started a new project on Launchpad, so go there to check out the new PunishPad site. So far there’s just some initial commits with the skeleton of the project and the GUI xml file. The original program isn’t that complicated, basically a text editor with a monitoring system that does mean things to you when you stop writing for too long, so I hope to get this port done fairly quickly.

But if you’re running Windows and can’t wait to get to writing, you can download the original version for .NET here: PunishPad 1.0.0.1 Setup [116k EXE].

/jon

Resuming development on Weight Tracker 2, now Weight Tracker ODS

Due to user interest (and to fix some rather glaring new bugs) I’ve resuming development on Weight Tracker 2, which I’ve now rechristened Weight Tracker ODS.

If you don’t know, WTODS is the weight tracking spreadsheet I created so that I can manage my weight following the Hacker’s Diet while using OpenOffice.org. You can find more information about it here.

Well now I’ve got the whole thing up as a project on Launchpad, go check out the new Weight Tracker ODS site. I’ve just finished the rather tedious process of manually importing the revision history for each successive version into launchpad’s version control system. Tedious because I wasn’t using version control before, just keeping snapshots ofeach release. I wanted to make sure that I didn’t “lose anything” by just starting with the most recent version.

But now that I’ve seeded the project, I can get to work on the next version. I hope to get the obvious bugs fixed, then clean out some of the the overcomplicated logic that slows it down. And of course, graphs. 🙂

/jon

Pawsgaard complete and uploaded

It’s been a couple weeks in the making, but I’ve finally finished and uploaded my latest piece of writing: Pawsgaard.

It’s a short story, a little over 16,000 words, inspired by the long-standing tradition of children’s stories where animals speak. I introduce the mice of Guineawick, and the new stranger in town, the warrior-rabbit Sven Pawsgaard.

Please read it. I appreciate any and all feedback!

Enjoy,

/jon

Setup a persistent local DNS cache on Ubuntu Jaunty with pdnsd and OpenDNS

Discalimer: I take no responsibility if you screw up your computer or can’t connect to the internet after following this! If you do mess things up, do what I do, head on over to Ubuntu Forums and ask for help.

What:

This howto will show you how to setup your Ubuntu Jaunty 9.04 machine to use OpenDNS to resolve DNS names, and keep local cache that will survive machine reboots. It’s a modified set of instructions that I first posted here.

Why:

There are several reasons why you’d want to to this.The quick one-liner: faster, more reliable web browsing. For a little more detailed response read on, otherwise, you can skip straight to the How below.

Need more info, okay. First, it might be a good idea to know what DNS is. Basically, it’s the address service that translates the domain google.com into it’s IP address 74.125.45.100. People generally find it easier to remember domain names than IP addresses. But the computer needs the IP address to load websites, so when you make a request for any files on google.com, your computer asks a DNS server for Google’s IP address. 99.9% of the time, your ISP provides DNS servers for your computer to use, and you don’t have to think about it.

But this address lookup takes time. Over the course of loading just one file, you might not notice it, but when browsing a web page, you’re probably loading dozens of files (images, scripts, etc.) This can mean lots of DNS requests if the files are on different servers. And ISP-run DNS servers don’t always have the best track records on being the fastest or the most reliable. Ever have your router tell you that you have an internet connection, but you can’t get to any websites? Usually, it’s because the ISP’s DNS server is having issues. So yes, technically your computer can access the internet, but you can’t really use it, unless you happen to know the IP addresses of everywhere you want to go. But, most of us get to Google through google.com, not by remembering 74.125.45.100.

So why use OpenDNS? Because generally it provides a faster, more reliable DNS service than what your ISP service provides. OpenDNS lets you setup filters, and much, much more. And why a persistent local DNS cache? Because even requests to OpenDNS take some time. And most websites rarely change their IP address, so why constantly lookup an address that isn’t changing? By using a local cache, your computer won’t have to keep asking the DNS server for addresses, because it will remember addresses that you’ve already been to. Sure, every now and then your computer will need to ask a real DNS server for an address, like when you go to a new website, or even occasionally for sites you visit often, just in case their IP address has changed.

Otherwise, even if your computer only remembers an address for 15 minutes, that’ll improve your browsing experience significantly. So, ready for faster browsing?

How:

Okay, so we’re going to install the local DNS server called pdnsd, and a support package called resolvconf. Pdnsd will be responsible for remembering DNS addresses, and resolvconf is responsible for letting your computer know to use pdnsd.

In a Terminal window, run the following to install both resolvconf and pdnsd in the correct order:

sudo apt-get update && sudo apt-get install resolvconf && sudo apt-get install pdnsd

When prompted during the pdnsd install, select “Use resolvconf”. Then run the following to create a config file for resolvconf:

gksudo gedit /etc/resolvconf/run/interface/opendns

In the new document, paste the following so that resolvconf will know how to use OpenDNS:

nameserver 208.67.222.222
nameserver 208.67.220.220

Finally save the document, exit gedit, and run this command in the Terminal:

sudo resolvconf -u

Congratulations, welcome to faster browsing. To check that everything is working, try the following:

dig google.com

Verify that the SERVER line shows 127.0.0.1#53(127.0.0.1), which means you’re pointed at your local cache. Look at the Query time, which should show how long it took to ask for google’s IP address from OpenDNS the first time.

Now, if you run that command again:

dig google.com

You should see a significant time drop, like Query time: 0 msec. That means that everything is working, that instead of asking OpenDNS for the IP address, pdnsd responded with the cached information, which took no measurable time.