Search Results: "mt"

24 May 2008

Ondřej Čertík: Ubuntu Developer Summit in Prague

Last weekend I was at FOSSCamp. Since I live in Prague I wanted to go to Ubuntu Developer Summit (UDS) each day, but unfortunately I had some exams, so I only went on Wednesday and Friday.

On Wednesday I first met Lars Wirzenius:


we agreed to go to pub in the evening. Then I did a little work, there was quite a nice view from the window (Prague castle on the horizon):



and I went to the #ubuntu-devel-summit IRC channel and pinged Scott Kitterman, whom I new from the Debian Python Modules Team (DPMT), but didn't know how he looks like. We met and once I knew Scott, it was easy to get around, so he introduced me to Steve Langasek (pronounced Lang ek). We agreed to go to pub as well. Steve lives in Portland, OR, where I spent the summer 2005 and Scott is from Baltimore where I spent the summer 2006.
Then I also met Riku Voipio, Martin B hm, Christian Reis (whom I asked if it's possible to support Debian unstable on Ubuntu Personal Package Archives and he said that it will probably happen, so that's really cool -- I also offered my help with this) and others, so in the end, there were 14 of us going to the pub, so I chose again the same pub as with the FOSSCamp people and it seems it tasted good again:




Notice the sv kov na smetan above, my favourite meal. Good choice Scott. :)





Ok, that was on Wednesday. On Friday I arrived at around 3pm, looked at the schedule table and noticed that Matthias Klose should be at UDS too, so I started IRC and pinged him. Fortunately, Emilio Pozuelo Monfort, whom I know from DPMT as well, replied first so we met, it was cool and he showed where Matthias is. I am very glad I met him, so we discussed python-central and python-support packages and why we have them both, also with Scott later on.

When I was waiting for Matthias, I sat next to Nicolas Valc rcel, started my laptop and begun looking at some SymPy bugs and Nicolas noticed that and said -- "You are developing SymPy?", I said "Yes.", flattered. And he showed me a bug with plotting and Compiz, so we immediately reported that to pyglet.

In the evening people continued to some kind of a party, but unfortunately, I was already going to some other pub.

Overall, even though I was there for only two afternoons, it was just awesome and I utterly enjoyed meeting all the people I knew from mailinglists and IRC.

Russell Coker: IPSEC is Pain

I’ve been trying to get ipsec to work correctly as a basic VPN between two CentOS 5 systems. I set up the ipsec devices according to the IPSEC section of the RHEL4 security guide [1] (which is the latest documentation available and it seems that nothing has changed since). The documentation is quite good, but getting IPSEC working is really difficult. One thing I really don’t like about IPSEC is the way that it doesn’t have a device, I prefer to have my VPN have it’s own device so that I can easily run tcpdump on the encrypted or the unencrypted stream (or two separate tcpdump sessions) if that’s necessary to discover the cause of the problem). I’ve got IPSEC basically working, and I probably could get it working fully, but it doesn’t seem worth the effort. While fighting with IPSEC at the more complex site (multiple offices which each have multiple networks, and switching paths to route around unreliable networks) I set up an IPSEC installation at a very simple site (two offices within 200 meters both with static public IP addresses, no dynamic routing or anything else complex). The simple site STILL doesn’t work as well as desired, one issue that still concerns me is the arbitrary MTU sizes in some routing gear which (for some reason I haven’t diagnosed yet) lose packets if I have an MTU over 1470 bytes. So today I set up a test network with OpenVPN [2]. It was remarkably simple, the server config file (/etc/openvpn/server.conf) is as follows:
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
comp-lzo This means that the IP address 10.8.0.1 will be used for the “server” end of the tunnel, and 10.8.0.2 is the “client” end. The secret is stored in /etc/openvpn/static.key (which is the same on both machines and is generated by “openvpn --genkey --secret static.key“). The client config file (/etc/openvpn/client.conf) is as follows:
remote 10.5.0.2
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret static.key
comp-lzo Then I enable IP forwarding on both VPN machines, open UDP port 1194 (the command “lokkit -q -p 1194:udp” does this) and start the daemon on each end. The script /etc/init.d/openvpn (in Dag Wieers package for CentOS 5 - which I believe is the standard script) will just take every file matching /etc/openvpn/*.conf as a service to start. The end result is a point to point link that I can easily route other packets to, I can easily get dynamic routing daemons to add routes pointing to it. Nothing like the IPSEC configuration where the config file needs to have the IP address range hard-coded, I can just add routes whenever I want. This isn’t necessarily going to be the way I deploy it. The documentation notes that a disadvantage is “lack of perfect forward secrecy — key compromise results in total disclosure of previous sessions“. But what gives me confidence is the fact that it was so easy to get it going, if I have problems in adding further features to the configuration it should be easy to debug. As opposed to IPSEC where it’s all complex and if it doesn’t work then it’s all pain. Also I tested this out with four Xen DomU’s, two running as VPN routers and two as clients on separate segments of the VPN. They were connected with three bridge devices. I’ll blog about how to set this up if there is interest.

23 May 2008

Chris Lawrence: CECB mini-review: LG/Zenith DTT900

To continue the CECB mini-review series, I picked up an LG/Zenith DTT900 at Circuit City in Southaven this evening with one of my two digital converter box coupons (and $24ish of my hard-earned money at Sam’s Town’s blackjack tables). With essentially the same setup and conditions (same television and el-cheapo VHF/UHF indoor antenna) as the RCA DTA800B tested before, the initial channel scan found the same 17 channels/sub-channels. However, the Zenith’s ability to manually add channels meant that I was able to add WMC-DT/NBC 5 (RF channel 52) and with some fiddling get a reasonably stable signal, something I was unable to accomplish with the RCA—this isn’t that surprising, since the Zenith is based on LG’s ATSC digital tuner chipset, which is known for its superior reception capabilities over most other silicon. In addition, other channels (WHBQ-DT/Fox 13, WPTY-DT/ABC 24, and WLMT-DT/CW 30) that were less-than-stable with the RCA were rock-solid with the Zenith. Bear in mind that WMC is running on a different frequency (and lower on its tower) than it will after the transition is complete in nine months, so indoor antennas in Shelby County at least should cope better with WMC when it is back on VHF channel 5. The built-in guide is a little weaker than that included on the RCA model; the Zenith’s only shows program data for one channel at a time. The Zenith, however, has more functionality accessible from the remote control, including a “favorite channels” feature that would be useful for the compulsive surfer who isn’t interested in switching past the news and weather loops on 3–2 and 5–3 when doing the Letterman/Leno (or Conan/Craig) shuffle, and a sleep button. I also thought the Zenith’s menus were a little more polished and better organized. On the antenna front, the Zenith, unlike the RCA, does not provide an attachment for digitally-steered “SmartAntennas,” which may be a consideration if you already have one of these (they are apparently uncommon at present) or have hard-to-tune channels in multiple directions which might benefit from this high-tech solution. The Zenith’s better signal-handling may reduce the need for a fancy antenna, however; either way, you should probably check out TVFool’s antenna aiming guide or the somewhat less-friendly CEA/NAB-sponsored AntennaWeb website to determine what sort of antenna solution is going to be necessary for you before spending money on one. The only real problem I encountered in testing was that the “zoom” setting seemed to behave oddly; at first, letting it decide on its own seemed to work OK on some channels, but then I ended up with some bizarre “squeezed” pictures on several HD channels. Expect to manually fiddle with the zoom setting when channels switch between showing native 16:9 and pillarboxed 4:3 programs. Those who use closed captioning will also find that it seems to forget the CC setting when you switch channels, although I think there’s a menu option to leave closed captioning on all the time. Finally, caveat emptor: many manufacturing runs of this converter, and its near twin sold by Best Buy under its Insignia house brand, apparently have an audio problem that certain TVs seem to be more susceptible to than others. The converter I purchased had a manufacturing date of April 2008, which has been reported to be the run in which this problem was fixed, and I observed no audio problems during my testing (on an admittedly low-end CRT stereo television/VCR over RCA cables). Overall, I’d assess the LG/Zenith DTT900 as a better option for those who are planning to use the converter on a regular basis; however, if you’re simply buying a converter to serve as a “lifeline” when cable or satellite television is disrupted, or if you would like to take advantage of the SmartAntenna connectivity on that unit, the RCA model is probably adequate for most needs and seems to retail for about $10 less.

Edd Dumbill: Badges, blogging and bragging

Back from my travels, it's time for a few updates. I've mostly blogged about these elsewhere, so I'll just give some pointers here. The launch of magnetic-stripe cards at Where 2.0 went well. We had some initial teething issues with Linux talking to the card printers, which was resolved by backing down to Linux kernel 2.6.22 from 2.6.24. I'm not entirely sure what's up with 2.6.24, but it exhibited strange behavior talking to the card printers over ethernet — as if there were MTU misconfigurations. It's a big nuisance, as 2.6.24 is the default kernel shipped with Ubuntu Hardy, an otherwise excellent release. I've been paying some attention to OpenID 2.0 recently, as it's time for me to upgrade my OpenID accepting websites to use the new release of the specification — if for no other reason than Yahoo! OpenIDs are 2.0-only. This investigation led me to notice XRIs again, which are the confusing underbelly of the OpenID specs. The W3C Technical Architecture Group recently advised against using XRIs. I wrote about this over on my XML.com blog. I've not used for that blog for a long time, but will try to do so more. I've realized that I've still got a lot to say about the web, XML and open standards, and the XML.com blog seems like a good place to say it. Finally, to brag for a short moment. Another XTech has been and gone, and this year's was a great experience for everybody involved. This quote from attendee Paul Smith summed things up nicely, as it tells me I succeeded in my main goal for the conference:
What I really liked about this conference was the mix of attendees and presenters, both from academia, and the commercial world both and small. It made it feel much more valid, and it really felt like everyone was there for the right reasons - not trying to sell anything, but out of a genuinely altruistic wish to make the web better.
My sincere thanks to everybody involved in XTech this year.

21 May 2008

Raphael Geissert: hardware failure


Some people may have noticed that I've been completely offline for the
last couple of days.

A few days ago my pc suddenly crashed and every time I tried to boot
(whatever kernel version, even live cd's) a kernel panic, a bus error,
an init segfault, a udev error, and other kind of errors prevented it
from booting. I once got to boot knoppix (I had a cd around...) but in
less than ten minutes the pc, once again, crashed.

After investigating (memtest86'ing and more) it seems like the memory
is damaged; but as I've been busy with school I won't be able to get
it back working before friday, or even saturday :(.

I've been trying to check my mail regularly. but couldn't until yesterday.

Note: this is a blog post via email, just to let people know why I
haven't/won't been/be around.

MJ Ray: SPI Meeting May 2008 - Doldrums?

At the time of writing, I've not seen an announcement (again), but there's an agenda for an Software in the Public Interest IRC meeting at 19:00 GMT tonight (Wednesday 21st). It doesn't include any reports, motions or items for discussion. This is particularly surprising because Michael Schultheiss declared in the last meeting that there would "definitely" be a complete treasurer report before this meeting (see 20:07:48 in the meeting log http://lists.spi-inc.org/pipermail/spi-general/2008-April/002571.html I sent to spi-general after last month's meeting). But why are there no motions or items? Are we that short of work to do? I may not be at this meeting (library event in Bristol instead) but I'll post a log to spi-general later if I have one.

18 May 2008

Julien Danjou: Boarding the Prometheus

As I said a month ago, my main server Delmak was dying. Well it still runs (proof: you could read this blog some days ago). Thanks to friends I host for free, they've kindly given enough money to buy a brand new server (C2D E8400, 4 GB RAM, 2x500 GB RAID 1) in order to replace the good old Delmak. PrometheusThis new box has been named Prometheus after the only BC-303 class battleship ever built. Delmak was used to mainly run as a Web, mail and databases server. I decided to do use this server switch to change the server software I use. The first mail server I setup was based on Exim 3, courier- imap,pop -ssl, with userdb files. That was... rough. Later I switched to Exim 4, using vexim, and MySQL as a back-end. That was something like 3 years ago I guess. Since then I never really touched that back. I added spamassassin and clamav filtering some months after, because some users asked for it. That's all. So this week, I decided to switch away from this configuration. I do not understand Exim anymore anyway, so I decided to use Postfix which I often use and administrate at work. Obviously, I also now use PostgreSQL as database back-end, since it rocks, and since Postfixadmin supports it. By the way, be aware that the Debian package of postfixadmin is crappy (the configuration file is readable by anyone by default, with the database password in it). I also set up postgrey which is quite nice and efficient. Well, then was time for amavisd-new installation, but I did not do it. Seriously, amavisd-new configuration is a bloody mess, as the language it is written in (yes, Perl). So I switched to dspam which I heard is nice. Well, it seems to be for now, since it even supports clamav daemon usage directly, which is very very nice because that means I do not have to set up another thing for that. I also switched from courier to dovecot, mainly because the latter seems to be faster and lighter. I then changed the default virtual_transport to Dovecot LDA. The main advantage of this is that the LDA updates the Dovecot index while delivering. It also supports quota, which I do not use and plug-ins, like the Sieve language for mail filtering. So I decided to change my procmailrc to a new Sieve filter. My procmailrc is quite small since I only use regex to match lists and some mail address, so it has only something like 12 rules. And well, I did not do it since I discovered after some googling that Dovecot implementation of Sieve is grabbed from Cyrus which does not support variables for now. That means that the following procmailrc code:
:0:
* ^X-Mailing-List: <debian-.+@lists.debian.org>
* ^X-Mailing-List: <debian-\/[^@]+
list-debian-$MATCH/
which will translate to:
require [ "regex", "variables", "fileinto" ]
if header :regex "X-Mailing-List" "<debian-(.+)@"
 
    fileinto "lists.debian.$ 1 ";
    stop;
 
But that won't work since Dovecot Sieve implementation does not support "variables". Well, since I'm not ready to list all the lists I'm subscribed to, Sieve is a no-go for now. I'll stick with procmail.

16 May 2008

MJ Ray: BBC TV: Click: Free=beer and facebook-flaming

Free software finally gets significant coverage on BBC TV's Click show this week, but I think it's very much Linux rather than GNU/Linux and free cost rather than freedom. They mentioned free security software and even raised the possibility of trojans, but didn't mention how free (as in freedom) software allows any random end-user to check or have it checked. Quite a missed opportunity! However, Click has a regular letters section, so watch it (times below), email click@bbc.co.uk and see if we can get the free software view across. The letters section this week seemed to be flaming proprietary SaaS social network site facebook for their pathetic default-permit approach to security of user details. I really think there's a role for something like noserub in free software social networking. Click-UK is shown on BBC News Channel Saturday 1130, Sunday 0430 and 1130, Monday 0030 and Sunday 0430 on BBC-1 (times BST) Click-World is shown Thursday 19:30 GMT, Repeated Friday 09:30 and 12:30 (Asia Pacific only), Saturdays 06:30, Mondays 15:30, Tuesdays 01:30 (not Asia Pacific, Middle East or South Asia) and 07:30 GMT Anyone else see this?

13 May 2008

Enrico Zini: How to generate bootable USB keys with simple-cdd

How to generate bootable USB keys with simple-cdd simple-cdd is a lovely piece of software that builds a custom D-I image with the package selection and preseeding of your choice. Today I was asked to build a bootable USB key with the simple-cdd image. Here is how; the general case is described in the d-i manual: General USB key preparation:
  1. download vmlinuz and initrd.img from hd-media
  2. apt-get install syslinux mtools mbr
  3. Partition the USB key as needed (from now on, I'll assume the usb key is in the device /dev/sdb1)
  4. Format it as FAT: mkdosfs /dev/sdb1
  5. Put the boot loader in it: syslinux /dev/sdb1
  6. Put the MBR in it: install-mbr /dev/sdb
  7. Mount it: mount /dev/sdb1 /mnt
  8. Copy kernel and initrd: cp vmlinuz initrd.img /mnt/
simple-cdd specific part:
  1. Run build-simple-cdd as usual
  2. Copy the ISO file generated by build-simple-cdd in the USB key. Any name will do, as long as it ends in .iso the installer will find it
  3. Configure the boot loader, fetching the kernel command line out of the cdrom boot loader generated by simple-cdd:
    • echo default vmlinuz > /mnt/syslinux.cfg
    • grep append tmp/cd-build/etch/boot1/isolinux/isolinux.cfg head -1 sed -e 's/^\t//' -e 's/ initrd=[^ ]*/ initrd=initrd.gz/' >> /mnt/syslinux.cfg
This is it, it works nicely, perfectly scriptable, tested today.

7 May 2008

Steve Kemp: You're not too technical, just ugly, gross ugly

Well a brief post about what I've been up to over the past few days. An alioth project was created for the maintainance of the bash-completion package. I spent about 40 minutes yesterday committing fixes to some of the low-lying fruit. I suspect I'll do a little more of that, and then back off. I only started looking at the package because there was a request-for-help bug filed against it. It works well enough for me with some small local additions The big decision for the bash-completion project is how to go forwards from the current situation where the project is basically a large monolithic script. Ideally the openssh-client package should contain the completion for ssh, scp, etc.. Making that transition will be hard. But interesting. In other news I submitted a couple of "make-work" patches to the QPSMTPD SMTP proxy - just tidying up a minor cosmetic issues. I'm starting to get to the point where I understand the internals pretty well now, which is a good thing! I love working on QPSMTPD. It rocks. It is basically the core of my antispam service and a real delight to code for. I cannot overemphasise that enough - some projects are just so obviously coded properly. Hard to replicate, easy to recognise... I've been working on my own pre-connection system which is a little more specialied; making use of the Class::Pluggable library - packaged for Debian by Sarah. (The world -> Pre-Connection/Load-Balancing Proxy -> QPSMTPD -> Exim4. No fragility there then ;) Finally I made a tweak to the Debian Planet configuration. If you have Javascript disabled you'll no longer see the "Show Author"/"Hide Author" links. This is great for people who use Lynx, Links, or other minimal browsers. TODO:
I'm still waiting for the creation of the javascript project to be setup so that I can work on importing my jQuery package. I still need to sit down and work through the Apache2 bugs I identified as being simple to fix. I've got it building from SVN now though; so progress is being made! Finally this weekend I need to sit down and find the time to answer Steve's "Team Questionnaire". Leave it any longer and it'll never get answered. Sigh.
ObQuote: Shooting Fish

6 May 2008

Tore S. Bekkedal: Depressing.

Those of you who know me might be aware that I have a fondness for cool and neato hardware which is possibly a tiny bit above that of the average geek. I have more nodes on my ThinNet than on my TP network, for example. Back in February, I had the random idea to call SGI Norway and ask them if they had anything they were about to throw out. I knew that they were working hard on moving from MIPS to Itanium, so perhaps some hardware was disappearing along the way. Oslo didn’t have anything, but when I called Bergen I found out that they were about to throw out a large amount of hardware, including some really nice boxes like an Onyx2 deskside workstation, and some Origin systems. For those of you who aren’t into SGI machines, I can sum it up by saying that these are really cool computers: Big, noisy as hell, heavy, and in terms of performance, nearly on par with a normal desktop nowadays. In short, fantastic educational toys. So, this was in February, and we were making arrangements for transport to Oslo, until one day I stopped receiving mail. I didn’t think much of it; email is asynchronous, and I figured he was busy doing something else. I was certainly very eager to get at the machines, but didn’t feel like nagging at him either. Finally, recently I sent him a polite reminder, and I get the rather rude response: Diagnostic code: smtp;550 cuda_nsu 5.7.1 <****@sgi.com>: Recipient address rejected: THIS USER IS NO LONGER WITH SGI. CONTACT help@sgi.com IF YOU NEED INFO. I tried calling the Bergen office, but the number was out of service. So I call the Oslo office - and I am told the Bergen office has been shut down, and all the equipment has been thrown out. This is the bummer of the century, for two main reasons:
  1. I’m not getting cool hardware that I was totally looking forward to getting,
  2. Great hardware has now been ground up for use in car tires.
For some odd reason, the second reason is infinitely more grating than the first. I feel like a museum curator being forced to watch someone feed a Picasso painting to a paper shredder. This really, really screwed up my day. :(

4 May 2008

Jonathan McDowell: Switching to Movable Type

Since I noticed the Movable Type Open Source release I've been considering switching over to it; my Blosxom install is just a tad crufty and I wanted something that wasn't going to require a lot of effort (it's hard enough to get round to posting these days without having to worry about the underlying system). Dom's packaging of MT and Ganneff's switch gave me some confidence it might be a sane move, so here we are.

Of course the style now completely conflicts with the rest of my site (I should probably update it all, but I don't really do HTML/CSS so it can wait for now), there's still no real content and I've no doubt broken a whole bunch of links (which I'll try to fix up as I notice any that are used a lot), but I've kept putting this off and the longer I do so the worse it'll get.

(I might have some real life things to blog about, but they all seem to be in the RSN category and there's no point talking about them unless they actually happen.)

3 May 2008

Matthew Palmer: Spam Filter Developers and Administrators: Dumber Than The Dumbest Person On The Internet

For the past couple of days, one of my e-mail addresses has been some spammer's choice for forged From: lines in their spew. So, as invalid addresses aren't high on a spammer's list of priorities, I get all the bounces. The fact that MTAs, in this day and age, don't have SMTP session recipient validation is unpleasant. However, with ISPs requiring all outgoing e-mail to go through their own servers, I can kinda see where that can break down. I still don't like it, but I'll live with it. In amongst all the bounces, though, there's a lot of other, really obnoxious, crap. So far, I've had five "please click this link / reply to this e-mail so it'll go through" (AKA "please filter my spam for me")[1]. I've also had a large number of e-mails saying that my e-mail was blocked or unwanted or whatever, from spam filtering programs themselves. What I haven't got any of, as far as I can determine, is any e-mail from enraged recipients saying "stop sending me this crap!" or anything of that nature. The only conclusion I can reasonably draw from this data is that users know that source addresses are forged and there's no point replying to them, but the people whose job it is to write, maintain, and run spam software don't. That's downright embarrassing. Not a single user was dumb enough to assume that I really sent the e-mail, but IT "professionals" who deal with spam for a living are. If you are in any way involved in the production, sale, or use of an anti-spam product that hasn't realised that the from addresses of spams are universally forged, please shoot yourself in the head. Really. I'm sick to death of people who should know better doing the most stunningly stupid things regardless. If you don't know that your software is spamming the rest of the world, then you're still on the hook. What other dumb shit is your system doing that you know nothing about? On the other hand, if you do know that your spam filter is contributing to the noise, you're even worse -- no spam has a real source address. If your software or system spews crap because some clueless manager told you to do it, then you need to grow some courage and ponder on the words of Napoleon:
A commander-in-chief cannot take as an excuse for his mistakes in warfare an order given by his sovereign or his minister, when the person giving the order is absent from the field of operations and is imperfectly aware or wholly unaware of the latest state of affairs. It follows that any commander-in-chief who undertakes to carry out a plan which he considers defective is at fault; he must put forward his reasons, insist on the plan being changed, and finally tender his resignation rather than be the instrument of his army's downfall.
In other words, if you did it and you know you shouldn't have, it's still your fault, regardless of why you did it. Take some responsibility for your actions, for fucks sake.
[1. Every single one of which I was more than happy to confirm -- if you want other people to do a job for you, you have to deal with the fact that some of them might not do it in quite the way you expect. I encourage anyone else who thinks that an anti-spam system that requires the rest of the world to filter your inbox is stupid (even disregarding the likely problems of infinite loops if everyone had a challenge-response inbox) to do the same.

Ben Hutchings: Becoming a kernel developer

After a fair amount of clean-up, a lot of waiting for review, and some ruthless pruning, I and my colleagues at Solarflare finally got our net driver accepted for Linux 2.6.26. Meanwhile a larger version of the driver made it into Xen's Linux tree, along with dependent drivers to provide a secure fast path to the hardware from domU. Somewhere down the road we're going to have to resolve these two versions, but now I'm just pleased to have a working driver in-tree. There are some other changes I've worked on over the past few months: However, this is still only part of my work. My main task at the moment is to write more unit tests for our next NIC.

27 April 2008

Joerg Jaspert: Movable Type

As I wrote some time ago, I did consider switching to a new blog software, the OpenSource Edition of MovableType. I’ve actually done that some 6 weeks ago and must say - it is one browser based application I am actually happy with for myself. (Good god, I must be really ill). I know that about all the things that changed in my blog, compared to my old blosxom based version, are actually doable with blosxom too. For some reasons I just never got around to doing it. Anyways, some things I still remember that changed: What it not has is the ability to use a version control system for your posts. Of course not, its a web based editor which stores its data in a database. Oh well, lets stop here, basically - I just like it. :) Comments: 0

25 April 2008

Gunnar Wolf: FLISOL 2008 - Monterrey, NL

I'm about to leave for Monterrey, Nuevo Le n, some 700Km North. Why? Because I was invited to be at the Monterrey FLISOL. And what exactly is a FLISOL? A very nice and interesting idea: Festival Latinoamericano de Instalaci n de Software Libre, Latin American Free Software Install Festival.

So far, I have stayed away from install-fests. I don't like them. And I will keep what I have always said: I am going because I was invited to talk about network security (of course, giving more than a little bit of relevance to Free Software as the IMHO only way to get to a decent level of security). But I do want to be part of this. It is large. Very large. So large, you don't want to miss out.
According to Beatriz Busaniche, FLISOL will be simultaneously held in 210 cities all over Latin America, in Argentina, Bolivia, Brasil, Chile, Colombia, Costa Rica, Cuba, Ecuador, El Salvador, Guatemala, Honduras, Mexico, Nicaragua, Panama, Paraguay, Peru, Uruguay and Venezuela. In short: everywhere.
Spread the word. Spread the love. Spread the fun!

24 April 2008

Dirk Eddelbuettel: smtm maintenance release 1.6.9.1

A new version of smtm went to Debian yesterday. And after some pondering, I also just uploaded it to CPAN even though it only contains minor Debian packaging fixes rather than genuine code changes. In order to signal that the core Perl code hasn't changed, I simply added a new minor to move the version from 1.6.9 to 1.6.9.1.

Joachim Breitner: Pausable IO actions for better GUI responsiveness

For a university seminar I m currently writing a GUI program to view fractals based on simple iterated function systems (only similaritudes allowed). It supports three different drawing algorithms and you can edit the IFS by dragging squares around on the screen. But this post is not about this program (I might present it later), but how Haskell allowed me to solve a problem very nicely:The first instances of the code had a problem that a lot of GUI programmers know: The drawing of the fractal took quite some time, and during that time the gtk main loop is blocked and the program becomes unresponsive. At first I avoided this problem by manually splitting the drawing function (e.g. by repeatedly increasing the resolution) and kept re-drawing it at higher resolutions in an idle handler, so at least I could interact whenever one resolution has finished drawing. It worked somewhat but it was not easily done for the other, not pixel based, algorithms and it was ugly.So I wanted a way to (a) pause the drawing at any convenient point, to resume it later, and (b) safely abort the drawing if what I m drawing has changed and I need to restart.A common solution to this would be to do the drawing in a separate thread, so (a) is actually not needed, but I did not know if I can safely do (b), and I have heard that threads cause problems with gtk.So I tried to dig deeper for the hidden treasures of advanced haskell programming: I need a monad transformer! I expected the infamous ContT monad transformer to help, but I couldn t figure out how, and I started to create my own monad transformer, called CoroutineT.I tried to figure out what an action of type (CoroutineT IO a) should do, and I came up with this type signature:
pausingAction :: IO (Either (CoroutineT IO a) a)
which means that after the pausingAction is done, it is Either paused (and I get back another pausingAction to run when I want it), or it is done (and I get the result). Note that I m writing IO here, but it can be any monad.The definition of the datatype and the monad instance came mostly from trying to make this type work (yay to haskell s type system, less thinking required), and looks like this:
data CoroutineT m a = CoroutineT  unCoroutineT :: (m (Either (CoroutineT m a) a))  

instance (Monad m) => Monad (CoroutineT m) where
return v = CoroutineT (return (Right v))
a >>= b = CoroutineT $ do
r <- unCoroutineT a
case r of
Left paused -> return $ Left (paused >>= b)
Right unpaused -> unCoroutineT (b unpaused)
This translates to english like this: A call to return is not paused. When an action is already paused, further actions should be run after the paused action is resumed. When an action is not paused, further actions can happen now.Like every well behaving monad transfomer, I also need a "runCoroutineT" function to start the coroutine. I probably could have used unCoroutineT directly, but for my use case (GUI drawing) I did not need a return value, so this function is more handy:
runCoroutineT :: Monad m => CoroutineT m () -> m (Maybe (CoroutineT m ()))
runCoroutineT a = either (Just) (const Nothing) liftM unCoroutineT a
Nothing surprising here, basically just turning the Either into a Maybe. So it becomes clear how to do (b): We can just throw away the resume action returned by runCoroutineT (if any). The more interesting thing is how we do (a): We need a pause action of type (Coroutine m ()). But how should it work? I did not really try to understand why it works, but by looking at the types, I came up with this:
pause :: Monad m => CoroutineT m ()
pause = CoroutineT (return (Left (CoroutineT (return (Right ())))))
Yes, it sounds like some dance step instructions (read the second line out aloud!), but it works somehow.So here is some example code: I have a pausable IO action that counts from one to ten, pausing after each number. I also have function that resumes an pausable action up to n times:
example n = keepGoingFor n $ do
        liftIO $ putStrLn "This is the coroutine"
        forM_ [1..10] $ \i -> do
            liftIO $ putStrLn $ "Counting to "++ show i ++" while you keep calling it"
            pause
  where --keepGoing :: Monad m => CoroutineT m () -> m ()
      keepGoingFor 0 _   = putStrLn "Here I just abort the run"
      keepGoingFor n cor = do
        resume <- runCoroutineT cor
        case resume of
            Just runAgain -> keepGoingFor (n-1) runAgain
            Nothing       -> putStrLn "Finally stopped"
And here is the output of two different runs:
*CouroutineT> example 5
This is the coroutine
Counting to 1 while you keep calling it
Counting to 2 while you keep calling it
Counting to 3 while you keep calling it
Counting to 4 while you keep calling it
Counting to 5 while you keep calling it
Here I just abort the run
*CouroutineT> example 14
This is the coroutine
Counting to 1 while you keep calling it
Counting to 2 while you keep calling it
Counting to 3 while you keep calling it
Counting to 4 while you keep calling it
Counting to 5 while you keep calling it
Counting to 6 while you keep calling it
Counting to 7 while you keep calling it
Counting to 8 while you keep calling it
Counting to 9 while you keep calling it
Counting to 10 while you keep calling it
Finally stopped
So it does really works fine, and it proved very useful in my GUI drawing problem. For that, I created this nice control structure which works like mapM_, but calls pause every n iterations, and therefore hides the pausing stuff almost completely:
pausingForM_ :: Monad m => Int -> [a] -> (a -> CoroutineT m ()) -> CoroutineT m ()
pausingForM_ period list action = pausing' 0 list
where pausing' _ [] = return ()
pausing' n (x:xs) = do action x
if n==period then pause >> pausing' 0 xs
else pausing' (n+1) xs
I have put the complete module (including instances omitted here) in the darcs repository that might later also contain the fractal drawing program.

23 April 2008

Ingo Juergensmann: Spamassassins spamds memory usage

Some days ago I complained about snmpd having a memory leak in Debian Etch, which seems to be related to the Etch version, as someone commented there. Anyway, todays complaint is against spamassassins spamd and its memory usage:


top - 18:36:15 up 30 days, 5:17, 12 users, load average: 9.60, 4.95, 2.38
Tasks: 170 total, 2 running, 168 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.6%us, 1.4%sy, 0.2%ni, 31.7%id, 66.0%wa, 0.0%hi, 0.0%si, 0.1%st
Mem: 1048576k total, 1041264k used, 7312k free, 0k buffers
Swap: 1048568k total, 695652k used, 352916k free, 35568k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
31694 nobody 18 0 565m 360m 2396 D 1 35.2 0:08.45 spamd
23003 root 16 0 565m 344m 2456 D 0 33.6 40:54.15 spamd
27052 nobody 16 0 94216 40m 2456 D 0 3.9 0:29.96 spamd
9241 clamav 15 0 224m 39m 740 S 0 3.8 3:19.17 clamd
31711 nobody 15 0 89856 36m 2464 S 0 3.6 0:00.37 spamd
31750 nobody 16 0 89244 36m 2436 D 1 3.5 0:00.24 spamd
30751 root 15 0 87884 17m 2176 S 0 1.7 0:09.42 spamd


Some spamd processes are using a incredible amount of RAM, sometimes even eating up all memory including swap. I know that a bigger commercial site is suffering from the same problem as it was mentioned in their job interview with me lately.

Spamassassin is invoked by exim4 on my system during SMTP data checks with a condition like:


condition = $ if $message_size 128k 1 0


So, this should ensure that only mails smaller than 128 kB are passed to spamd by exim. So, either that condition doesn't work (it should as it's basically the same as in the exim4 docs) or spamd is a memory hog even with small messages.
I wonder if there's any method to stop spamassassin from using that much RAM?

21 April 2008

Tore S. Bekkedal: GNU Screen/vim love

When I code, one of the tools I use which I like the most is GNU screen. My current project involves the editing of a bunch of different source files, and often jumping frequently between them. I was spawning windows and trying to edit files that I had already opened in a previous screen, and often ending up with a bunch of windows with files I wasn’t using much at the time. So I did some research on how to optimize use of vim and screen together. The first thing I came up with was getting screen to display a nice bar at the bottom by adding this to my .screenrc: (Thanks, Red Hat Magazine!) hardstatus alwayslastline
hardstatus string '% = kG [ % G %H % g ][%= % = kw %?%-Lw%?% r (% W %n*%f %t%?(%u)%?% r )% w %?%+Lw%?%?%= % g ][% B %Y-%m-%d % W %c % g ]'
This gives you a neat and coloured (mmmm… colours…) status bar at the bottom of your screen display, including some info on whether other terminals are attached to that window and such. One thing which would vastly improve the usefulness of this would be if I could get vim to set the screen window title. The escape sequence for doing this is the same as for other terminals, but vim’s terminal information database does not include the relevant entry for the “screen” termtype. So (with help from “frogonwheels” and “godlygeek” in #vim) I put an entry in my .vimrc specifying the escape codes for setting screen’s window title. In addition, I abbreviated the window title string to contain only the file. Here is the relevant snippet from my .vimrc: if $TERM=='screen'
exe "set title titlestring=vim:%f"
exe "set title t_ts=\<ESC>k t_fs=\<ESC>\\"
endif
A casual glance at my school grades chart will immediately reveal that I am not a structured learner; I’m not the type of user who will, when adopting a tool, begin by reading the manuals. I’m more of a gradual, ad-hoc learner, and I tend to prefer to stick to the defaults whenever possible. Since vim and screen are probably my primary tools for doing work, I should probably do some more research on things like this. These suggestions may be somewhat trivial, but I’ve found them to be quite useful, so I thought it might be useful to someone. Please leave a comment if it was, or if you have any comments (duh!) or suggestions.

Next.

Previous.