WEBlog -- Wouter's Eclectic Blog

Thu, 20 May 2010

Dear lazyweb,

Can I instruct inkscape somehow that I do not want antialiasing to be used when I ask it to export a bitmap? Reason being that for what I'm trying to do, I need to limit the amount of colors used, and anti-aliasing adds quite a number of values that I don't want to be added.

Thanks,

Mon, 19 Apr 2010

Re: Kerberos and LDAP

Petter Reinholdsen asks about Kerberos and LDAP.

While I'm not sure about an implementation that does just the ACLs in LDAP, there are several implementations that support having the kerberos principals stored in LDAP (i.e., heimdal has supported it for ages, and MIT Kerberos implements it since fairly recently, too). This allows not only for easy replication of the principals to a secondary KDC; it also allows for using LDAP ACLs to decide who gets to create and maintain users.

In addition, there's supposed to be an OpenLDAP overlay that allows for updating the Samba and/or heimdal hashes in an LDAP directory when the OpenLDAP 'change password' extended operation is used, thereby making it somewhat easier to keep passwords in sync.

I should note that I've never tried any of the above, though.

Fri, 04 Dec 2009

Dear lazyweb,

Following my disagreement with sony, I managed to convince my brother that swapping my PS3 for his is a good idea, so now I have a PS3 running Debian, and the fun can start.

Of course the reason why I wanted this machine in the first place was to hack for it, so that's what I'm trying to do now. If only a split-brain processor was something that automake would understand...

How do I make automake understand that it needs to do this?

spu-gcc -o foo-spu foo-spu.c
embedspu foo_spu foo-spu foo-spu.o
gcc -c -o foo-ppu.o foo-ppu.c
gcc -o foo foo-ppu.o foo-spu.o

I tried a Makefile.am like this:

bin_PROGRAMS = foo
foo_SOURCES = foo-ppu.c foo-spu.c
%-spu.obj: %-spu.c
	$(SPUGCC) $(SPUCCFLAGS) -o $@ $^
%-spu.o: %-spu.obj
	embedspu $(subst .,_,$<) $^ $@

... but that doesn't work, since automake inserts a more specific foo-spu.o target that uses $(CC). It only works if I then manually run 'make foo-spu.obj', before running 'make foo'. Obviously we don't want that.

Any help would be greatly appreciated.

Update: understood why some bits didn't work, and clarified here what the real problem was.

Wed, 18 Nov 2009

Dear lazyweb,

Which part of acpid is it that sends XF86Display key events to my X server? It's broken: when I suspend and then resume, it keeps sending those events over and over in an infinite loop; and since the script that I've hooked to that event takes an order of magnitude longer to run than the interval between said events, I'll just say that I find this highly annoying. I'm quite sure it's actually acpid that's sending them out, since the fix for this problem seems to be to call sudo /etc/init.d/acpid restart...

Occasionally, I don't think the ACPI daemon should be sending out these events at all (it seems to do so whenever I open or close my laptop's lid), but that's a different story...

Fri, 18 Sep 2009

Dear lazyweb,

Since a day or two, I've got myself a nice new monitor. It's positively huge, which makes it useful even alone.

There is, however, one little problem. When I call xrandr --output LVDS --right-of VGA, my laptop's display is situated at the top right of the monitor. This is not what I'm after; I'd much rather have it at the bottom right of the monitor, since

Hints as to how one should fix this are more than welcome.

Wed, 18 Mar 2009

Dear lazyweb,

Having used a powerbook as my primary machine for about four years, I'm not very up-to-date on Intel-specific hardware, such as ACPI, these days.

When at conferences or similar, I often see people who've configured their laptops so that acpid would start an alarm when the battery's almost flat. Now that I have an HP laptop again, which does ACPI, I'd like to do the same; but I can't seem to figure out how this is configured.

That is to say, when my laptop's battery is flat, it just switches off. No alarm. Needless to say, this is is rather annoying, and searching through the 56 files in /etc/acpi hasn't resulted in success so far.

Any hints would be greatly appreciated.

Mon, 22 Dec 2008

Shopping for a new laptop

So my current Apple PowerBook is now 4 years old, and starting to show its age. Some parts of it have been replaced (keyboard, hard disk, bottom cover, and battery), and now it's starting to have issues again. It's not breaking down completely just yet, but seen its age, I might as well start looking for something new rather than having it fixed.

I bought this PowerBook because I wanted a laptop that did not have an Intel or AMD processor at its core, which at the time meant either apple or tadpole; since, however, tadpole is only for the rich and famous (seriously—well, perhaps being famous is not a requirement), and apple now also only has intel-based laptops, I guess I'm stuck with intel stuff. Besides, a 1.2Ghz SPARC is slower than my current 1.3Ghz PowerPC.

So, dear lazyweb, I'd appreciate any suggestions about good laptops. What 'good' means, in my eyes, is the following:

I guess the above list is quite long, and realize that my ideal laptop might just not exist; but hey, it never hurts to try, right?

If it does not come preloaded with Windows, that's a plus; but OTOH, wiping a hard disk is not hard.

I should also note that I'm not really interested in the low-price laptops that are available everywhere these days. Those usually have much lower performance, too small a screen, and other cutbacks that make the laptop be less than interesting for me. This is for work, not play.

Tue, 25 Mar 2008

Dear lazyweb,

In an effort to improve the performance of nbd-server, I wrote a patch to make it use some common sendfile() implementations (specifically, Linux- and FreeBSD-style sendfile calls). Unfortunately, however, when I test the Linux version (I haven't done tests with the FreeBSD version yet), the server outputs some garbage in fron of the actual data that it needs to send; as a result, obviously the client can't make heads or tails of it, and the connection is dropped.

However, when I run it inside gdb, everything is fine. When I call strace over the server, I don't see any obvious errors. I tried using the DODBG version of the server (see the code for details), but that didn't help me.

At this point, I'm pretty clueless as to what is going on. If anyone were to give me some hints or pointers, I would be eternally grateful.

Wed, 19 Mar 2008

Generating ogg theora from individual frames

Hello World,

When I have absolutely nothing useful to do (which has been quite a while ago now), I sometimes like to play with povray. Not that I'm very good at it—I'm a programmer, not an artist—but it still is good fun.

What I usually prefer doing is creating an animation. This is rather easy with povray; you can have it modify certain values in your scene based on some "clock" variable, and then generate a series of different frames based on that one scene description. This creates a large number of image files in the format that you specified (say, .png) in your output directory.

Of course a number of frames is not an animation yet. If you want that, you need to do some postprocessing on these images. ImageMagick to the rescue.

convert foo*.png foo.mpg

This works, but I don't like the low quality which the MPEG2 format gives me; and it also requires me to install the non-DFSG-free and slightly buggy MPEG2 reference implementation before it'll work. That's not very nice.

What I'd really like is for something similar that will work with Ogg Theora. So, dear lazyweb, is something like that even possible? This would preferably not require me to know too much about Ogg Theora, but just take a bunch of files and output a .ogg file—much like the above convert command line.

Thanks,

Wed, 05 Dec 2007

Dear Lazyweb,

I'm looking for a scanner, with the following requirements:

  1. Must work perfectly with Linux. I don't even care about Windows or MacOS.
  2. Will be used for documents, not pictures. As such, resolution does not matter, but ADF would be nice.
  3. I have a pretty good printer, and we have a system running mgetty for faxes, so I'm not looking for a multifunctional thing. I just need to be able to scan from time to time.
  4. Not too expensive.

The problem is that I know splat about scanners in Linux, except that there is this thing called SANE which sometimes seems to help there. I even used it once or twice, but that's about it.

Any suggestions?

Tue, 02 Oct 2007

Dear lazyweb,

Is it possible, under Linux, to request a Kerberos ticket-granting ticket from one Kerberos realm without destroying your TGTs from another realm that are already in your credentials cache?

Otherwise, this happens:

Ticket cache: FILE:/tmp/krb5cc_2000_O5THYS
Default principal: wouter@EXAMPLE.COM

Valid starting     Expires            Service principal
10/02/07 19:29:53  10/03/07 05:29:53  krbtgt/EXAMPLE.COM@EXAMPLE.COM
	renew until 10/03/07 19:29:50
10/02/07 19:29:56  10/03/07 05:29:53  HTTP/exampleserver.example.com@
	renew until 10/03/07 19:29:50
10/02/07 20:52:54  10/03/07 05:29:53  host/exampleserver.example.com@
	renew until 10/03/07 19:29:50


Kerberos 4 ticket cache: /tmp/tkt2000
klist: You have no tickets cached
wouter@country:~$ kinit wouter@GREP.BE
Password for wouter@GREP.BE: 
wouter@country:~$ klist
Ticket cache: FILE:/tmp/krb5cc_2000_O5THYS
Default principal: wouter@GREP.BE

Valid starting     Expires            Service principal
10/02/07 20:59:01  10/03/07 06:59:01  krbtgt/GREP.BE@GREP.BE
	renew until 10/03/07 20:58:57


Kerberos 4 ticket cache: /tmp/tkt2000
klist: You have no tickets cached

Note the complete absense of any reference to the first realm in the second klist output, which is annoying.

(Yes, I do know about the possibility to create trust paths between two realms; But I'm not going to give customers access to my personal mailserver...)

Fri, 27 Jul 2007

Dear lazyweb,

When learning some code I didn't know before, my usual way to get familiar with it is to first find some documentation or a kind spirit to help me understand the big picture, and then to run the code in a debugger or to do something like '/bin/sh -x', or some such, so that I can understand how it actually flows. That works pretty well with most software.

One of the things with which it does not work, however, is gcc's .md files. As far as I know, there are no debuggers for those files; and even though Simon helped me understand a few things about it at Debconf, I'm still not confident enough to just start editing stuff. Additionally, just randomly editing a 7k+ LOC file and expecting those edits to magically work is not something I consider very likely to succeed.

So, dear lazyweb: how does one debug gcc's .md files?

Wed, 02 May 2007

Dear lazyweb,

I'm currently setting up a drupal-based site. While it's working pretty well and has allowed me to get most things done that I needed doing, there's one remaining issue that would need resolving. I tried asking for suggestions on the drupal support mailniglist and on the #drupal-support channel on freenode, but I haven't received a solution thus far. Hopefully someone reading one of the planets I'm on knows the answer.

The site would need to be multilingual. That is to say, not just the interface, but also all static content and some of the nonstatic content would need to be translated in two (at first) languages (perhaps more will follow in the future).

Using the i18n drupal module, I have been able to create alternate-language versions of some nodes, and enable a language chooser, allowing a visitor to choose a different content language for the site and seeing the site translated. However, there is one issue that needs to be resolved: the menu.

The i18n.module does not create an alternate version of a translated node; rather, it creates a new node. This node then is linked to the original node by way of some extra table that the i18n.module installs. As such, both versions of the same content will have a different node number. To give a concrete example, the Dutch version of the "about" page on the site I'm creating is node/2, whereas the English version is node/10. Since you might want to review the English version of a node even if you request the site in Dutch, you do not unexpectedly get the Dutch version anyway if you request node/10.

Since the node number is part of the URL of the node, this makes it impossible to create a link to "the about node, in whatever language is appropriate".

The i18n module also comes with a "i18nmenu" module, which allows one to translate a menu item's description using gettext. This works, but it has one fatal flaw: it does not allow to change the target of the link. As a result, and given the above, it's impossible to create a menu item for "the about node in the current language, whatever that means".

In an effort trying to work around that issue, I've come up with a number of things. Unfortunately, none of them seem to work to satisfaction.

At this point, I'm effectively out of ideas. If anyone has a solution (or can tell me why it isn't possible), I'll gladly hear it, either as a comment on my blog or by mail on w@uter.be.

Tue, 20 Mar 2007

known unknown_hosts

OpenSSH maintains a file called "~/.ssh/known_hosts", where it stores the SSH keys of the hosts it's visited before in an attempt to avoid MITM-attacks. This is good.

However, I have a range of IP addresses on this network here that are used for ever-changing hosts; customer's machines that are at my office, and which I need to temporarily give a network connection in order to allow them to download stuff (and because typing in an xterm on my laptop rather than on a different keyboard and to a different monitor is just so much more convenient). Therefore, I know that these IP addresses will change from time to time. At this point, known_hosts is an annoyance. And since I never connect to those hosts except from machines that I trust and/or through routers that I trust, there's no advantage to be gained in having the protection that known_hosts offers, anyway.

So, dear lazyweb: is there a way to tell OpenSSH that when it tries to connect to host A, B, or C, that it does not need to store stuff in known_hosts, and that it should just assume the key is valid?

Update:StrictHostKeyChecking no and UserKnownHostsFile /dev/null will do what I want. Obviously I do want to set these options in a specific Host stanza—i.e., not Host *. Thanks, madduck!

Sun, 26 Mar 2006

Dear lazyweb,

I'm looking for a calendaring application with the following features:

  1. Must have a (limited) command line interface. I want to be able to view my appointments of the day in plain text format, so that I can put that in my .profile; it'd be nice if it allows me to view my appointments on any random date, but that isn't required. Moreover, when someone sends me a meeting invitation, I want to be able to pipe the ical file into something which puts it in my calendar, with optionally also sending an email to the person who sent me the invitation that I'm accepting it (optionally, as in, it must have the feature, and it should allow me to decide whether to send the mail on a case-by-case basis, not as in it would be nice if the feature existed.)
    More command line features are nice, but not necessary.
  2. Must have the ability to export ical files to a text file on my local hard disk; must not require me to set up a server with some weird login scheme and ditto protocol so that I can please put my webcalendar somewhere—and no, I won't sign up for one of those "free" webcalendar services. I'll put it online myself, thank you very much.
    This requirement rules out evolution, unless I missed some plugin somewhere (I don't think so).
  3. Must have basic calendaring functionality. I.e., I should somehow be able to get an overview of my appointments of any given day, to get a weekly, monthly or yearly overview, to print out things, etc.
  4. Must not require ages to start up. This, definately, rules out evolution. When I have a phone call, I want to be able to see within a few seconds whether I'm available at any given time.
  5. The ability to synchronize my calendar with my cellphone somehow would be nice, but isn't absolutely required. I'm willing to jump through a number of hoops here. Note that gnokii supports my cellphone.

Suggestions are welcome.