Archive for the ‘Nerd’ Category

Finally fixed mysql

Tuesday, October 16th, 2007

Took my sweet time but i finally fixed my mysql problem – at some point when I set my mail server up i screwed up the debian-sys-maint account. This meant that the init script kept failing and apt-get upgrade wouldn’t work.

If anyone else hits a problem with their debian-sys-maint account, you can find its password in /etc/mysql/debian.cnf. You can then mysql -u root -p and do something like:

USE mysql;
UPDATE users SET password=PASSWORD('password-from-debian.cnf') WHERE user='debian-sys-maint';
FLUSH PRIVILEGES;

Solved.

First bookmarklet :)

Friday, October 12th, 2007

Got somewhat tired of fighting off trac ticket spam and created my first bookmarklet to try and combat it. Now i have a button that closes a bug report in a tenth of the time it took me before :) Next step is to automate it so I can close 20 at same time…

javascript: (function(x) {
document.getElementById("summary").value="None";
document.getElementById("description").value="";
document.getElementById("reporter").value="";
document.getElementById("keywords").value="";
document.getElementById("cc").value="";
document.getElementById("resolve").checked=true;
document.getElementById("resolve_resolution").disabled="";
document.getElementById("resolve_resolution").value="invalid";
document.getElementById("resolve_resolution").form.submit();
})()

All it does is blank out a load of fields, sets the resolution to ‘invalid’ and submits.

A rant?

Friday, September 28th, 2007

Today someone popped in to #synce and declared “is it me or is synce pretty much useless”. The guy then had a bitch about how everything but synce worked (“BUT NO, NOT SYNCE”) and shortly after left.

How rude.

If the guy had stayed around a bit longer I could have told him about some of the issues Moto Q users faced and the magic incantations needed to work around oddities in that variant of Windows Mobile. If he had other problems, I could have helped. Instead he chose to flame.

As someone who has contributed a lot of hours to helping users of SynCE (and even submitted the odd patch) its both sad to think someone thinks bad things about the project / team and also frustrating and angering that someone could be so rude to people that have spent a lot of time working out how to make it work at all.

Conduit Network Sync

Sunday, June 10th, 2007

Who wants to see Conduit Network Sync in action then? Here it is! The quality is a bit crap – if you want to submit a better version of this vid you’d make me a very happy boy.

In it you’ll see both of my laptops. The bigger (and older) one I’ll call Fred. And (purely for the purpose of this post) the little one is Barney. The scenario is that Fred has all my data on and I want to get it to Barney and then keep both in sync. As you’ll see in the video, Conduit’s network code is getting to the point where its ready to take on this challenge.

You’re about to witness how data gets pushed from Fred to Barney (2 contacts and a note). You’ll then see how changes are made on Barney and how they get pulled back down to Fred (2 deletions and 2 modifications are made on Barney, and these are synced to Fred).

I really like how the change to the tomboy note I made on Barney is reflected on Fred immediately after the sync – i don’t have to reopen the note or anything! And with the change detection stuff thats starting to land.. imagine as soon as you change a note it could potentially be pushed back to a server or to your other machine!

The network code currently is split in to 3 main modules. Server.py is the bit that actually makes a dataprovider network accessible. It is implemented using Twisted XML-RPC and is a big PITA because it needs to be threaded. Client.py consumes a remote shared dp and plugs it in to the GUI. It is just a standard xmlrpclib client with a few special cases for relaying Exceptions. All the avahi helper foo is hidden in Peers.py.

The next major focus (other than working on the test framework to hammer the bugs out of the network code) is actually making it possible to set which dataproviders are shared from the GUI – at the moment it is hard coded to only share Evolution Contacts and Tomboy Notes.

For more info on this keep an eye out on the spec and the conduit home page.

Conduit 0.3.1 and beyond

Tuesday, May 15th, 2007

I haven’t written in a while so thought it would be a good idea to :D As the majority of my posts are about Conduit, I thought i’d start there.

Conduit 0.3 was released about a week ago. We’ve had about a 1,000 downloads and a few people have been gleeming with love for it. The past weeks have been quite mad, fixing bugs and enabling dps that are maturing. But 0.3.1 is the work of just two of us, with a couple of  3rd party patches and one contribution of a dataprovider. We’ve had lots of suggestions via the bug tracker, including N800 support. Yes, hadn’t thought of that one at all. Patches welcome, although in this case I think i’d prefer a donation of an N800 ;)

The most interesting change we are hoping to have ready for 0.3.1 would have to be the network sync stuff i’ve been doing. This would be packaged as an option, as its still early alpha and doesn’t have decent test coverage yet. It represents a Friday afternoon and weekend of me learning Twisted whilst waving my fist and cursing. Up until Friday the extent of my Twisted experience was running a Finger server inside Conduit, be warned. I’ve managed to inject a REST-ish Twisted web server into a DataProviderFactory as a server. Without going into any detail, the result of my efforts includes a successful two way sync of Tomboy to Tomboy between two Ubuntu Feisty laptops. It’s still flakey, but its getting there.

Criticise away at the poor design. You can also have a read at the code, though that is changing rapidly at the moment.

I am C++

Sunday, April 29th, 2007

You are C++. You are very popular and open to suggestions.  Many have tried to be like you, but haven't been successful
Which Programming Language are You?

Conduit 0.3

Saturday, April 28th, 2007

is coming soon. There should be a final release within the next week and then we can crack on with some big new toys for 0.4 – for me that means my network sync stuff…

Ahhh the memories

Sunday, April 22nd, 2007

Found out my old GCSE Electronics project today. A trip down memory lane.

It’s my first and only actual electronics project that i’ve built. Aside from those basic ones they showed you at school. As a youngster I was an avid reader of Everyday Practical Electronics so I was very familiar with PIC microcontrollers. When it came around to our final project I couldn’t resist making a kick ass alarm with one. It has four sensor zones (each with anti-tamper). A bellbox can be connected up with a siren, anti-tamper and a strobe light (though I only ever built the main controller). A keypad is used to arm and disarm the alarm (with a 4-digit code). An LCD shows the current state of the alarm and also doubles as a clock!

The firmware was written in an simple assembly dialect. It had a primitive mainloop that allowed it to control (in software) the pulsing of various outputs (internal buzzer, siren and strobe) whilst still responding to the keypad and updating the LCD.

I even had grand plans to build it into a “smart house”, using two free I/O lines to create a serial interface to a controlling PC.

A new XmlObject

Sunday, April 15th, 2007

I’ve become somewhat addicted to the SqlObject stuff in TurboGears. After reading and reading my book (and finishing my first skim through) I was left with an appetite to put it to good use. Obviously theres Conduit.net. But I ended up thinking about the state of the data types in conduit. I remember implementing the contact datatype, and it’s always been in a pretty sorry state. Your best hope for working with the data was to directly work with self.vObject, which I have zero-understanding of. On top of that, we want to use the OpenSync XML schemas in Conduit to aid interoperability with it, SynCE and to help with any networking layers we add (Conduit-web, Avahi/Twisted).

Could there possibly be an SqlObject equivalent for Xml? At first glance, yes and no. XMLObject would seem to be dead? You have to craft a parser, and there seems to be a compilation step. Another XMLObject seems better. It doesn’t seem to have the magic glue that SQLObject does, and you don’t seem to be able to create your own “model objects”. EaseXML is the closest to what I want, but it too seems dead?

Anyway, at the moment I am hacking away on my own implementation as bit of a learning tool. I’ve implemented the latest OpenSync Note schema in my objects and have something that looks like this:

class Note(xmlobject.XmlObject):
Body = MultiText(maxOccurs=1, minOccurs=1)
Categories = Categories(maxOccurs=1, minOccurs=0)
Class = Class()
DateCreated = DateTimeContent()
LastModified = DateTimeContent()
Summary = MultiText()
XIrmcLuid = StringContent()

And am able to produce some dummy output using Note().get_xml()

<Note>
<Body Language="Language" AlternativeTextRep="AlternativeTextRep">
<Content>Content</Content>
</Body>
<LastModified TimezoneID="TimezoneID" DateValue="DateValue">
<Content>Content</Content>
</LastModified>
<Summary Language="Language" AlternativeTextRep="AlternativeTextRep">
<Content>Content</Content>
</Summary>
<XIrmcLuid>
<Content>Content</Content>
</XIrmcLuid>
<DateCreated TimezoneID="TimezoneID" DateValue="DateValue">
<Content>Content</Content>
</DateCreated>
<Class>
<ClassValue>ClassValue</ClassValue>
</Class>
<Categories>
<Category>Category</Category>
</Categories>
</Note>

It’s all pretty dirty and basic right now. But it’s going pretty well.

Upgrades…

Saturday, April 14th, 2007

Just switched to lighttpd. Apparently it’s meant to be faster and a bit more lightweight than Apache. I was a bit hesitant, but having seen the results… wow. I could be imagining it but it seems lightning-fast.. So far i’ve not found any regressions in my blog, but i’m not sure how well i’ll be able to use subversion on here now.

My next site related thing has got to be the tag cloud, I have a backlog of posts that need tagging already…