Search Results: "dom"

11 March 2006

Clint Adams: Snakeback in Angora

Somewhere in the vast and unspoiled natural beauty that is New Jersey, right around the corner from K-Mart, lived a man named Stellan Andrews. He lived with his wife, his enormous children, and a host of psychotic delusions. Stellan had always known that he was special. From a very early age, it was clear to him that he was superior to the other children, and as he aged, he discovered that he could employ his above-average intellect and cunning to manipulate social systems to his advantage. By the time he was 18, he thought himself invincible. His ambitious and power-hungry nature was tempered by a fair amount of social ineptitude and an utter lack of empathy for anyone who was not similarly power-hungry and evil as he. This led to a perception of him as bright and eccentric at best, or more frequently as one of them there smartypants weirdos who thought that he was too good for his neighbors in the mobile home park. His friends were few and tended to be outcasts with sociopathic tendencies. These friendships were intense and codependent until abrupt ends; one person would demand too much, the other would demur, the first would stand firm and uncompromising as this would now become a significant issue about loyalty and value and importance, and after a short-lived blowup, they would never speak again. Throughout, extreme amounts of jealousy would rage in both directions, and so Stellan never had more than one friend at a time. In between friendships, though also during them, Stellan spent much of his time tinkering with technology. He dissected and rebuilt radios, televisions, computers, and anything else he could get his hands on. He played with model rockets and explosives of many types, though without fail it was his friends who were more interested in these types of activities. With them, he also played with guns, but he never had any interest in doing so on his own. After high school, Stellan enlisted in the Army, despite a fundamental distrust of government and a lack of passion for most of the various relevant interests of his now-forgotten friends: guns, history, tanks, U.S. Cavalry catalogs, and dolls that were called action figures . However, he did enjoy strategy- and war-games, which never had any relevance to his military career. The only aspect which appealed to him was the power hierarchy, and this seemed more natural to him than any other social structure he had experienced. He was stationed in Laos for a time, and that is where he met his wife. She was a Chinese rabbi, and since she spoke no English, they hit it off smashingly. With not much to go on about her personality, he romanticized her into his perfect woman, and by the time his delusions were shattered, they were raising children in New Jersey. Neither was particularly happy. She sublimated nearly all of herself into her work at the local pan-Asian synagogue, and he, now more social than he had ever been in his life, entered into a sinister and twisted game. It was called Perfidy, and there were a couple hundred participants across the entire country. These players had a few things in common: they were moderately sociopathic; they harbored great contempt and resentment for the average citizen, whom they characterized as a stupid sheep or cow; and they believed that they, as superior creatures, were entitled to control the proletariat for entertainment purposes. The game, to boil it down to some sort of boiled-down nutshell, was the structured use of random and unwitting people as pawns in a giant and complex strategy game. The players who excelled were accomplished manipulators and liars, or, as they preferred to call themselves, social engineers. They were also cold and dispassionate. Stellan lost his head. He had just been outman uvred by Jack Breig from Delaware, and he was livid. As the bile rushed into his mouth, he lost his firm grasp on strategery, and succumbed to vengeful instincts. Within days, he and Jack were getting far too personal. His rage abided when he succeeded in triggering Jack's divorce. In response, Jack proved once again that he was Stellan's better. The next day, Stellan was arrested for a crime that he did not commit. He was sentenced to eighteen months in prison. His family was not pleased. He returned home a felon. No longer able to get credit or a job, he reacted in the most natural way possible: he joined the local Plan 9 Users' Group. [To be continued...]

10 March 2006

Simon Richter: Last call for votes

I voted 1342. In my opinion, Debian should not compromise on its principles just because it is the free software foundation that is asking us to. Their stance on the whole issue appears to be "not our problem", which indeed it isn't, because they hold the copyright and needn't care about licenses on their software. Users need to, and Debian's role so far has been to check licenses against the DFSG so the user can rely on the basic freedoms to be there. By ignoring the problems, we are not doing our users a favour, because now they need to check the licenses on all packages they install. The most evil thing is the binutils build, which generates documentation from source and relicenses it while doing that.

9 March 2006

Eric Dorland: Concentration

It's maybe a little fashionable to use terms like "information overload" and that all our technology is making us less productive. I'm starting to buy into this theory a little more though. I'm having a lot of trouble keeping myself focused on any one task for an extended period of time. I constantly jump between task A to task B to check email C, making a little progress here and there, but I think I'm hurting myself with all these context switches. I can't seem to stop myself anytime I have to wait for something (even very briefly), my focus switches to something else.

The most problems are at work. Now I'm fairly sure the environment has a lot to do with it. It's an open concept type, with a few cubicle walls here and there. People are constantly interrupting me with questions and random conversations can break out frequently. For the most part I really like these aspects, but it can be very hard to concentrate on a task. Home isn't much better though. I have trouble just concentrating on one task, I almost always have a movie or TV going at the same time, and I can't seem to turn it off.

I also have so many half finished projects and good ideas (or so I'd like to believe) that I never get around to getting anywhere with out. I'm really enjoying my classes, but I don't put in the time I should to improve (I'm jealous of [info]mricon's dedication to ).

Do other people feel like this? Does anyone have tips to better allow one to concentrate on a single task at a time, and better follow through on tasks? I mean there are some obvious things I should be doing, but I'm having trouble with those even. Outside the box ideas?

Martin Michlmayr: FOSDEM 2006

FOSDEM is one of the events I really enjoy. Unfortunately, I couldn't attend last year because I was at a conference in China. However, this year I was back, and the event was bigger than ever. There's so much going on that it's really hard to keep up. There are a number of people I'd really like to have talked to more but there just wasn't time in those two days which were fully packed. It was nice to meet a number of people again, though, in particular the usual suspects, including Michi Banck (aka Hurd illusionist, "it supports two wireless cards now"), Guillem Jover (Spanish mafia boss living in exile), and Jordi Mallach ("World Domination for Catalan^WValencian"). I also hung around the Spanish free software research people with whom I'm going to spend a few months soon. Crazy Spaniards... I've no idea how I'm going to survive there. Oh, and Neal Walfield, who still stinks, and who thinks I have a British accent now (which he thinks is a bad thing while I took it as a compliment). Regarding new people, I had the great pleasure to meet and talk to Lennert Buytenhek. I talked to him on IRC a bit recently because he's involved in the big-endian ARM port and I've been hacking on the ARM based NSLU2 device. Lennert is quite frustrated because joining Debian is so hard. As it turns out, there's currently a six month wait to be assigned an Application Manager. I haven't really followed NM recently, but when I acted as Front Desk I tried to keep it less than approximately six weeks. Unfortunately, a great number of AMs resigned in the last few months and years, and it has been quite hard to find good new people as AMs. Lennert is the kind of person we really want to have in Debian since he's extremely kind, smart and productive. Given that the current situation seems really bad I decided to act as Application Manager again, but I only intend to do that temporarily. I'm sure I forgot lots of other things. But the summary is that it was a great weekend, with way too much stuff going on at the same time. And while I wish I could have devoted more time to my research, I gained some important insights and did one interview which was really informative.

8 March 2006

Eduard Bloch: Rewritting apt-cacher

Something in apt-cacher did always suck... I adopted the package short before the Sarge release and tried to make it work better. At that time the package was not in the best state, too many changes have done without big design (or any design?) in mind. I made some changes on the cache structure to make it easier maintainable, introduced a basic signaling mechanism and consistency checks, so it should not get stuck or deliver wrong data any longer. However, there was the one big flaw, and Bug 354925 brought it to daylight. Storing all files in a flat directory was a very cheap way to merge multiple mirror contents and allow users choosing just any valid mirror. But it had also some costs: file collisions on identical names, happening more often since Ubuntu's is out there. The more I looked trough the code to find a good solution, the more I realized a need for a complete overhaul of the internal structure. For example, the simpliest change would be just putting the files into a nested directory structure. Great. But you will have duplicated files everywhere. They can still be re-unified using hardlinks, but that should be done offline since lookups with checksummng cause too much delay. And there was still the problem with persistent connections and forks, LWP does not allow connection reusing in forked clients so you get too many server connections. And the logging has been done synchronously and required flock'ing. Acceptable and not very memory-expensive but causes delays on filesystems with some load. So, the final software architecture for apt-cacher that I came up can be described with few characteristics: But first I need to get past my exams period :-( And I hope the final implementation will not become a memory monster, I didn't have the impression that Perl threads are really memory-efficient in the few first tests.

7 March 2006

Julien Danjou: Fern world domination

Pkg-xen-changes r79 - branches
Author: ultrotter
Date: 2006-03-07 09:45:36 +0000 (Tue, 07 Mar 2006)
New Revision: 79
Added:
  branches/20060307-fern/
Branch the latest compiling revision (r71) to a new area...
The name was proposed by Julien, who pointed us to http://en.wikipedia.org/wiki/Fern
I'm still a bit unsure about how it's xen related, but it sounded cool! ;)
You don't know but that the beginning of the world domination of ferns ! AHAHAHA ! ;)

5 March 2006

Uwe Hermann: HOWTO: Anonymous communication with Tor - some hints and some pitfalls [Update]

Warning: Very long post ahead. You have been warned! What? Tor is a Free Software project (revised BSD license), developed by Roger Dingledine and Nick Mathewson, which creates an infrastructure for anonymous TCP communication. From the project website:
Tor is a toolset for a wide range of organizations and people that want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and other applications that use the TCP protocol. Tor also provides a platform on which software developers can build new applications with built-in anonymity, safety, and privacy features. Tor aims to defend against traffic analysis, a form of network surveillance that threatens personal anonymity and privacy, confidential business activities and relationships, and state security. Communications are bounced around a distributed network of servers called onion routers, protecting you from websites that build profiles of your interests, local eavesdroppers that read your data or learn what sites you visit, and even the onion routers themselves.
Tor also allows you to set up and/or use a so-called Tor hidden service, i.e., a server which offers some service (a website, ssh access, or similar) without revealing its IP to its users. Why? Why would you want to use Tor? Well, because you probably don't want anybody (neither state agencies, nor companies, nor "hackers", nor any other individuals or groups) to be able to record, analyze, and (ab)use information about your web browsing habits, or any other communication habits. For instance, you don't want Google to have a complete search-profile of you, which — even worse — might some day get in the hands of other parties. In the days of massive data retention you don't want all your electronic traces to be recorded, stored for ages, analyzed, and data-mined for dubious reasons and with even more dubious results and false conclusions drawn which might negatively affect you. If you're a human rights activist in China, you want anonymous communication. If you're a whistleblower, you want anonymous communication. The list is endless. For securing your communications, so that nobody is able to sniff your emails, your chat messages, your passwords, your private documents and conversations, you use encryption. For communicating anonymously you can use Tor. Combine both, and you have secure and anonymous communication. In case you're wondering whether criminals might abuse Tor, read the Tor Abuse FAQ. Short answer: yes, but if you're willing to break the law, you already have anonymity (open access points, stolen/prepaid mobile phones, etc.). You don't need Tor to do bad things if you're a criminal. If you're one of those horrible "oh, but I don't have anything to hide" guys, consider this: Say you have a drug/alcohol problem and want to visit an anti-drugs/anti-alcohol website or forum for help. Would you want the whole world, your neighbors, your co-workers, your boss, to know that, or would you rather want to keep that a secret? Say you have AIDS and want to get information on the web? Or, to make the example even more dramatic: Would you want some random guys to be able to watch you while you fuck your wife? No? So you have something to hide after all, right? My point is: Everyone has something to hide, even more, it is a basic human right to have the ability to hide something. It's called privacy. How? Tor implements a form of onion routing to, basically, push encrypted data through multiple Tor nodes (servers), before it reaches the final destination (e.g. a website). The result is that neither the website owner, nor a local eavesdropper, nor any single Tor server knows who requested that specific website, hence you are communicating anonymously. For more technical details, read the Tor overview and the Tor documentation pages. In order to use Tor, you have to install and run a local Tor client/daemon (this is not necessarily a Tor server!). On Debian, type apt-get install tor, on other systems you can get the respective binary packages or download the sources and compile Tor yourself. Usually Tor is used together with Privoxy, a configurable HTTP proxy which sanitizes your web-browsing experience by removing nasty banner ads, pop-ups, JavaScript, webbugs, cookies etc. etc. So: apt-get install privoxy. After installing and starting Tor and Privoxy, you can now configure your webbrowser to use Privoxy as an HTTP proxy (see below), and Privoxy will in turn use Tor to anonymize your communication if you add "forward-socks4a / localhost:9050 ." to your /etc/privoxy/config. Anonymizing various applications Most (but not all) of the following information is also covered in the very useful Torify HOWTO in the Tor wiki (I will add the missing information there, ASAP). As I'm pretty paranoid, I have checked every single of these configurations with Ethereal to ensure that the traffic is really anonymized. However, if you are paranoid, you shouldn't trust me, but rather test this stuff for yourself! Warning: DNS Leaks:
The biggest problem with many applications is that they leak DNS requests. That is, although they use Tor to anonymize the traffic, they first send a DNS request untorified in order to get the IP address of the target system. Then they communicate "anonymously" with that target. The problem: any eavesdropper with more than three brain cells can conclude what website you visited, if they see that you send a DNS request for rsf.org, followed by some "anonymous" Tor traffic. The solution: use Tor together with Privoxy, that prevents DNS leaks. Many non-HTTP-based applications are usually torified using a small tool called torify (e.g. by typing torify fetchmail), but often this approach has DNS leaking problems, see below. You might also want to check out toraliases, a small shell script you can source from your ~/.bashrc file. It defines some functions and aliases which transparently direct the traffic of some (but not all!) programs through Tor. Applications which cannot easily be torified Anything not using TCP usually cannot be torified, as Tor only works for TCP. Pitfalls to be aware of More information More information is available in the Tor documentation, the Tor wiki, and especially in the Tor FAQ. In addition, there's an IRC channel on Freenode (#tor), some slides and a video (torrent) about Tor you might find interesting. If you would like to help, you can run a Tor server, donate some money, or volunteer to do other things (code, debug, document, translate, and more). That's it for now. I'm very grateful for comments and suggestions, especially for hints on how to anonymize more applications. Also, if you notice any dumb mistakes I made, please leave a comment. Update 2006-03-07: Fixed typos, added link to the toraliases project (thanks Benjamin Schieder).

Steve Kemp: Another girl, another planet

Are there any good GUI toolkits available for the console, other than ncurses/curses? I’m thinking there must be, but some random google searches have failed to bring up useful leads. (I want to write a simple console GUI for the argo xen monitor - nothing too complicated…) C++ ideally, or C. Perl at a push. Bonus points if it works under Win32. I’ve made a proof-of-concept GUI using zenity + netcat, but now it is time to do it for real … (libctk looked like a candidate, but not much documentation, other than a couple of sample programs. Which don’t compile.)

Aigars Mahinovs: Top 10 libre timewaisters from Debian

This Saturday we had an installfest in LAKA with a topic of free games. It came to me to make my own top 10 of free Linux time wasting games that are packaged for Debian. Here we have the list for future reference: Honorable mention - Battle for Wesnoth: a turn based strategy game with a lot of scenarios for single player and also with multiplayer support.
  1. Enigma - A fine puzzle of precision ball moving around large and complex landscapes with a lot of different of tools and quirks
  1. Bygfoot - A football team manager with a lot of nice extra tools like transfers, injuries, salaries, sponsorship deals and a nice comentary for the games themselves. I only would love to see some kind of an online mode either in runtime mode or in turn-per-day mode.
  1. Blob wars - Funny and bloody as hell. Think Rambo as a bruised blob shooting other blobs and rescuing another blobs. Got a lot of laughs during the presentation.
  1. Pingus - Lemmings clone just with penguins. Nice graphics and control. Looks like there is a lot of levels too. Wonderful intro.
  1. LiquidWar - A very addictive and abstract game of liquid domination. Nothing much to explain - just play it with your friends or against a bunch of AI players.
  1. Tecnoballz - Arcanoid on steroids ... x4 ... with a shop ... and bosses ... and ballz ... lots of ballz. Must see.
  1. Scorched3D - The best 3D graphics I have ever seen for a free software project. Same old addictive blowing stuff up with nukes that we all love since Scorched Earth and Worms. Gameplay is better then the latest Worms. Great multiplayer fun. I only with the camera would be more intelligent.
  1. Frozen Bubble - instant classic of free software gaming. Wit and precision required. Fun supplied.
  1. Neverball - Great graphics. Wacky gameplay. Tilt the world with your mouse. Do not fall off. Try the harder levels for even more fun.
  1. Powermanga - Just plain fly and shoot. With powerups. Lots of powerups. Especially note the last powerup that upgrades your ship to a new model which has new weapons to upgrade. Waves and waves of enemies with an occasional big boss. Sadly no multiplayer.
Note: sometime later this week I will also add screenshots to the list.

Lars Wirzenius: Random thought: Mice hands

Jordi writes about the lack of left-handed mice. I feel his pain, having been there. Many years ago, I decided to start using a mouse with my left hand, even though I'm primarily right-handed. The basic reason was that with a normal keyboard, you have to move your hand a long way over the cursor keys and the numeric keypad to get to the mouse. With the left hand, it's just there, a few centimeters away. Much nicer. The fact that I could use cursor keys or the keypad while using the mouse was an added benefit. About ten percent of all people are left-handed, and that's a pretty hefty piece of the entire market. If I were a mouse maker, I'd do my best to satisfy it. If I was a radical type of person, I'd suggest a letter writing campaign. Incidentally, it only took me a couple of days to switch mouse hands, but I never got as quick and precise with my left hand as I was with my right hand. I don't think it is acceptable to tell left-handed people to just switch to using a mouse with their right hand. (These days, I only use my laptop's touchpad.)

3 March 2006

Wouter Verhelst: Scientific studies on Open Source

It's strange, but ever since I have been a Debian Developer, people start assuming I'll be interested in any random study. They'll put up a web page (which often doesn't even validate), and then start asking strange questions that have no link with reality whatsoever. On the one hand, I have better things to do than to cooperate with random studies from people I've never heard of before and probably never will hear of again. On the other hand, only by understanding will people see the light, and only by cooperating with such studies will one help people understand. But seeing the same mistakes over and over again is annoying me. So, here's Wouter's HOWTO perform a study on Open Source or Free Software (and get away with it without annoying people) That's the most important bits, I guess. I'll probably add more in the future, if I see more things that annoy me. But for the time being, if you break three or more of the above rules, don't expect me to participate—I have better things to do with my time than to help every undergraduate on this planet with his or her study

2 March 2006

Gergely Nagy: The Switch(tm)

The webserver I've been running for the past year or two, my own creation, had been acting strangely lately. It got stuck at times and refused to serve requests. I knew of the problem for some time, but due to time constraints, I haven't touched the code in a very long while. Therefore, the problem never got fixed - and as it stands, it never will be, as I've given up working on Thy (and pretty much everything else), until I finally finish my studies. Originally, thy was written because the machine that powered my domain was not strong enough to run apache. The hardware got replaced about two times since then, and the current one is adequate enough, and the switch was made: I'm now running Apache 2.0. A few rough edges still remain - like SSL is not configured yet at all, but other than that, I think everything else that used to work, still works.

1 March 2006

Jordi Mallach: He's Welcome in Pakistan

I would have thought that three years after the start of the war, Iraq would be yet another forgotten war, as it tends to happen when murder, bombings, famine and corruption become the routine in some country or area. It's been nearly three years since the holy coalition made up of United States and the UK, with a selected group of allies which included the Spain of our beloved Aznar, invaded the country to save the poor iraqi people from the fierce Sadam. After a few months of hard fight against the bloody dictator, Iraq would finally be able to live in peace and Democracy, and the world would understand the goodness behind the reasoning that made the superpowers start the second war in Iraq, against the opinion of the UN security council and an overwhelming majority of the people in the planet. Today, after years of bloodbaths in different parts of Iraq, we're witnessing the start of a civil war. I hope the mass media stop talking about "the terrorists" now, because what's been going on for the last week is random people against random people. It makes me sick to think how bad the near future looks in Iraq. All of this happened in the name of freedom, or so they said. And then, it was in the name of the War on Terror , because Iraq was infested with terrorists (they never told us how they planned to stop that from happening). In the meanwhile, little they talk about the most wanted man on earth, uncle Osama. Today's edition of EL PAIS includes a translation of an article by Ahmed Rashid in The Washington Post's edition of February 26, apropos of George Bush's visit to Pakistan and Afghanistan this week. He's Welcome In Pakistan is surely worth a read; I'm sure Miguel will enjoy.

Adam Rosi-Kessel: Nowhere to Go in Downtown Boston

Earlier this week, my cousin, who is a medical resident in New York City, came to visit my office in Downtown Boston after work. After giving him a quick tour of my office, we thought we’d chat over a cup of coffee. I’m not aware of any locally-owned downtown cafés or coffee shops, so we thought we’d have to settle for a Starbucks. The Starbucks across the street from my office, however, had just closed at 6pm. Although I’d been to the Peet’s Coffee around the corner dozens of times, it wasn’t until I actually tried to go there with my cousin that I realized that they don’t have any seating. We attempted to go to five other similar venues, and they were all either closed or without seating (including an Au Bon Pain right near Downtown Crossing that just has a walk-up counter). Finally, we settled for a Dunkin’ Donuts that had two tables and was open for another half hour. The staff were busy mopping up and listening to a loud radio that was half-tuned to pure FM static. I realize Downtown Boston isn’t the most residential area, but aren’t there other people who want to meet up after work at some place other than a bar? Isn’t this supposed to be a world class city? What about all the luxury condominiums that have been built recently in walking distance to the financial district… is it all a fiction? It’s times like this that I have to admit feelings of New York envy.

28 February 2006

Jonathan McDowell: No FOSDEM for me.

Bah. All these people back from FOSDEM posting about having had a great time. And Dominic got engaged! I'd have liked to have gone to FOSDEM this year, but it clashed with Christmas and someone had to stay in the country to mind things (Dominic and Simon both went, so I drew the short straw). Plus I decided not to go to Debconf this year; although I've enjoyed the past 2 years I couldn't really justify the cost of flights. And I'll no doubt need time off around the wedding, but I made the decision not to do Debconf before we got engaged, so that wasn't quite so big a factor. However I now find myself lacking in geek events this year. I'm sure there'll be the usual Linux Expo stuff, but I've been considering the UKUUG Linux conference, which people have said good things about in the past. Is there anything else in the UK I should be considering? I did get some hacking done this weekend however. Mark Underwood got 2.6.15 booting on the Amstrad E3 videophone to the point of USB and serial working. So I spent a while trying to figure out where Amstrad had hidden the NAND flash and managed to write a driver for it. I'm all chuffed with myself; my E3 now has a JFFS2 root filesytem. I also mapped out the keys on the keypad and tried to get the LCD working, but although I can get it to light up (the easy part) it doesn't actually seem to want to output anything. Bah. You can find all the bits you need at http://the.earth.li/pub/e3/ - both Mark's original stuff and my patch on top of that are there. Oh, and the list at http://www.earth.li/cgi-bin/mailman/listinfo/e3-hacking is a useful place too. (And yes, I know Christmas is in December, but I have a yearly Christmas meal with the people I lived with in my final year of university, but it can take so long to find a weekend we're all free that it's often nowhere near Christmas by the time it happens - February is pretty good going for us!)

Aigars Mahinovs: Migrating from Blogger to your own Mnemosyne blog

As I decided to migrate my blog from blogger.com to my own blogging software on my own domain, I did not want to leave my old posts behind. As I had more then 150 of them, I had to do some automation to do that within my lifetime. The first step is to get the data from Blogger.com database to somewhere where you can access it in full. You will need FTP or SFTP access to a computer with a real IP address. The idea is to go to blogger.com and specifiy that you want to switch storage of your blog pages from their blogspot.com service to your of FTP or SFTP server. You will have to provide server address, URL, folder, username and password. URL does not matter at this point, but other parameters define where your data will be dumped to. Save the changes and republish the blog. After a few dozens of minutes all your data will be at your server in a set of complete html files. Now we need something that will parse those html files and write out something that your blogging software can understand. As I use Mnemosyne, my format is a set of mail message files. To allow me to use HTML formatted messages in my blog (and not only reST) I added this to my config.py:
class EntryMixin:
   def _init_content(self):
       """Read in the message's body, strip any signature, and format using
       reStructedText unless X-Format=='html'."""
       s = self.msg.get_payload(decode=True)
       if not s: return ''
       try: s = s[:s.rindex('-- \n')]
       except ValueError: pass
       body=False
       try:
               if self.msg['X-Format'] == "html":
                       body = s.replace(" ", " ")
                       body = re.sub(r'&(?!\w 1,10 ;)',r'&',body)
                       body = xml.dom.minidom.parseString("<div>"+body+"</div>").toxml()
       except KeyError:
               pass
       except xml.parsers.expat.ExpatError, e:
               print "W: Parse failed for "+self.msg['Subject']+" at "+self.msg['Date']+" from "+str(int(time.mktime(time.strptime(self.msg["Date"],"%a %b %d %H:%M:%S %Y"))))
               print xml.parsers.expat.ErrorString(e.code), e.lineno, e.offset
       if not body:
               parts = docutils.core.publish_parts(s, writer_name='html')
               body = parts['body']
       self.cache('content', body)
       return body
This will try to parse messages as pure xHTML if custom header "X-Format" is set to "html" in the blog entry. There is one problem with this approach - xHTML must be valid, otherwise XML parser in Kid templating engine will fail and there will be no end of trouble. That is why even in HTML mode we reparse the body to XML and back to string again. If we get a parsing error at that point, we fall back to reST parser. Now we need something that will analyse our Blogger.com generated HTML files and get our content from there. Here is the script that I used:
#!/usr/bin/python
import os, os.path, time, sys, glob, re, xml.dom.minidom
id = 1
host = "old"
mdate = re.compile( r'\">(\d+) (\D+) (\d+)<' )
mbody = re.compile( r'</div>(.+)<div style=' )
mfooter = re.compile( r'<a href=\"http://example.com/(.+)\" title=\"permanent link\">(\d+):(\d+)</a></em>' )
files = glob.glob("old/*/*/*.html")
for file in files:
       year = 0
       month = 0
       day = 0
       hour = 0
       minute = 0
       subject = ""
       oldurl = ""
       body = ""
       date = ""
       title = ""
       footer = ""
       f = open( file, "r" )
       status = 0
       for l in f:
               if status == 0:
                       if l.find('class="date-header"')>0:
                               date = l
                               status = 1
               elif status == 1:
                       if l.find('class="post-title"')>0:
                               status = 2
                       if l.find('class="post-body"')>0:
                               status = 4
               elif status == 2:
                       if len(l.strip()) > 0:
                               title = l
                               status = 3
               elif status == 3:
                       if l.find('class="post-body"')>0:
                               status = 4
               elif status == 4:
                       if len(l.strip()) > 5:
                               body += l
                       if l.find('padding-bottom: 0.25em;')>0:
                               status = 5
               elif status == 5:
                       if l.find('posted by ')>0:
                               footer = l
                               break
       f.close()
       rdate = mdate.search( date )
       rbody = mbody.search( body )
       rfooter = mfooter.search( footer )
       year = rdate.groups()[2].strip()
       month = rdate.groups()[1].strip()
       day = rdate.groups()[0].strip()
       subject = title.strip()
       body = rbody.groups()[0]
       body = "<p>"+body+" </p>"
       body = re.sub(r'<img([^>]*?[^/])>',r'<img\1/>',body)
       if subject == "":
               subject = re.sub(r'<br.*?>','\n', body)
               subject = re.sub(r'</p.*?>','\n', subject)
               subject = re.sub(r'<.*?>','', subject)
               subject = subject.strip()
               line = subject.find('\n')
               if line > 45:
                       subject = subject[:40]+"..."
               else:
                       subject = subject[:line]
       oldurl = "http://oldblog.blogspot.com/"+rfooter.groups()[0].strip()
       hour = rfooter.groups()[1].strip()
       minute = rfooter.groups()[2].strip()
       mtime = time.mktime(time.strptime(day+" "+month+" "+year+"  "+hour+":"+minute, "%d %B %Y %H:%M"))
       outname = str(int(mtime))
       while os.path.exists( outname+"."+str(id)+"."+host ):
               id += 1
       outname = outname+"."+str(id)+"."+host
       out = open( "entries/new/"+outname, "w" )
       out.write("Date: "+time.ctime(mtime))
       out.write("\nSubject: "+subject)
       out.write("\nX-URL: "+oldurl)
       out.write("\nX-Tags: untagged")
       out.write("\nX-Format: html")
       out.write("\n\n")
       out.write(body)
       out.close()
Here I parse the HTML files using a simple state automata and then assemble all the data that we need to have, like timestamp in filename and Date field. In this script it is assumed that in the current directory there is "old/" directory with subdirectories like "2005", "2006", ... which have subdirectories for months in which there are xHTML files for individual posts. The output is written to "entries/new/$timestamp.$id.$host" files. After running this script and then running mnemosyne you will see a bunch of messages about failed parsing of some messages. That shows you where your xHTML is not valid. The usual problems are html entities ( like &euro; ) that the parser does not recognise and lack of closure on img or br tags:
This will fail because of &euro;
<img src="smile.png"> will fail, it must be <img src"smile.png"/>
My import script fixes img and br tags, but for other problems there is not much choice but going trough the entries and fixing them up manually. Also later on, if you will want to paste some custom HTML into your post, you will have to mark the whole post as HTML mode post and also check if you pasted HTML is valid XML manually. There are some other fun things in this blog, but I will go into that in later posts.

Simon Richter: Why I should have stayed in bed today

Now despite a huge campaign designed to boost morale in Germany, which must have cost a lot of our tax money and mostly supported the domestic recording and advertising industries, people still do not find working on a day that is a holiday in some other part of Germany very appealing. While I cannot blame them really, I'd still have been interested in being told in advance that noone was going to be selling food today, rather than being surprised by a large sign that I swear wasn't there yesterday. And as everybody on the train has to be dressed up for carnival to justify not working today, the entire scenery reminds me of the depressing kind of clowns. While I don't oppose happiness in the slightest way, I cannot stand the organised form, and am actually looking forward to 12 AM, when the first and foremost duty of every police officer in this town becomes inhibiting further parties.

Lars Wirzenius: Random hacks: DVD ripping with .desktop files

I watch movies and other DVDs on a computer rather than by using a dedicated DVD player box. For various reasons, it is more comfortable to watch a movie by first copying it on a hard disk. For example, often vobcopy will be able to rip it even though there are scratches or other errors. Watching directly from the DVD will fail or be painful, because of frequent stops. The command to rip a DVD is vobcopy -m. I wrote a little script around that that also creates a .desktop file so that I can just double-click on it to start Totem. Double-clicking on the directory opens a new Nautilus window, which is not useful for viewing a movie.

Lars Wirzenius: Random thought: GNOME Typing Monitor induces housework

I have a tendency to sit statically for too long when using my computer, and this hurts my back. To force myself to have breaks, I use GNOME's Typing Monitor, set at a five minute break after 60 minutes of use. This seems to work fairly well. An unexpected result of this is that those frequent breaks are a great time to do housework, like putting things in their proper place, wash some dishes, or such. Nothing major, but a little bit every hour makes a significant difference.

27 February 2006

Julien Danjou: About Xen in Debian

Some people may have noticed that a thread has recently started about Xen on debian-devel. To sum up the whole story, here it is. Guido Trotter and myself asked Adam Heath, the current official maintainer of Xen, if it was possible to help him (bug #342249) to package Xen 3.
He did not answer to our messages, as he seems to be MIA, so we started with Jeremy Bouse, Ralph Passgang and Yvette Chanco to work and we created a project on Alioth in order to package the latest release. We started our development from the package Ralph made previously. We don't know really why, but Bastian Blank, from the Debian kernel team, uploaded his own package of Xen 3, ignoring our request to work on our side, arguing that this was the work of kernel team to maintain Xen. It seems that actually, the kernel team only pretend to maintain the Dom0 and DomU kernel images, probably as soon as Xen in included in the vanilla kernel, and that Bastian took the decision alone to maintain the hypervizor and userspace tools. Today, we have functionnal and splitted packages of Xen 3, available on the Subversion repository. I made Xen packages with the latest development version of our packages and the Xen testing version. They are available from:
deb http://naquadah.org/~jd/debian/xen stable main
Official backports will be uploaded to backports.org as soon as we will have uploaded a version to sid. But for now, we have to cancel or bypass the upload Bastian made...

Next.

Previous.