Search Results: "erich"

12 January 2007

Gunnar Wolf: Configuration files for humans and for computers

Erich wonders about a sane way to reorganize the configuration file mess we have, going in fact farther than Aigars' previous rant on the topic: Not only it would be really desirable to do away with the dotfile-as-everything-but-more mess, it would be really, really nice to do it in a more or less standard way. Erich suggests four base configuration syntaxes - I won't reveal too much, as his message deserves being read as well ;-) But hey, I have a question here:
I know XML is well-established and well-supported, and I'm told there are a couple several hundred thousand people who think it is really cool and even human-editable. Still, I hate XML. Configuration files are often, yes, written by the programs themselves - But one of my most beloved features of Unix-like systems is that I am free to poke in them, as they are meant to be human-editable.
XML is not human-editable. I'm sorry, say whatever you want, but keeping XML valid and happy is... Just not for me. Why not pushing instead something prettier, and with almost the same feature set of XML, plus a much-enhanced readability/modifyability? Why not promoting my dear and beloved YAML? (Yes, the YAML project home page _is_ valid YAML)
Note: No, this only looks like a rant, but it is really a question. Honest!

Erich Schubert: RDF representation of packages?

I wonder if we should do some RDF representation of packages - especially including dependency data. That way we can maybe use some RDF reasoners to query our data, and maybe extract some interesting information. On the other hand, people with interest in RDF to use our real-world data for their experiments, and maybe we get something back from them. There is a couple of package metadata we currently are not tracking inside the actual archive, but in different places. Including licensing information (debian/copyright), homepage location (on packages.qa.debian.org), download location (debian/watch) - it would be nice to aggregate these into some RDF store, and export them somehow. For most of the package information (especially dependency information), we'll have to write our own ontology (I wonder if we can map version numbers to some standard rule language, or if applications will need an external reasoner to process them?); for some things we can reuse the FOAF (Friend-of-a-friend) or DOAP (Description of a project) ontologies. The first is rather common for describing people, people-people and people-thing relationships; the latter was designed for describing opensource projects (but won't be directly applicable to packages of a project). I've blogged about my RDF export of Debtags data before; the canonical first step would actually have been to export the package data, and enrich it with the Debtags collected data... Note that RDF is designed in a way that you can have one site provide metadata for another site. For example, the Debtags RDF export contains "category" information for Debian packages, but does not contain e.g. the description of the packages it talks about via an URI. So there is nothing wrong from a RDF point of view of keeping e.g. the licensing, watch or homepage data separate. For the Google Summer of Code, there was a proposal including "collaborative repository of meta-informations about source packages (CRMI)"; but the first part of the proposal, the "distribution wide tracker tool (DWTT)" showed to be a bigger task than expected. But maybe we'll still see CRMI at some point, and maybe we can have it provide an RDF export of data (using a semantic wiki might be a good starting point for CRMI maybe?). [P.S. this blog posting maybe belongs more into the en/linux/debian category. But only the xml category is also syndicated on planet.XMLhack, and I want this post to go there to reach more RDF users. I really need to switch my blog to some software which supports tagging...]

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.

Erich Schubert: Configuration file mess

Aigars Mahinovs mentioned that it would be nice if applications would not clutter the home directory with their config files as much. I agree a lot. Dotfiles for configuration suck badly. If you start a new application (or if you are in an early stage and have a small userbase), please follow the Freedesktop.org XDG base directory specification. I.e. use .config/applicationname instead of .applicationname for configuration files (unless an overriding environment variable is set), and .local/share/applicationname for data files. And for cache files, use .cache/applicationname (anyone writing a patch for firefox?) What I'd also like to propose is to reduce the number of different configuration file syntaxes. It sucks having to find out which syntax an application uses again and again, because every application is different. We probably won't be able to convince everybody on one format, but we could maybe cut it down to, like 3 formats, please? There is no reason that one application needs to start comments with "#" and another with ";" while a third application uses "//" but doesn't allow "/* comment */"... A small set of syntaxes (preferrably with standardized parsers) should be good enough for just about every application: If we had just these few syntaxes and an appropriate schema description language, we could write generic configuration file editors. That would be very nice. Also we avoid having config file parser bugs by using libraries, and if someone prefers using e.g. gconf or dconf, this could be handled by the library, transparently for the application. (Note that many application lack error handling when writing their configuration files, especially when the disc is full... - they really should be using a library. IIRC xchat also has some bugs of this kind, I remember having tried to patch some of them once when we were preparing for the sarge release, just to find out that there might be many more of them...)

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...

10 January 2007

Erich Schubert: Linux distributions to be illegal in Germany?

The biggest party in Bavaria and part of the current german government, CSU, has announced that they want to make the "production and distribution of killer-games" illegal in germany. They claim it's because of a recent highschool shooting (no fatalities except the shooter; there was one other highschool shooting in germany a few years ago with 16 fatalities. Yes, that is 17 fatalities in over 40 years, the 42 years old amok runner back then didn't play killer games, I guess, although he used a flame thrower...). This would make the production and distribution in Germany unlawful, since we include games such as overkill, tremulous and openarena. Other distributions such as SuSE probably include some games that classify as "killer games" as well. Also note that "distribution" is a rather wide term. Does it apply to web sites? ISPs? If there is an online killer game, is the ISP "distributing" it? Polticians (especially those from CSU/CDU/SPD) are such a bunch of idiots. Please do NOT ever again vote for CSU. Software patents, killer games, "Problemfrauen & Schadbären", surveillance cameras and other surveillance, military inside germany (note that in desaster cases such as the flooding some years ago we could already deploy soldats without extra laws), shooting down of civilian airplanes, transrapid, reducing math and natural sciences in highschools, "google earth threatens worldcup security", police installing trojans on home PCs (because criminals don't install virus scanners?), kicking "irritating" students out of school, study fees, ... Often they make George W. Bush look like a genius, don't they? They don't do any important stuff, but just say whatever a majority people might want to hear. They waste our money (Transrapid). They destroy our biggest resource (changes in school system and university system, which will reduce average knowledge in germany a lot). They do lots of stupid things, which heavily invade privacy or public safety (military, surveillance) with no benefits in safety and many of which even where only stopped because they violated our constitution. Do not vote for them! [Updates: Daniel, sorry for posting a non-english post to planet. I again put it into the wrong category; I intended to do a longer post (this one) in english later on. For clarification: CSU is the sister party of CDU, these parties have an arrangement not to compete by region and are closely affiliated. On the nation-wide level they have a joint list, which often is called CDUCSU. So they're not just an "affiliate", but a strong part of the ruling party. Holger Levsen pointed out we are likely going to violate some laws much earlier by distributing ("hacker-") tools such as nmap, ettercap or whireshark.]

Daniel Burrows: The US isn't the only country with crazy politicians

[UPDATE 2007-10-01 22:43: It appears that Erich wrote an expanded and better-translated post while I was at work]

Erich Schubert writes that
Nach aktuellen Pl nen der CSU w re der Vertrieb von Debian GNU/Linux illegal.

Auch zahlreiche andere Distributionen w hren wohl davon betroffen: Alle, die sogenannte "Killerspiele" vertreiben...

For non-German speakers, I provide the following approximate translation:
CSU wants to make Debian illegal

The current plans of the CSU [Christian Social Union] will make the distribution of Debian GNU/Linux illegal.

In addition, many other distributions will be affected: specifically, those that distribute so-called "killer games"...

For instance, Overkill (Debian also includes, e.g., Tremulous and OpenArena, which are based on the Quake3 engine and have 3d graphics...)

(hopefully I got the gist of Erich's post without mangling it too badly!)

What I don't know is how serious this is. The CDU (Christian Democratic Union) is IIRC the current ruling party in Germany; however, according to Wikipedia, the CSU is some sort of local affiliate in Bavaria. Does it have the clout to get this proposal made into law?

Holger Levsen: killergames and hackertools

Erich, it's not only killergames which threatens the legal distribution of linux in germany, but also hackertools like ping, ethereal or nmap. Check out this article (german only), which explains the new law which will come into effect in germany on the 15th of march this year.

Obviously you need hackertools, to be able to check if you're system is secure or vulnerable, but unfortunatly common sense is a lost art nowadays.

More maybe later, I'm in a hurry, but I at least wanted to make this remark. More discussion and evaluation of this is definitly needed!

Erich Schubert: CSU will Debian illegal machen

Nach aktuellen Plänen der CSU wäre der Vertrieb von Debian GNU/Linux illegal. Auch zahlreiche andere Distributionen währen wohl davon betroffen: Alle, die sogenannte "Killerspiele" vertreiben... z.B. Overkill (wobei Debian auch noch z.B. Tremulous und OpenArena enthält, die auf der Quake3 engine basieren und 3D Grafik haben...)

9 January 2007

Erich Schubert: SVN $Date$ to ISO 8601 in XSLT

I'm keeping my homepage in a SVN repository; I'm using the $Date$ variable to automatically track the last modification date (though it will also change on minor modifications). For the HTML "Date" meta tag, the W3C recommends using ISO8601 date format. This is the (non-XSLT-2, so no regexp) hack I use for conversion:
<xsl:value-of select="concat(substring($string,8,4),'-',substring($string,13,2),'-',substring($string,16,2),'T',substring($string,19,8),substring($string,28,5))" />
Did I mention I hate XSLT? It's lacking so many standard functions, like date-time processing, regular expressions, exceptions, ... - granted, a lot of stuff was added for XSLT2, but it still sucks badly. Especially the syntax. Here's how to format the date according to RFC 2616, as used in the last-modified meta tag and HTTP/NNTP/SMTP headers:
<xsl:variable name="day" select="concat(substring($string,8,4),'-',substring($string,13,2),'-',substring($string,16,2))" />
<xsl:variable name="time" select="substring($string,19,8)" />
<xsl:variable name="timezone" select="substring($string,28,5)" />
<xsl:value-of select="date:day-abbreviation($day)" />
<xsl:text>, </xsl:text>
<xsl:value-of select="date:day-in-month($day)" />
<xsl:text> </xsl:text>
<xsl:value-of select="date:month-abbreviation($day)" />
<xsl:text> </xsl:text>
<xsl:value-of select="date:year($day)" />
<xsl:text> </xsl:text>
<xsl:value-of select="date:time($time)" />
<xsl:text> </xsl:text>
<xsl:value-of select="$timezone" />
Note that this does not include any error handling and is not very robust. You also need an XSLT processor with some of the ">">">http://exslt.org/dates-and-times extensions such as xsltproc. (Which unfortunately doesn't do XSLT2 yet and doesn't have a regexp extension). [Update: Joel Wreed pointed me to his libxslt plugins, a regexp and a exsl.org/dates-and-times plugin. These would help a lot, though IIRC the date-parse exsl.org spec doesn't support the date format I'd need. (So I can't just say date-format(date-parse(...),...)). Also he said that they basically are unmaintained right now. It would be nice if they could be merged into libxslt, though...]

Erich Schubert: Scripting with NetworkManager and network/interfaces

Debians /etc/network/interfaces is a powerful way to setup multiple profiles; NetworkManager is a pretty UI for managing your network. However they don't play well together: NetworkManager will ignore devices managed via network/interfaces. However, NetworkManager lacks a couple of important options, including static IPs and several wireless options; I can't connect to my universities WAP2 network using NetworkManager because of some missing options. This is why I wrote this small script:
#!/bin/sh
# disable network manager:
dbus-send --system \
  --dest=org.freedesktop.NetworkManager \
  /org/freedesktop/NetworkManager \
  org.freedesktop.NetworkManager.sleep
sudo ifup eth1=eth1-lrz
My /etc/network/interfaces contains a working setup for my wireless named "eth1-lrz"; since this differs from the real device name, this works fine. Running this script will tell NetworkManager to disconnect and instead setup the wireless for my university network. When connecting to a different network, I only have to do "ifdown eth1" and then click on the NetworkManager applet to enable it again. (would be "org.freedesktop.NetworkManager.wake")

4 January 2007

Erich Schubert: Web 2.0 security issues incoming

As demonstrated by the gmail contacts list hijack attack, web 2.0 technologies are quite vulnerable for attacks. And while GMail has a rather good security record, cross-site-scripting is the security issue to watch out for. Especially since many web2.0 sites deal with sensitive data (especially data you probably shouldn't have given them in the first place...) this is rather interesting. It's not new (mind you, the whole web 2.0 thing is not new), but it's being used heavily now, and a lot by people who don't pay enough attention to security. The whole web 2.0 thing is quite naive, mind you. I expect to see more attacks of this type to surface. And in the long run I think we'll either need to use some web interface specification language (so the browser only allows whitelisted access; think robots.txt) or new security filters in browsers will break most (if not all) mashups. Maybe it would be best to add some real WSDL/SOAP code to the Javascript core (and in this process add all the stuff the monster javascript libraries around have been adding, effects, event queues, sane callback handling, getElementById shortcuts etc. - it just doesn't make sense to download the same 200k Javascript from a dozen sites. Dojo, Mochikit, Prototype, ...).

3 January 2007

Erich Schubert: Debtags RDF export

I've set up some simple RDF export (gzip only, please add caching yourself!) for the Debtags data. The export is using the DOAP ("Description of a project") vocabulary, though it isn't optimal (we're not talking about separate projects, but multiple packages may belong to the same). The format of the RDF file may (and will!) still change, for example I'd like to have some explicit URIs for the packages instead of just storing it in the name tag. Suggestions for a matching vocabulary / serialization are welcome. But if you want to play around with some real-life data, just grab a copy. There is a couple of interesting things you can do with it, such as my folding tag cloud. So go ahead, and play around with it a bit.

31 December 2006

Erich Schubert: Freeze progress

... is pretty bad. So far, only four applications (i.e. much less than 1% of all packages) have been renamed to ice* (i.e. frozen!): Iceweasel, Icedove, Iceape and Icedax. Or did I miss something? P.S. All your freeze are belong to us. P.P.S. Stupid SUV drivers delaying our freeze. Your CO2 production causes the climate to change, which makes freezing much harder!

27 December 2006

Erich Schubert: The "bug not found" bug?

Congrats to Felipe C. for the Bug-not-found bug (aka: the bug with the magic number 404 404) :-) And thanks for the spanish translation.

26 December 2006

Erich Schubert: Whining developers

Here's my contribution to the next DWN:
Some developers continue to whine in inappropriate places [1] about others being paid by Dunc-Tank for their work on Debian.
[1] http://www.debian.org/News/weekly/2006/42/
Would you please cut down your childish behaviour a bit more? Can someone else maybe step up and do DWN instead? I'm sooo getting tired of this (and you). (Granted: at least you didn't claim that everybody is demotivated because of this, or that it delayed the etch release. Thats why I added the "more" in the previous paragraph; also what you wrote is likely correct - I can't judge your true motiviations, if you are actually demotivated or if you just don't like AJs hair color.) It's a very subjective point of view, and while somewhat marked as such ("because its editor can't ignore other duties while the Debian project is indirectly paying some developers"; however there are six editors listed at the end!) I find it inappropriate to put this into DWN (which should try to be obejctive). To me, it's just another lame attempt of you to voice your disagreement with Dunc-Tank (again, note that you have been heard by the whole community, there is no censoring being done) in an unfair way (because I couldn't voice my opinion in the same place). Did you at least talk about this paragraph with the other "editors"? (Note: I'm not directly pro dunc-tank, and I find the way AJ introduced it not too appropriate; my suggestion would have been to ask him kindly to step down from having a position in the dunc-tank board. However I'm certainly not demotivated by it, but I find it both good that key people of Debian are being paid without having additional responsibilities to some company, and that there is now a way to donate to Debian that won't just eventually maybe be used for something, but where I can clearly mark it for.)

Erich Schubert: Whining developers

Here's my contribution to the next DWN:
Some developers continue to whine in inappropriate places [1] about others being paid by Dunc-Tank for their work on Debian.
[1] http://www.debian.org/News/weekly/2006/42/
Would you please cut down your childish behaviour a bit more? Can someone else maybe step up and do DWN instead? I'm sooo getting tired of this (and you). (Granted: at least you didn't claim that everybody is demotivated because of this, or that it delayed the etch release. Thats why I added the "more" in the previous paragraph; also what you wrote is likely correct - I can't judge your true motiviations, if you are actually demotivated or if you just don't like AJs hair color.) It's a very subjective point of view, and while somewhat marked as such ("because its editor can't ignore other duties while the Debian project is indirectly paying some developers"; however there are six editors listed at the end!) I find it inappropriate to put this into DWN (which should try to be obejctive). To me, it's just another lame attempt of you to voice your disagreement with Dunc-Tank (again, note that you have been heard by the whole community, there is no censoring being done) in an unfair way (because I couldn't voice my opinion in the same place). Did you at least talk about this paragraph with the other "editors"? (Note: I'm not directly pro dunc-tank, and I find the way AJ introduced it not too appropriate; my suggestion would have been to ask him kindly to step down from having a position in the dunc-tank board. However I'm certainly not demotivated by it, but I find it both good that key people of Debian are being paid without having additional responsibilities to some company, and that there is now a way to donate to Debian that won't just eventually maybe be used for something, but where I can clearly mark it for.) [Yes, I am aware that others are just as annoyed by my responses to Joey&co. Especially when they happen to agree with him. Nevertheless he maybe shouldn't be abusing DWN!]

25 December 2006

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

Erich Schubert: On memory protection

Merry Christmas! I'm catching up with some RSS feeds, including the Linux Weekly News (LWN). This is a high-quality news site for Linux, and being issued just weekly is a nice feature for all those suffering from information overload. They had an interesting article some weeks ago on Virtual Machines and Memory Protection. If you are interested in system and application security, this is an interesting read. SELinux has permissions called "execmem" and "execstack". Basically these allow applications to map some memory executeable, or execute their own stack. Back in the assembler days, some techniques relied on this, but it has lately become frowned upon: most buffer overflow and other attacks used by viruses and worms relied on an executable stack or memory. Recently, Intel and AMD added support for "non-executable" bits for memory maps, i.e. hardware support to enforce these permissions; this was sold as an achievement in application security. Though this is mostly true - tons of attacks rely on this permission - it's not that easy. Modern programming languages such as Java and C# rely on so called Just-In-Time compilation for fast execution. (And future version of perl and python will probably do that, too.) And JIT requires executable memory, because it basically compiles the VMs bytecode into (optimized) machine code, and executes it. Now you could say: okay, let's just grant mono and java the execmem permission; (which is also what SELinux does) - and this will probably be okay unless there is some grave error in the mono or java runtime. Or any other native library they use. And this is where the problems start: both Mono and Java rely to a certain extend on native libraries. For example the GTK libraries for the UI. Mono applications can also use gstreamer, gnome-vfs, zlib, libpng, libjpeg, ... That means, security issues in these libraries that need execmem and would not work on native applications can suddenly be exploitable in mono and java apps. Since we can't do without execmem for Java and Mono: the executable bit for memory does add some extra layers, but doesn't give you full protection from this kind of attacks, sorry. No magic "my computer is no longer hackable because I have the NX bit".
With an NX Bit capable operating system such as Windows XP SP2, harmful viruses are stopped before it can cause any damage to the system.
... unless you're using .NET or Java applications.

24 December 2006

Erich Schubert: A Web2.0ish christmas to all!

Check out the first web 2.0 christmas card (and hopefully the last, ever!). Sorry, I just could not resist doing that... mocking web2.0 on christmas. Merry christmas to everbody!

Next.

Previous.