Skip to content

{ Category Archives } Ideas

Proposals which I’ll probably never get around to implementing.

CFXS free at last!

Those who either know me personally, or have read more of my blog might remember my final year honours project. The project was to build a budget 8 line USB channel bank. Originally, I had hope to commercialise the project, the prospects looks good until two competing products where released into the market for only a slightly higher cost point. I had always hoped to make the system a piece of open hardware, but both the Uni rules and trying to commercialise it had made that difficult.

As a strange coincidence, David Rowe, a guy doing open source embedded Asterisk hardware, lives less then 15 minutes walk from my home. His main motivation behind this open hardware is to try and bring technology to the developing world in a way which empowers them instead of making them dependent on external supplies. We got chatting at a local LinuxSA meeting and he was partly inspired by my device to start the $10 ATA project. (David also has a bunch of other cool projects like his own electric car and trying to go off the grid).

Sometime during that, I removed the access controls on the subversion repository that I had used for the CFXS so that David could look at it. It turns out though, that I never told anyone else! So that is the main aim of this post, to tell you all where you can get a copy of source files for my honours project.

The subversion repository is located at the following url You can check it out using the following subversion command,

svn co cfxs

So why not check it out and build your own? I have some left over components which I’m happy to dole out if you agree to actually use them in a useful way. Just send me an email.

David (hopefully I’m not putting words in his mouth here) is hoping that we can use this device in combination with the OLPC XO laptop to bring telephony to a whole village. The mesh networking wireless would be ideal for doing VOIP, while my 8 port CFXS device and some very cheap handsets can give a bunch of people “real” phones. The system can also be made very low power as both the OLPC and the CFXS device can be in power down modes while nothing is happening.

So I guess we will see what happens in the near future, it seems like it’s an exciting area of FOSS to be involved in. Sadly, I don’t have much time to work on any of this.

Cool Python, Swaping two variables

Some people say “you learn something new everyday” or something like that. Today someone on #python showed me a cool trick I never would have thought of on my own.

Often there is a time when you want to swap the contents of two variables. The most popular way to do this is using a third variable as shown below:

temp = a
a = b
b = temp

This looks sucky and doesn’t really express very well what you want to do. A much better way to do this in Python is with the following magic line:

a, b = b, a

Doesn’t that look so much better? And it is very clear to anyone who has used Python before what is going on. To think, I have been using Python for about 7 years now and never thought of doing that.

Just thought I would share this tidbit.

Network Manager – OpenVPN, DNS Domain support

My new job uses OpenVPN to provide secure access to their private network. They also make heavy use of the dns domain search so that you only have to type “wiki” to get to their wiki. It turns out that the Open VPN plugin for network manager ignores the “dns-domain” setting, this means I have to manually change /etc/resolv.conf (to add the needed “search” section) after every connection.

This annoyed me enough that I have developed a small patch for the plugin which fixes support. I’ve submitted the patch to Ubuntu, hopefully it will get included soon. In the meantime I have attached the patch and the deb for Ubuntu Gusty.

Edit: This patch has been included in Ubuntu Gusty!

Network Manager – Autostart VPN

UPDATE: Dorian Scholz writes in the comments; There is now a command line tool nmcli which can interact with the nm-applet and Network Manger directly. Connecting to a VPN is as easy as: nmcli con up id NAME_OF_THE_VPN

Recently I started a new job, to get my laptop on the network I first connect to their wireless LAN and then VPN into the network. Network Manager makes this fairly easily, it will automatically try and associated with the wireless network, I then have to start the VPN connection manually.

This wouldn’t be a problem if I only had to do it once or twice a day. However, wireless being wireless, drops out 4-5 times a day. While, Network Manager will automatically reassociated, I have to manually reconnect to the VPN which is a pain.

To fix this I have developed two small scripts, the first is a small shell script which will automatically call a command when connecting to certain wireless networks (/etc/NetworkManager/dispatcher.d/02runcmd). The second is a little Python script which will tell Network Manager to connect to a VPN from the command line (/usr/local/bin/nm-startvpn). When you combind these two, you get auto VPN connection goodness, yay!!

If people find this useful I might put together a config utility and properly package them.

Exotic VPN support!

It would be cool is someone added support to network Network Manager for the following “VPN”s.

  • nstx or iodine, tunneling over DNS
  • ssh, tunneling over ssh
  • http, tunneling over that “wonderful” web protocol

It would be also good if we could enter proxy servers for particular locations – in many locations in Australia they are mandatory.

Eagle for PCB

PCB Board for my Honors Project

For the last 3 days I have been working on routing the Honours project. For the design I use CadSoft Eagle. However, it’s been annoying me quite a bit.Here is just a shortlist of things,

  • You can’t change pads unless you modify a library. At my Uni they use a rivet system for doing plated through holes, these means that the holes and pads have to be a certain size as you have to solder the rivets to the pads. This means that you often want to change a hole and pad for a particular instance of an IC so that it can have a rivet put in it.
  • Polygon Pours can not be put in “outline” mode. This makes it quite annoying, as you want to put in the GND plane first so it removes all the GND airwires, but then you are constantly using the “rip-up” command so you can see where you are putting signals.

I’m thinking of moving to gEDA because it’s free software, I would no longer be restricted with what I do. However, it’s quite hard to use and doesn’t come with the extensive libraries that Eagle has.

I’m thinking that I’m going to write a ULP script which converts EAGLE stuff to the format used by gEDA. We’ll see what happens.

Graphical Programming?

I spent today at a “conference” called NI Days, which was really just a day long pitch by National Instruments about their LabView software. It was however quite interesting, the two parts which caught my attention where the “graphical programming” and the “dll importer”.

The graphical programming worked by creating graphical boxes (which represent functions) and then wiring input and output together. The system looked like a very good for doing parallel and concurrent systems.

The problem with our current programming languages, like Python is that it doesn’t scale well, both in performance and code development time, to multiple processor and concurrent systems. Things like stackless and greenlets are attempts to make this much easier.

The problem with these “solutions” is that when using their system is then very hard to visualise where data is going and what critical paths exist (IE Where the system will block waiting for data). Graphical Programming would have a real advantage in this area. In the world of human resource scheduling, visualisation processes have long been used in the form of Gantt charts (or Gnat chart as my brain keeps making me type).

Another problem with these systems is they are based around message passing. When you want to move around and process large blocks of continuous data (such as when you are doing Software Defined Radio – which would otherwise fit perfectly into the blocked based concurrent systems) this sucks. The main reason the systems are based around message passing is because it gets rid of the problem of locks. Locking is the cause of most headaches in concurrent systems and involves horrible corner cases like “thread a has lock alpha and wants lock beta but thread b has lock beta and wants lock alpha”. By having data “flow” out of one system into another via a queue like structure (probably a circular queue for most systems) means many of these locking problems go away (as a queue is inherently lock safe).

The other thing which caught my eye was the “dll importer” which look suspiciously like how the ctypes code generator works. The importer uses the C header file to figure out how to call C code in a DLL. It then “automagically” creates the graphical elements which you then places and wire like anything else in LabView.

I think you could easily build a basic graphical programming language very quickly using some type of existing canvas (maybe Dia, Inkscape or wxFloatCanvas). It’s then just a matter of doing a ctypes (which uses FFI and gcc-xml) like system to automatically generate the graphical elements for currently existing code. You would probably want to output run on something like the Erlang VM (Erlang is a cool language with a syntax designed by retarded monkeys) so you have access to microthreads. The result would be something which should be easy to use, scales well and already has a huge amount of code which can be used.

Actual implementation is left up to the reader as I just don’t have the time to do it :/. I need to concentrate on Thousand Parsec, I may come back to it at some later date, but I doubt it. If you do end up doing something – please send me a line.

Swap Nice?

It would be nice if you could say “swap out these applications at a last choice”.

The main reason for this is that I use the deskbar application quite a lot. I would really like the system not to swap it out so that it is always really responsive.

Searching google doesn’t turn up anything all that useful. I did recently find memlockd which would be quite useful for Servers.

Gnome Improvements

Here are a bunch of things which I would love to see added to gnome to make it much easier for me to use.

  • Add the ability to drag around the items in the task bar like you can in the tabs in the browser
  • Add the ability to lock panels so you can’t drag them about

    This is needed because when the computer gets loaded the mouse interprets the clicks as click and drag. It is also a problem were people aren’t skilled with the mouse (IE hold and drag the item). The means panel ends up getting dragged about. I have the same frustration under older versions of windows.

  • Network applets should display information about the connection status in tool tip (IE IP Address/essid/etc)

    Everything else seems to display useful information. The CPU applet displays the current CPU speed. The laptop temp applet displays the current temperature. Why doesn’t the network applets show the current configuration?

  • Memory improvements, I know gnome is already working on this but 256MB is painful to use.

    Recently the 512MB stick of ram in my laptop died. This means that I’m currently restricted to 256MB of ram. Gnome positively sucks with this much ram. This is annoying because XP runs quite nicely with this amount.

    Evolution and Epiphany are the to biggest hogs but all the other little things really add up. Disabling the SPAM filtering in Evolution seems to have make a fairly big difference.

    Not to mention my video card has to steal main memory (It’s a Intel i855, I have to restricted to 32mb).

    To make matters even worse I have a very very slow hard drive (4200rpm, 1.5 Inch drive) this makes swapping even more painful then most people.

  • Disk access improvements, things seem to access the disk a lot more then needed.

    My hard drive seems to do a lot of work even when not swapping. Doing a “echo 1 > /proc/sys/vm/block_dump” shows that a lot of things are accessing the hard drive when they are idle or not doing anything.

    The hard drive is one of the biggest consumers of battery life in the laptop. Reducing the accesses would make everything faster. I guess this is counter reducing memory usage however.