samba.org joins Australian Internet Blackout

January 25th, 2010

This week many websites in Australia will be showing a “blackout” popup to protest the introduction of internet censorship in Australia. The Samba project, which has is roots in Australia, has joined in this protest on its website.

If you run a non-Australian site but you want to also show your support, then you might like to grab the hacked up popup code I used on samba.org.

For Australian sites, please use the official code. Hopefully something appropriate for non-au sites will be added there soon.

Cheers, Tridge

Another brilliant LCA!

January 24th, 2010

The last week at LCA has been amazing. It was a heady combination of great technical talks, geek hackery, fantastic social events and fun discussions.

I think the key to LCA is the amazing volunteers who run it. The combination of moving the conference between cities each year along with enthusiastic volunteers from the FOSS community makes for an incredible conference year after year.

Thank you to everyone who made LCA 2010 in Wellington such a success. If you missed it, then make sure you don’t miss next years LCA in Brisbane. The highlight of every year for me is LCA, and I am so grateful that we have such a great community of FOSS hackers in Australia and New Zealand to make it possible.

Cheers, Tridge

Samba4 DRS replication

January 11th, 2010

There has been a lot of progress recently in the development of the directory server capabilities of Samba4. I thought it would be worthwhile putting together a video that shows off some of those capabilities.

You can see the video here:

http://samba.org/tridge/DRS-demo/s4-DRS-demo.avi

(if you have a fast link and can play Ogg videos, there is a high quality version too)

The video shows a few things:

  • provisioning a Samba4 domain controller
  • joining a Windows 2008 R2 machine as an additional domain controller for the Samba domain
  • joining an additional Samba domain controller to the same domain
  • adding a user and seeing changes to the user propogate between the domain controllers

There is a lot more to do in Samba4, but we are making very rapid progress now. Thanks to everyone who has contributed to this effort!

Cheers, Tridge

PS: If you’ve having trouble playing the videos on windows, you may want to install the x264 codec. See http://sourceforge.net/projects/x264vfw/files/ for a downloadable codec pack for windows media player.

chocolate truffles!

January 10th, 2010

After having some fun building a coffee roaster with automatic power control and a python UI, my wife asked if I could help her with chocolate tempering for making chocolate truffles.

The result is a new use for pyRoast, and some great “techno truffles” !

See http://coffeesnobs.com.au/YaBB.pl?num=1263085051 for all the details and a short movie.

Cheers, Tridge

Fun with gdb

April 23rd, 2009

Ben Elliston just gave a great lunchtime talk at OzLabs on gdb. Ben has actually read the gdb manual, and in doing so has discovered a lot of neat tricks!

One that he missed in his talk is some cute stuff you can do with the p command (the short form for ‘print’). For example, say you have some process that is sending its output to /dev/null, but you want to see that output. That can happen with long running daemons that were started without debugging enabled for example. What you need to do is tell that program to change file descriptor 1 to point to a file, instead of /dev/null.

Let’s look at an example:


 lsof -n |grep null|grep 1u
 gconfd-2  17243     tridge    1u      CHR                1,3              5961 /dev/null

We see from lsof that gconfd-2 has pid of 17243 and is redirecting stdout (fd 1) to /dev/null. Now let’s attach with gdb, close fd 1, and re-open it on a file in /tmp


 tridge@blu:~$ gdb --pid 17243
 GNU gdb 6.8-debian
 Copyright (C) 2008 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
 and "show warranty" for details.
 This GDB was configured as "x86_64-linux-gnu".
 Attaching to process 17243

ok, we’re attached, now the dirty work:


 (gdb) p close(1)
 $1 = 0
 (gdb) p fopen("/tmp/gconfd.log", "w")
 $2 = 27041792
 (gdb) p fileno($2)
 $6 = 1
 (gdb) quit

Now if we check with lsof, we see the fd is now open on a log file


 gconfd-2  17243     tridge    1u      REG                8,1        0 12277473 /tmp/gconfd.log

You may ask why I used fopen() and not open(). First off, “w” is easier than remembering the right flag bits to open. Secondly, open may in fact be open64 or some other symbol, whereas I’ve found that fopen() always seems to work.

Notice also that I checked that fopen() gave us the right file descriptor back by calling fileno() on the output of fopen(). It will always give you the lowest available fd, which is usually right. If it isn’t the right one then use p with dup2() to move it to the right one.

Another use

This type of hack can also be used to solve the problem of unmounting a filesystem that has a process running with a file open on the filesystem read-write. The kernel doesn’t allow that, and the usual approach is to kill off all those processes. But what if you don’t want one of those processes to die? You can use the above trick to move the fd to point at a different filesystem. By using lsof to find all the ones you need to move, you can eventually mount the filesystem read-only, or even unmount it. This allows you to swap filesystems with running processes using them. You can minimise the effect on the processes by using gdb -x to script it (so it isn’t paused waiting for nervous fingers to type the right commands).

FOSS development can be taught

April 22nd, 2009

Last week Bob Edwards and myself finished the intensive part of the COMP8440 course at ANU. It was a lot of fun teaching the course, but it also answers something that I have wondered about for a while. Can FOSS development be taught?

Most things can be taught of course, but free software development is rarely taught. Instead hundreds of thousands of people have learned it by slowly absorbing the culture and the development practices from other people who already develop free software. I wasn’t absolutely certain that it could be successfully taught using more traditional teaching techniques in a university environment.

Last week gave me the answer very clearly – FOSS development can be taught, and indeed it can be taught very quickly. Most of the 21 students who took the course started off with almost no knowledge of what free software is. Only 2 of the students had any previous involvement with free software development, and many of the others had never used a free operating system before. The first day and a half had me a bit worried, as it was clear that many of the students were struggling, but by the end of the 2nd day the students were starting to understand. By the start of the third day I was starting to see the glow of understanding in many of their faces as they did the lab work and contributed in the discussions during the lectures.

By the end of the week the students were really enjoying it, and many of them had successfully contributed to a free software project of their choice. It was amazing to see them interacting with other developers from all over the world, and it was fantastic that they found the experience so rewarding.

Scaling it up

So, FOSS development can be taught. Now how do we scale it up? Bob and I have released all our lecture and lab notes, plus videos of all of the lectures on the course website under a creative commons license. We will also soon be releasing the scripts we used to setup the lab machines. So now I am looking forward to some other universities from other parts of the world adopting the course material and offering their own courses in FOSS development.

If we can make this a standard part of CS curriculums around the world, then the next generation of free software developers will be a bit better prepared.

Thanks!

Many thanks to everyone who made it possible to run this course. Special thanks to Bob Edwards and Henry Gardner for suggesting the course, and to Deanne Drummond for helping to get it all organised.

I’d also like to thank CASE, who were the official providers of the course. I love doing volunteer work for case, and this was the most enjoyable project I’ve done for them so far.

Finally, thanks to the students who took part. Taking a course like this when it hasn’t been offered before is always a bit of a stab in the dark. I hope you all got as much out of it as I did.