Search Results: "sf"

20 January 2007

Andrew Pollock: [life] Christmas in Vegas

(almost caught up on the blogging backlog) We had five days off over the Christmas period, from Christmas Eve on the Friday through to what we call Boxing Day (America doesn't do it, but Google gave us the day off). We spent the time in Las Vegas with our friends Craig and Sarah and their daughter Kes, in their "fifth wheel" trailer, as we had previously in Glamis. The drive was good. We stuffed around getting away on Friday, so didn't leave Mountain View until around 10am, so Craig and Sarah beat us there, when we were expecting to beat them (they couldn't leave until the end of business on Friday). It took us something like 9 hours to drive there. I think the thing I love the most about California is the diversity you get. We've seen snow, forests, beaches, desert. All without having to leave the state. One of the highlights of the trip was going through Bakersfield, which had heaps of oilwells all over the place. We also drove past one of the commercial aeroplane dumping grounds in the Mojave desert. Vegas itself was something to behold. It had a reality distortion field around it that made Google's pale into insignificance. The strip was great to walk up and down to just take in the architectural wonders that are the casinos on it. The adult industry is incredibly in your face. People are on the sidewalk handing out "calling cards" for what I thought were hookers, but I'm told are technically strippers, with catchlines such as "nude to your door in 15 minutes". What would normally dispense newspapers in any other city gave out free catalogues of what the adult industry had to offer. I thought all of that was a bit seedy. The casinos themselves where all much of a muchness inside. Far too smokey for my liking. I'm not a big gambler. I think blackjack is about the only game I can wrap my head around, and even then you can lose too much money too quickly on the tables, so I mainly played video blackjack with 25 cent bets. It's not a bad way to blow five bucks. The second hand smoke was a great deterrent against staying inside for too long. We caught Zumanity at New York New York, and had a humungous buffet lunch for Christmas Day at Mirage. We were staying in the trailer park attached to Circus Circus. It's pretty cool that there's a trailer park right on the strip. The one thing that I hadn't associated with Las Vegas was the shopping. Every one of the casinos on the strip had a massive shopping mall associated with it, and I mean massive. Paris' in particular took forever to escape from. The Forum Shops in Caesars Palace also felt like they went on forever. I initially thought how they painted the sky with clouds on the ceiling was quite clever, until I discovered that every mall did the same thing. Then it got a bit old. You could go to Vegas just for the shopping and the day spas, and never have to set foot in a casino gaming room. I'd like to make one more trip, and this time stay in a hotel, just for the hotel experience. I think Venice was my favourite looking casino (from the outside). Photos from the trip are here.

19 January 2007

Biella Coleman: Internet Radio Under Threat

Probably one of my favorite things about the Internet (and high speed connections) is Internet Radio. My favorite stations are: Space Station, Secret Agent and Tag’s Trance Trip on soma fm out of SF, John in the (weekday) morning on kexp out of Seattle and the The Terrordome and
Asiko Africa Phantom Pyramid
hosted by the simply amazing (really, check out his shows) Minister Faust out of Edmonton. But thanks to witless senators, all this awesomeness is under threat (and most of your probably already know). So support the effort to stop the shenanigans and let’s keep Internet Radio alive… And if you know of any other awesome radio shows or music, please do pass along. I am looking for a good salsa station, classical music and more dance music.

17 January 2007

David Welton: Clockwork languages

Steve Yegge posts an article about this that, the other thing, and statically typed functional programming languages. In it, he compares Haskell to something you can:
"build beautiful, lithe marionettes with"
Unfortunately, I haven't had the time or inclination to learn Haskell (yet), but I have used Erlang professionally, so I do have a bit of experience using a functional programming language. What comes to my mind isn't marionettes, but clockwork. That's a purposefully neutral word, in case you were wondering. An enthusiast might say "a finely crafted swiss watch", and a detractor might grumble "a windup toy". In my mind's eye, the concept is that in functional languages you get this succession of things happening one after the other that happen precisely the same way, if the program is wound up just the same each time. To paraphrase:
Do this with the result of this with what this produces when given  
this input that is derived from this function which takes the  
result of this other thing after calculating the result of 
something that is derived from the output of a function that ...
And so on and so forth...tick, tock, tick, tock. While I can appreciate that in some ways, this is likely to produce clean programming, in other ways I am less convinced of its practicality. If you'll bear with a poor comparison, sometimes programming is like a song. You do the tricky section, then you go back to an easier section and catch your breath for a bit. That seems to work out in a language like Ruby or Java fairly well, depending on how densely you like your code. You get sections with DoThisAndThisAndThatWithTheResultsOfSelectThisFromTableXYZ that you have to slow down to think through. And then: GoToTheNextTrickyBit where ManyThingsHappen. All in all, you wind up with a sort of ebb and flow that works out pretty well if you're in tune with the code being written, going from intense calculations, to a line or two where you do no more than store things in a variable, take a breather, and prepare for the next important stanza. In my limited experience, I have to say that I didn't always get that sensation from Erlang (which in some ways is apparently less "hair shirt" oriented than Haskell). You always had to be writing something with an eye to where it was coming from, and where it was going. Without a doubt, this produces code that is more compact in terms of meaning and functionality, but at times it leaves a guy like me, who grew up with Basic, C, Python, and so on with the desire to say "woah there, nelly", let's take a breather and sort things out a bit in a few variables before moving on to the next bit of fancy code gymnastics. What I'm curious about is what will catch on from academically oriented programming languages like Haskell. The people working on them are without doubt very smart, and there are some interesting concepts being bandied about (pattern matching is pretty cool, just to cite one). But academia doesn't always produce things that catch on with the average Joe programmer, either, and while the more elitist out there may attribute this to simplistic reasoning such as 'well then Joe is just stupid', I think that the more thoughtful language crafters will attempt to ascertain what works, and what doesn't, and perhaps we will see the Ruby of functional languages emerge from Haskell, the Smalltalk of functional languages. What do you think?

Daniel Burrows: Cuckoo!

The most unique Christmas present I got this year was the cuckoo clock from my father's parents. There's something very cool about mechanical clocks that work by means of weights and gears instead of electronics: when the cuckoo goes off, you can actually watch energy being transferred from the weight to the cuckoo device, as the weight that powers it drops precipitously!

Unfortunately, the clock seems to lose about half an hour every twelve hours. Does the Lazyweb know any techniques for getting mechanical cuckoo clocks to keep better time? I don't mind resetting it once a week or so, but twice a day is a little excessive.

Martin F. Krafft: Stuff I forgot to pack

After an amazingly stressless journey [0], I've arrived yesterday evening in Limerick and met Daren and Mel, two alumni of UL who let me move into a spare room in the house they're renting. To be exact, Mel actually lives next door, but who cares about details. After a bit of unpacking, we headed for the pub and returned for an extensive session of Guitar Hero on the Playstation II, which is a truly fun and excellent game.
[0]

I brought my bike along, for transport and exploring. This involved packing a bit of extra stuff, borrowing a friend's Tranzbag, arriving early at the airport to get it boxed to ensure a safer journey, picking it up in Dublin, and somehow getting it to Limerick, where I'd have to reassemble it. I wasn't really looking forward to the trip. It turned out to be stressless, as I said. The boxing cost me 10 Franks at the airport and was completed in less than 5 minutes, nobody at the check-in counter said anything, as if it was the most normal thing for them to check in bikes, some dude retrieved the box in Dublin and placed it on my cart, and while I was waiting, I found out that I wouldn't have to hop on a coach (bus) to go to the Dublin train station, catch a train to Limerick, and then finish the last mile in a taxi: a bus operates fairly regularly directly from Dublin airport to Limerick, taking four hours for the journey. That's about how long it would have taken me via the train station, but I only had to pay 19 the train itself would have been 25 , plus the taxi charges.

The coach driver was curious when he saw the box, but I didn't have to pay extra, and after watching Airport on my laptop and listening to the new Katatonia album, I found myself with my bag and the bike next to the university's main entrance, with Mel and Daren on the way to pick me up. Five minutes later, I was in my home-to-be-for-five-weeks.

I dropped into bed at around 4am and promptly overslept the next morning, then decided to use the day for errands, hitched a ride from Laura (the stressed-out Skynet president and Skycon organiser) to an excellent nearby bike store where I reassembled the bike, got myself a lock (see below) and a mud guard for the front wheel, then headed off for the campus bank to open an account, rode back and forth between the Lero building and the bank to satisfy their bureaucratic thirsts and finally obtained the details for my very own Irish bank account. And I squeezed a bit of grocery shopping in between. Meeting Brian (my supervisor) in the hallway, we agreed on a meeting on Monday, so the remainder of this week is for finishing the various proposals and papers on my to-do list, preparing for the meeting by getting back to speed with my research, as well as getting to know the local party crowd exams are about to end in Limerick and I've been told to have picked quite an excellent time of year for my visit because the university will become a mad house this weekend. We'll see how compatible those tasks are, but boy am I glad that I am not living anywhere near the student villages, or as I put it last night: I don't mind going to parties, but if the party comes to where I am, I'd rather not have it be every night. So this would bring me to the title of this post: stuff that I forgot to pack:
  • A second sweater, it's pretty cold here and I don't want to be wearing the same sweater every day (even though it's merino wool and thus woudn't start to smell).
  • A pair of windcheater gloves, the thin wool ones I have aren't exactly made for cycling.
  • Rain trousers to wear over my regular pants. It's raining and wet and the light colours of the pants I am wearing are a high-contrast basis for the mud.
  • My bike's lock key. Fortunately I left it unlocked, but still had to go out and buy a new lock (which was more painless than having the key sent here).
  • Comfy sneakers for home use, as it's too cold to just be wearing socks.
Due to popular request, I shall be back here with pictures of my surroundings one of these days. NP: I Love You but I've Chosen Darkness / Fear Is on Our Side

MJ Ray: SPI: Communications 2

Even less surprisingly, my request that the Software in the Public Interest board try to repair SPI's member communications was postponed. The request was submitted before the December 2006 meeting and now won't be heard until February at soonest. SPI president Bdale Garbee apologised. At least the Spanish resolution was decided (referred to board 2005-11, resolved 2007-01). Meanwhile, on the mailing lists, SPI board member Ian Jackson flamed me again and proposed a resolution which adds lots of red tape, unnecessarily links submissions to announcements and ignores SPI's email and web problems. On the previous post, Bruce Byfield commented:
"I'm sure my bias creeps into many stories, no matter how fair I try to be, but I really don't have much of an opinion on the domain name issue. My main interest is that it's newsworthy. Under these circumstances, I have a hard time seeing how I could have much of a different view from anyone."
I agree. It's hard to see how the newsforge article could have been much different. Is it newsworthy that SPI's board continued voting without discussion at yesterday's (2007-01-16) meeting? No-one wants meetings to last hours, but it's essential that the board put something of their views into the official proceedings. Votes should not be totally set in advance. Otherwise, how can SPI members oversee? How can they make a well-informed decision whether or not to re-elect a member? Now members have to hope they are on the right mailing lists (open or closed) at the right time because the public record is so incomplete.

Andrew Pollock: [tech] Initial impressions of Microsoft Optical Desktop Elite for Bluetooth and Linux

After some hiccups with delivery, the bluetooth keyboard and mouse I ordered had miraculously turned up at the leasing office on Sunday, when we poked our head in on the way home in the early evening. I had a quick play at getting them working. The USB Bluetooth adapter was recognised by Debian Etch's 2.6.17 kernel without and problems, and I installed all of the BlueZ packages and had it happily looking around for devices. I tried to get the mouse working first, as the documentation said that it didn't require a passkey. I successfully paired it using hidd --connect bdaddr whilst having it in discoverable mode. Sure enough, some extra stuff turned up in /dev/input (interestingly, whenever the mouse (or keyboard) puts itself to sleep, everything vanishes again, and when it reawakens, it scores a new numbered "input" entry in /sys/class/input, so I wonder if that's going to do anything unpleasant when the number gets sufficiently high). I next tried to get the keyboard working, expecting more of a fight, because it required a passkey. Turns out, I could get it connected and working with exactly the same procedure. No passkey required. That bothers me slightly. So at this point, I added what was essentially a second mouse device to my xorg.conf (which I suspect became redundant after I disconnected the USB mouse), restarted X, and hey presto, either mouse worked. I then removed the USB keyboard and mouse, restarted X again for good measure, and everything continued to work. As I haven't touched a config file yet, restarting the bluetooth services loses the pairing and I have to repeat everything, so I need to figure out how to make this all "just work" at bootup, but it's not high on the list of things to do, as I don't reboot my MythTV box very often, and I use the keyboard and mouse even less. In terms of functionality, the wheel on the mouse isn't working. This appears to be a bluetooth-level problem, as doing a hcidump shows no activity whilst the wheel is being used. Interestingly, it works as a button, just not as a scroll-wheel. Similarly, on the keyboard, none of the grey extra buttons work (nor does the wheel). Some preliminary Googling shows people having similar problems, and there are mentions of kernel patches. I need to do more research. I also need to do some bluetooth pen-testing with my laptop to figure out if the keyboard is really as secure as I'd like it to be. Oh, and "Windows XP only" be damned, the thing works fine (enough) on Linux :-)

15 January 2007

Russell Coker: LCA talk

This afternoon I gave a talk at the Debian mini-conf of LCA on security improvements that are needed in Debian, the notes are online here.

The talk didn't go quite as well as I had desired, I ended up covering most of the material in about half the allotted time and I could tell that the talk was too technical for many audience members (perhaps 1/4 of the audience lost interest). But the people who were interested asked good questions (and used the remainder of the time). Some of the people who are involved in serious Debian coding were interested (and I'll file a bug report based on information from one of them after making this post).

I believe that I was quite successful in my main aim of giving Debian developers ideas for improving the security of Debian. My second aim of educating the users about options that are available now (with some inconvenience) and will be available shortly in a more convenient form was partially successful.

The main content of my talk was based on the lightning talk I gave for OSDC, but was more detailed.

After my talk I spoke to Crispin Cowan from Novell about some of these issues. He agrees with me about the need for more capabilities which I take as a very positive sign.

14 January 2007

David Moreno Garza: The ten most forgotten crises of the planet

Here it’s a top-10 list of really important things, created by M dicos Sin Fronteras in Spanish. directhex, from #debian-offtopic (thanks!), provided a grammar/spelling check on my original English translation.
  1. Central African Republic: Resurgence of the conflict. In 2006, its civilian population was a victim of violence again. During these months, confrontations have taken place between government troops and rebel groups. Civilians, suspected of supporting one or the other, have stuck in the biddle. Around 100,000 civilians have been forced to leave their homes. Several children, under 5 years old, have become ill of malaria, worms and serious respiratory infections.
  2. Chechnya: Physical and psychologic scars. The consequences of a conflict that has lasted over 12 years so far are still present. Large numbers of Chechens that were displaced during the most serious phases of the crisis have already returned. However, the majority still lack housing and has to live in temporary shelters. Violence, kidnappings and abuses are still rampant. In the rural zones, medical infrastructure is almost nonexistent.
  3. Sri Lanka: Civilians caught in the middle. Combat between government forces and the Liberation Tigers of Tamil Eelam have intensified since the summer, causing displacements of tens of thousands of people. Other are still imprisoned and cannot flee.
  4. Democratic Republic of Congo: Violence and permanent deficiencies. Deprivation and violence suffered by millons of Congolese is still happening unnoticed by the rest of the planet. Eastern Congo is a battleground for fights between several armed groups, included government forces that use force against civilian populace, leading to brutal living conditions.
  5. Somalia: War and natural catastrophes. Even though its current situation has temporarily attraced media attention, the terrible living conditions of the Somali population are still largely forgotten. The country has one of the worst levels of sanitation in the world, and a quarter of the infant population dies before reaching 5 years old.
  6. Colombia: Living with fear. Massacres, executions and fear are a daily life of thousands of Colombians. So far, almost three million have fled their homes because of a conflict marked by the drug trafficking that involves government forces, paramilitary groups and armed guerrillas.
  7. Haiti: Extreme urban violence. The violence and insecurity is a daily breakfast in its capital city, Port-au-Prince, with confrontations between armed groups, the Haitian police and the UN Stabilization Mission on Haiti. Since December 2004, more than 3,000 people have been registered with bullet wounds, including more than a thousand women and children.
  8. India: 25 years of conflict. Confrontations between Maoist insurgents, government forces and anti-Maoist military services have caused the displacement of 50,000 civilans in several areas of the country. The population still lives with fear and violence, with little or no access to sanitary conditions.
  9. Tuberculosis: Obsolete and insufficient treatments. Against popular opinion in the West, tuberculosis is not an “obsolete problem”. Each year, it causes the deaths of two million people, around nine million people contract the disease, and new multiresistants variants are appearing.
  10. Undernourishment: Thousands of avoidable deaths. Whilst in Spain the Ministry of Health tries to fight one of the major problems of the decade, obesity, millions of children die of hunger around the world and more than 60 million people show signs of acute undernourishment.
I guess not everything around is a top ten contest on popularity of who’s the hottest, who’s the prettiest, who has the longest penis or the biggest breasts, or whose farts smell better, geek, eh?

13 January 2007

Adam Rosi-Kessel: Lawyer Bashing: Bad Politics?

The New York Times reports that the Pentagon has gone on the offensive against the pro bono attorneys representing Guantánamo detainees. Although there is a lot to criticize in U.S. detainee policy, these attacks represent a new low:
The senior Pentagon official in charge of military detainees suspected of terrorism said in an interview this week that he was dismayed that lawyers at many of the nation’s top firms were representing prisoners at Guantánamo Bay, Cuba, and that the firms’ corporate clients should consider ending their business ties. … The same point appeared Friday on the editorial page of The Wall Street Journal, where Robert L. Pollock, a member of the newspaper’s editorial board, cited the list of law firms and quoted an unnamed “senior U.S. official” as saying, “Corporate C.E.O.’s seeing this should ask firms to choose between lucrative retainers and representing terrorists.” In his radio interview, Mr. Stimson said: “I think the news story that you’re really going to start seeing in the next couple of weeks is this: As a result of a FOIA request through a major news organization, somebody asked, ‘Who are the lawyers around this country representing detainees down there?’ and you know what, it’s shocking.” The F.O.I.A. reference was to a Freedom of Information Act request submitted by Monica Crowley, a conservative syndicated talk show host, asking for the names of all the lawyers and law firms representing Guantánamo detainees in federal court cases. Mr. Stimson, who is himself a lawyer, then went on to name more than a dozen of the firms listed on the 14-page report provided to Ms. Crowley, describing them as “the major law firms in this country.” He said, “I think, quite honestly, when corporate C.E.O.’s see that those firms are representing the very terrorists who hit their bottom line back in 2001, those C.E.O.’s are going to make those law firms choose between representing terrorists or representing reputable firms, and I think that is going to have major play in the next few weeks. And we want to watch that play out.”
Perhaps the worst part is the following statement, which as best I can tell has no basis in truth:
When asked in the radio interview who was paying for the legal representation, Mr. Stimson replied: “It’s not clear, is it? Some will maintain that they are doing it out of the goodness of their heart, that they’re doing it pro bono, and I suspect they are; others are receiving moneys from who knows where, and I’d be curious to have them explain that.”
Deval Patrick, the recently-elected governor of Massachusetts, endured similar attacks for his work representing criminal defendants. Fortunately, that strategy backfired and Patrick was elected in a landslide. Although others in the administration have attempted to distance themselves from Stimson’s comments (including the Attorney General), the suggestion that large corporate clients should boycott these attorneys as punishment for representing detainees remains disgusting. The right to counsel is not a political issue. You could hold the unlikely belief that each and every Guantánamo detainee is a confirmed terrorist and still advocate for fair treatment. These attacks represent a new brand of McCarthyism. I hope that this strategy is as unsuccessful nationally as it was in Massachusetts. It strikes me that attacking the partners of some of the largest firms in the country is also bad political strategy. These attorneys are the type of people who may be major campaign donors and well-connected in both parties. I would think twice before attempting to vilify them. They are unlikely to drop their representation (and might be ethically barred from doing so) in light of these statements. If anything, I suspect their determination to ensure the detainees are accorded due process will intensify. Update: abovethelaw.com speculates that this may be an intentional good cop/bad cop strategy.

Erich Schubert: More on configuration files

Gunnar doesn't like the idea of recommending XML for configuration files, why do you need to be able to edit a XML-file with a non-XML-aware editor if you don't like the raw syntax? If you don't like the raw syntax, use an editor that gives you a different representation. Or use some transformation. Write a tool that converts YAML to XML and back, if you like YAML better. (Btw, this is another reason to use a common library for configuration file handling - let people choose their configuration file formats!) Writing XML in the raw with a good schema-aware editor with syntax highlighting is actually quite nice. Have you ever edited an XML file with eclipse? You really should do that... I once opened my Openbox (a rather minimalistic window manager) configuration file in eclipse. Guess what, it was giving me useful syntax completion! It had loaded and used the referenced schema file. openbox configuration in eclipse It's not as if I think XML is the ultimate thing; (nor is Eclipse an editor I'd use for configuration files; startup takes years and it frequently crashes for me. vim also has some XML support...) IMHO there is a lot in XML that should be stripped (such as attributes); I like JSON syntax better, except it's in turn lacking essential information such as character encoding, namespaces and schema information. I also don't thin JSON allows comments. But when handling information from multiple sources (and multiple schemes), XML is really useful. It removes most of the quessing needed for handling other formats. And that is what I'm precisely advocating: use standardized formats. Consider for example the apache configuration. Do you know of any tool that can parse the apache configuration files other than apache? Some parts look like SGML/XML, but they don't have much more in common than using < and >. When you are in need of automating something with apache, you'll be annoyed by this. If apache would be using something where you have a reliable parser ready for - that would be nice. Have a look at the xchat.conf configuration file. It uses "key = value", but they have these extra spaces there and don't use quoting, this means the file can't be loaded by many parsers, e.g. bash. Now lets use at buttons.conf - compeltely different syntax, "KEY value" blocks, separated by empty lines... Btw, note that configuration handling with XML to me means also keeping comments somehow... most applications will nuke any comments in their configuration files; which is funny since most configuration syntaxes do have a notion of comments, but did you ever come across an application using sh-style configuration (i.e. that you could source in bash/dash/zsh), that keeps comments? P.S. The YAML homepage is not YAML. It's valid XHTML. Only if you strip out all the tags and attributes and use only the text content within the /html/body/pre tag, then you have something which probably is YAML. This compatibility with HTML is probably why XML was at all successful.

MJ Ray: SPI: Communications

I wrote SPI gives away opensource.org and opensource.net and Bruce Byfield wrote SPI to transfer domain names to OSI - I think it's interesting to see how differently we view the disagreement. One possible reason for the difference is that the email discussion around this resolution happened on private lists. I saw the December meeting notice a couple of days before the meeting, sent the board a request that they fix member communications and then started a discussion about giving away the opensource domains with:
"SPI still holds the opensource domains because SPI is a membership controlled organisation and OSI was a self-perpetuating board; and OSI had not done enough to balance their bad licence proliferation work. Why isn't that mentioned in the proposal? Why does 2006-11-18.dbg.mjs.1 not mention 2005-07-26.bp.1? Is it good to keep reposting rejected proposals until they pass? Why is the SPI board being asked again to surrender the domains while OSI is unreformed?"
The reason I started the discussion on spi-private was Josh Berkus writing
"If you think it's important that we should drag it onto spi-private, though, I suppose we should."
which rather suggested a private list was the appropriate venue. As Neil wrote:
"Some discussion has occured on the spi-private mailing list as to how the opensource.org resolution has been handled by the board."
That's putting it mildly. I wrote about the lack of public discussion (as mentioned in my previous report):
"I still don't see how some board members reconcile their votes to give away community assets with their promises. How the devil does board expect members to oversee it when board hides its operations from our view?"
There is a report on the discussion at the next meeting, which will hopefully put the reasons on the public record at last. Unsurprisingly, the first January 2007 meeting agenda omitted my member communications request, but board member Jimmy Kaplowitz accepted my reminder.

Junichi Uekawa: What works for qemu?

I've been trying to see what really works with qemu.I have not been successful with ppc, I do not seem to be able to get the kernel booting.arm seems to work, but Debian does not distribute kernel for versatilepb.i386, x86_64 seem to be fine.mips and mipsel can't find the root file system for some reason.Hmmm.I followed aurelien's excellent procedures, but it doesn't seem to work.Looking at the logs, I have a bad feeling that this kernel may be ignoring my command-line options, or qemu may be failing to pass the command-line options to the kernel.Something tells me that powerpc kernel needs some preptool hacking, and thus needs modification for command-linehandling, and I have a weird feeling that it might be similar for mips. Shrug.Hmm... so Debian ppc kernel has CONFIG_CMDLINE="console=ttyS0,9600 console=tty0", if I can change that, it would be more interesting.Debian mips qemu kernel has CONFIG_CMDLINE="" I wonder if anyone actually managed to use this kernel for qemu booting...

12 January 2007

Erich Schubert: DBus user hooks

Andreas Schuldei asked how to hook into gnome-power-manager. I'm assuming you want to do some user hooks, too; the solutions using the low level hooks in /etc won't help you then. Using a small user daemon that listens for DBus events is much nicer (though you won't be able to have the suspend process wait for you to finish...) - because every user can setup his own stuff. It would be cool to extend the following to a more general solution. I could imagine a combination of a dbus-monitor (logging incoming signals) and a general event handler. You could then either type in the signal you want to hook or choose one of the logged signals, setup some properties (e.g. the SSID you just connected to) and setup reactions (start VPN script etc.). I havn't hooked gnome power manager yet, but I've been doing this for NetworkManager. Here's a python script:
#!/usr/bin/python
import dbus, dbus.glib
 
def device_now_active(path, ssid=None):
  pass
 
def device_no_longer_active(path):
  pass
 
sysbus = dbus.SystemBus()
nm_obj = sysbus.get_object('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager')
nm_if = dbus.Interface(nm_obj, 'org.freedesktop.NetworkManager')
 
nm_if.connect_to_signal('DeviceNowActive', device_now_active)
nm_if.connect_to_signal('DeviceNoLongerActive', device_no_longer_active)
 
mainloop = gobject.MainLoop()
mainloop.run()
To hook to gnome-power-manager, use dbus-monitor to find out the appropriate signals to connect to. I've been using this to start a VPN client when connecting to some wireless networks, and to have gaim automatically logon when network is available:
sesbus = dbus.SessionBus()
gaim_obj = sesbus.get_object("net.sf.gaim.GaimService", "/net/sf/gaim/GaimObject")
gaim = dbus.Interface(gaim_obj, "net.sf.gaim.GaimInterface")
 
# then use
gaim.GaimConnectionsDisconnectAll()
# or
accounts = gaim.GaimAccountsGetAllActive()
for account in accounts:
  gaim.GaimAccountConnect(account)
Dynamic languages like python can be very sweet to use.

Martin F. Krafft: Publishing files to the masses, temporarily

Especially on IRC, I am often faced with the task to share a file with someone. There are pastebins, but they don't help with binary files, quick updates, or sharing directories. Over the past year, I thus developed the pub shell script, which you can obtain from my SVN repository (you can check out the parent directory with several other helpers, or all my non-admin shell scripts). I documented it in the header, so if I excited your interest, have a look there for details. pub requires an SSH-accessible machine with a directory to which you can write, and which is exported via HTTP or FTP (it would be nice to support WebDAV in the future). In my case, that's madduck@scratch.madduck.net:/srv/apache2/stuff.madduck.net/htdocs/scratch, which is available as http://scratch.madduck.net/. Thus, I created ~/.pubrc with the following contents:
TARGETHOST="madduck@scratch"
TARGETDIR="/srv/apache2/stuff.madduck.net/htdocs/scratch"
PUBBASE="http://scratch.madduck.net/"
Here's what I can do now (lines are truncated after 80 characters):
## publish a simple file
$ pub /etc/fstab
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
## ... with optional verification by downloading and comparing md5sums
$ pub --verify /etc/fstab
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
I: successfully uploaded: /etc/fstab
$ HEAD http://scratch.madduck.net/__etc__fstab   head -1
200 OK
## remove the published file
$ pub --delete --verify /etc/fstab
I: successfully deleted: /etc/fstab
$ HEAD http://scratch.madduck.net/__etc__fstab   head -1
403 Forbidden
## bzip2 the file while publishing
$ pub --bzip2 /etc/fstab
http://scratch.madduck.net/__etc__fstab.bz2 501 16e3b533f6588b670c75160dce1f
$ pub --bzip2 --delete /etc/fstab
## same with gzip
$ pub --gzip /etc/fstab
http://scratch.madduck.net/__etc__fstab.gz 423 ea28b1fc537690a0344b74ad2f2d7
$ pub --gzip --delete /etc/fstab
## sometimes I don't want the filename to be guessable:
$ pub --obscure /etc/fstab
http://scratch.madduck.net/__etc__fstab__7eb7d8881a02e47e2906131dec256115 14
$ pub --obscure --delete /etc/fstab
## and this even works with extensions, properly:
$ pub --obscure /etc/a2ps.cfg
http://scratch.madduck.net/__etc__a2ps.9b411100f9d144d090d540c9879dd26b.cfg
$ pub --obscure --delete /etc/a2ps.cfg
## and finally: directories:
$ pub --bzip2 /etc/init.d
http://scratch.madduck.net/__etc__init.d.tar.bz2 59758 1f94314ff9fd472f28172
$ pub --bzip2 --delete /etc/init.d
You'll see how the name is chosen: __etc__fstab. If you're publishing a file from underneath $HOME, the base is truncated:
$ pub ~/debian/misc/security/debsec.zuml
http://scratch.madduck.net/debian__misc__security__debsec.zuml 14366 537b7f7
Of course, all of the above take an arbitrary number of arguments:
$ pub /etc/fstab /does/not/exist /etc/init.d
W: skipping nonexistent file: /does/not/exist
http://scratch.madduck.net/__etc__init.d.tar 337920 c350629b859e1369ed29a98c
http://scratch.madduck.net/__etc__fstab 1446 885c2219df938a059a5f0a13e65e8f9
$ pub -d /etc/fstab /does/not/exist /etc/init.d
W: skipping nonexistent file: /does/not/exist
Over time, the scratch space will fill up. Thus, I am using tmpreaper to delete files which have not been accessed in 30 days. The script in use, as well as the files that givern the way the HTTP server presents the scratch space, are available in this SVN repository. I hope this tool will be useful to some, and I am looking forward to patches and suggestions! NP: No-Man / Returning Jesus

Erich Schubert: Tomcat shutdown problems - resolved

I had trouble with tomcat. It started fine, but shutdown took a very long time (enough for eclipse to suggest killing it, for example). Some people suggested I try the tarball from Apache, instead of using the Debian package, but that didn't help either. By not running tomcat from eclipse and waiting a long time for the shutdown, I finally managed to get some actual error messages: This was usually the last message I was seeing:
INFO: Pausing Coyote HTTP/1.1 on http-8080
After some timeout, I now got these messages:
Protocol handler pause failed
java.net.NoRouteToHostException: No route to host
No route to localhost? WTF? I resolved it by putting all hostnames it might try (localhost.localdomain, although I use that nowhere, as well as the FQDN I'm using) into my /etc/hosts and forcing them to point to 127.0.0.1 - and voila, tomcat actually shuts down instead of pausing and then failing to notice it has successfully paused...

Martin-&#201;ric Racine: Copywrong: Media Moguls versus Artists

One recurrent theme in discussions about Copyrights and Digital Rights Management is that the Media Industry allegedly represents the interests of the Artists. Yet, recent actions in Canada and elsewhere prove that Artists who benefited from the wider exposure of their creations via the Internet in fact oppose laws that would preserve and further entrench the monopoly of the Industry. Finland's case is no different: as reported by Jaakko Kuivalainen in the Tekij noikeuslaki blog [in Finnish], a number of Finnish Artist Coalitions are currently opposing the transfer of copyright issues from the Ministry of Education (who also handles cultural affairs) to the Ministry of Commerce, because they fear that the interests of the Media Industry would suddenly have precedence over those of the Artists and small Independent Cultural Producers. Yet another proof that, no, Media Moguls do not speak on behalf of the Artists.

11 January 2007

Ian Murdock

Forget the iPhone—I want an iPhone Shuffle!

10 January 2007

Lars Wirzenius: Random hacks: Notetak, revisited

My Notetak application is slowly maturing. Some day in the relatively near future I expect it to get so mature that I need to start refactoring the code so that it isn't utter crap. So far I've developed Notetak by doing random quick hacks, as they have occurred to me, without caring much about maintainability, unit tests, or such. This is fine for the crude prototype phase Notetak is currently going through, but it's getting to the point where making changes meets with internal resistance, since I first need to figure out a way to avoid breaking unrelated things. Now that I have some idea of how the application should behave, refactoring it to be nicely coded is easier. Heck, it's still only 374 lines of Python, plus a .glade file, so rewriting it from scratch should only be an evening's work. Anyway, I'm pretty happy with it now. It fits fairly well into my simple GTD workflow, it's pretty quick to work with, and generally doesn't get in my way. I miss undo/redo, and the UI is ugly, and there's no pretty icon, but the core functionality is there, and is satisfactory. (374 lines of Python to build a useful GNOME application is pretty good, I think. The combination of GTK+, PyGTK, Python, Glade-2, and libglade, is a very powerful combination indeed.)

Ian Murdock: Best of breed 2.0

Richard MacManus: “Instead of using the entire product suite of a Google or an MSN or a Yahoo, you [should be able to] use the particular apps you like most from not only big players - but small startups too.” I agree wholeheartedly. I’m a big believer in the componentization of the web, as I’ve written about before. Without a way to write independent apps that integrate with each other regardless of where they’re hosted, the future starts to look more and more like the mainframe era (albeit with better graphics). The world needs only five computers (shaping up to be Amazon, Google, Salesforce.com, Windows Live and Yahoo!). However, we need to ensure that these five computers operate more as computing utilities where a thousand flowers can bloom than as centralized monoliths where the only way to integrate is to be assimilated.

Next.

Previous.