squisher

Sep 302009
 

Setup

”’Note that I’m not a kerberos expert by any means. These short instructions got puzzled together from some tutorials, and they work for me. It’s likely I forgot something too, so YMMV”’

1. Initialize the kdc database. On debian this is done through debconf at package install time. Take the rest of the initial setup of /etc/krb5.conf and /etc/krb5kdc/kadm.acl etc from the first link of the resources.
1. Add an admin account.

 
kadmin.local -q "addprinc root/admin"

1. Add an account for the machine

kadmin.local -q "addprinc -randkey host/foo.bar"

1. For every client, on the server
1. Add a machine account

kadmin -q "addprinc -randkey host/client.bar"

1. Add a nfs account

kadmin -q "addprinc -randkey nfs/client.bar"

1. On every client add the keys generated on the server to the tab

kadmin -q "ktadd host/client.bar"
kadmin -q "ktadd -e des-cbc-crc:normal nfs/client.bar"

Notes

  • In debian, edit /etc/default/nfs-common and nfs-kernel-server to make sure that statd is not running, and that idmap and the gss services are started.
  • Make sure that the fqdn of the server doesn’t resolve to 127.0.0.1 through /etc/hosts – it will break kadmin
  • Edit /etc/idmap.confand change
    
    

[General] Domain = your.domain

Otherwise you will get errors like ”rpc.svcgssd[5054]: WARNING: get_ids: failed to map name ‘nfs/alucardo.nd.mcbf.net@ND.MCBF.NET’ to uid/gid: Invalid argument” in syslog.

  • hostname –fqdn really does need to return the full-qualified domain name. Often it does not, because many people set up /etc/hostsso that the unqualified domain name comes before the full qualified one. A correct setup is:
    
    

10.0.0.1 foo.bar foo

A wrong setup will cause errors like

Aug 23 20:47:19 tor rpc.svcgssd[4738]: ERROR: GSS-API: error in gss_acquire_cred(): Unspecified GSS failure.  Minor code may provide more information - No principal in keytab matches desired name 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: Unable to obtain credentials for 'nfs' 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: unable to obtain root (machine) credentials 
Aug 23 20:47:19 tor rpc.svcgssd[4738]: do you have a keytab entry for nfs/@ in /etc/krb5.keytab?
  • Clocks must be synchronized (ntp is sufficient), or you will get strange errors. I.e. an gss error where the major code is Unknown Error and the minor code is unknown as well.

Resources

Additional pages not really used:

Jun 042009
 

I adapted a little program to help with a dual monitor setup and two separate X screens. It allows you to configure the X screens to be apart (so that you can play games without having the mouse cross over), but still have the convenience of a crossing cursor when needed.

For a little more detail see http://gentoo-wiki.com/HOWTO_Dual_Monitors#Switchscreen.

Releases

  • Deprecated Warning: This utility will now be developed as part of DualscreenMouseUtils. Check there for the newest release.
  • Bugfix: place cursor on the correct x coordinate after switching screens2008-08-15 : Download v0.3b
  • Bugfix: screens can now have different resolutions.2008-08-13 : Download v0.3
  • Small update: detect current screen reliably, option to specify the relation of the two screens.Download v0.2
May 282009
 

My card uses the saa7134 driver. lspci output:

00:0a.0 Multimedia controller: Philips Semiconductors SAA7131/SAA7133/SAA7135 Video Broadcast Decoder (rev d1)
	Subsystem: Micro-Star International Co., Ltd. TV@nywhere Plus

It seems in 2.6 kernels with this driver the remote should just register as a keyboard, you can check in /proc/bus/input/devices if it shows up. Mine did not out of the box on debian testing with a 2.6.26 kernel.

With 2.6.29 a patch (http://marc.info/?l=linux-video&m=122086916009931&w=2) is integrated which does make the remote show up as a keyboard input. Using it then with lirc requires a special config file: http://linux.bytesex.org/v4l2/faq.html#lircd , which seems to be the same essentially as http://www.lemis.com/grog/programs/multimedia/TVatnywhere. I ended up using the former. It does work fine now, aside from two buttons which are switched somehow, which is not a big deal to me.

The remaining step is to setup an ~/.lircrc. Information on this is surprisingly sparse, so I’ll post my version shortly.

Jun 172008
 

Last updated: 2008-06-17

Trying to do play around with some static analysis? Here a review of software that helps to create an abstract syntax tree for C:

  • styx, a scanner and parser software that says it is easier to use than lex/yacc (with some small limitations). It is supposed to automatically generate an abstract syntax tree.
    Problem: I was unable to find any grammars for it except the ones on the download page (they do have a grammar for php there), and the documentation about writing one is not really complete.
  • elsa/elkhound, generates an abstract syntax tree for C++, but lacks documentation for how to write a context sensitive analysis that can process the tree. It is complicated without documentation, because meta programming is used for the ast.
  • olmar is an ocaml wrapper for elsa and adds a nice program to generate graphs of the AST. This would be my option if I had been able to use ocaml.
  • Open C++ core, the core of the Open C++ project, which introduces aspect oriented / meta object programming to C++. Almost no documentation exists though.
  • oink is a Collaboration of C++ Static Analysis Tools, which sounds like a nice middle-ware (it uses elsa as a backend). It lists as one of its goals extensible for ease in adding backends, yet I could not find much information about how to actually do that.

elsa seems to be the standard tool for the task, but understanding its internals was too complicated for my small project, so I ended up printing the AST as XML and reading that back in from my program.

Jun 142008
 

Are you trying to boot Windows from a second hard drive, but it just hangs and nothing happens?

Windows apparently only really supports booting from the first hard drive, but grub can trick Windows by remapping drives:

title Windows
        rootnoverify (hd1,0)
        map (hd0) (hd1)
        map (hd1) (hd0)
        chainloader +1

Source: http://www.weiqigao.com/blog/2004/01/14/windows_on_the_second_hard_drive_linux_on_the_first.html

Feb 242008
 

Ekiga is a nice linux voip program. Yet it has the limitation that its sound support does not understand .asoundrc devices. As a work around you can use an environment variable in .asoundrc to set the default device specially for ekiga.

But what if you want to have the ring sound on a different alsa device than the actual conversation? This is what I need with my DotAsoundrc, because my headphones are plugged in all the time. So I wrote a little python script, which uses dbus to connect to ekiga and plays the ring tone on a different device.

Download