Damn it, it doesn't work ...

Tuesday, June 23, 2009

FreeBSD 8-CURRENT with more than 16 user groups

After I csuped to the latest CURRENT-Source and had a quick look at /usr/src/UPDATING I found this entry:


20090619:
NGROUPS_MAX and NGROUPS have been increased from 16 to 1023
and 1024 respectively. As long as no more than 16 groups per
process are used, no changes should be visible. When more
than 16 groups are used, old binaries may fail if they call
getgroups() or getgrouplist() with statically sized storage.
Recompiling will work around this, but applications should be
modified to use dynamically allocated storage for group arrays
as POSIX.1-2008 does not cap an implementation's number of
supported groups at NGROUPS_MAX+1 as previous versions did.

NFS and portalfs mounts may also be affected as the list of
groups is truncated to 16. Users of NFS who use more than 16
groups, should take care that negative group permissions are not
used on the exported file systems as they will not be reliable
unless a GSSAPI based authentication method is used.


This is really great news!

Labels:

Wednesday, April 29, 2009

Add user to unix group

I used to add users to a new unix group by firing up my favorite editor and edit /etc/group. That's because I always forget which tool to use and how to use it. This blog posting shall remind me of usermod:


usermod -a -G <groupname>[,<groupname>,...] <username>

Saturday, April 11, 2009

Mercurial on Mac OS X: ValueError: unknown locale: UTF-8

Mercurial from macports on Mac OX X Leopard gives this error message on any hg command:


Traceback (most recent call last):
File "/opt/local/bin/hg", line 25, in
mercurial.util.set_binary(fp)
File "/opt/local/lib/python2.5/site-packages/mercurial/demandimport.py", line 75, in __getattribute__
self._load()
File "/opt/local/lib/python2.5/site-packages/mercurial/demandimport.py", line 47, in _load
mod = _origimport(head, globals, locals)
File "/opt/local/lib/python2.5/site-packages/mercurial/util.py", line 93, in
_encoding = locale.getlocale()[1]
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 462, in getlocale
return _parse_localename(localename)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/locale.py", line 375, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

The mercurial-user list has a posting from October 2007 that blames the Mac OS X terminal application.

This really seems to be a problem with the terminal application, because if you start X11 and xterm, hg will start without the error message. In order to work with mercurial on Terminal you need to set LC_ALL and LANG in your .bashrc or .profile, like

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Labels:

Wednesday, April 01, 2009

nfsen-1.3 on debian lenny

Lenny ships with rrdtools version 1.3 which is not supported by nfsen-1.3 (the latest stable version of nfsen). One needs to patch the source code in order to install nfsen



--- libexec/NfSenRRD.pm.old 2009-04-01 10:21:54.000000000 +0200
+++ libexec/NfSenRRD.pm 2009-04-01 10:11:18.000000000 +0200
@@ -73,7 +73,7 @@
if ( $rrd_version < 1.1 ) { # it's RRD 1.0.x
$RRDoffset = 77;
}
- if ( $rrd_version >= 1.2 && $rrd_version < 1.3 ) {
+ if ( $rrd_version >= 1.2 && $rrd_version < 1.4 ) {
$RRDoffset = 67;
}


Wednesday, March 25, 2009

Caps -> Control with xmodmap

There was a post on my blog in August 2008, where I described how to change the caps key into control on via Xorg configuration files.

This is nice and handy if you have control over you xorg.conf. But it will not work, if you don't have that control (or if you don't have such a file). You can use xmodmap insteed. Create the file .xmodmap in your home directory and put the lines

clear Lock
remove Control = Control_L
keycode 66 = Control_L
add Control = Control_L

into the file. In order to change the key settings you need to run xmodmap /.xmodmap

Tuesday, February 17, 2009

domU doesn't start after update to lenny

As stated in the previous post, I upgraded several machines to lenny. These machines are virtualized via xen. After the upgrade none of the installation did boot correctly. They stopped right after


INIT: Entering runlevel: 2
Starting system log daemon....
Starting kernel log daemon....
Starting system message bus: dbus.
Starting OpenBSD Secure Shell server: sshd[ 19.189974] NET: Registered protocol family 10
[ 19.190697] lo: Disabled Privacy Extensions
.
Not starting internet superserver: no services enabled.
Starting periodic command scheduler: crond.


To fix this problem, you need to boot them into single user mode (add extra="single" to your domU configuration file) and add


hvc0:23:respawn:/sbin/getty 38400 hvc0


to /etc/inittab

Update to Lenny

I have several debian machines that want to be upgraded from etch to lenny. After changing /etc/apt/sources.list to the new stable version and running apt-get update I got this message:


# apt-get update
Get:1 http://security.debian.org stable/updates Release.gpg [189B]
Get:2 http://ftp.de.debian.org lenny Release.gpg [386B]
Hit http://security.debian.org stable/updates Release
Hit http://ftp.de.debian.org lenny Release
Ign http://security.debian.org stable/updates/main Packages/DiffIndex
Ign http://security.debian.org stable/updates/contrib Packages/DiffIndex
Ign http://ftp.de.debian.org lenny/main Packages/DiffIndex
Ign http://security.debian.org stable/updates/non-free Packages/DiffIndex
Ign http://security.debian.org stable/updates/main Sources/DiffIndex
Ign http://security.debian.org stable/updates/contrib Sources/DiffIndex
Ign http://security.debian.org stable/updates/non-free Sources/DiffIndex
Hit http://security.debian.org stable/updates/main Packages
Ign http://ftp.de.debian.org lenny/contrib Packages/DiffIndex
Ign http://ftp.de.debian.org lenny/non-free Packages/DiffIndex
Ign http://ftp.de.debian.org lenny/main Sources/DiffIndex
Ign http://ftp.de.debian.org lenny/contrib Sources/DiffIndex
Ign http://ftp.de.debian.org lenny/non-free Sources/DiffIndex
Hit http://security.debian.org stable/updates/contrib Packages
Hit http://security.debian.org stable/updates/non-free Packages
Hit http://security.debian.org stable/updates/main Sources
Hit http://security.debian.org stable/updates/contrib Sources
Hit http://ftp.de.debian.org lenny/main Packages
Hit http://security.debian.org stable/updates/non-free Sources
Hit http://ftp.de.debian.org lenny/contrib Packages
Hit http://ftp.de.debian.org lenny/non-free Packages
Hit http://ftp.de.debian.org lenny/main Sources
Hit http://ftp.de.debian.org lenny/contrib Sources
Hit http://ftp.de.debian.org lenny/non-free Sources
Fetched 2B in 0s (13B/s)
Reading package lists... Done
W: There is no public key available for the following key IDs:
4D270D06F42584E6
W: You may want to run apt-get update to correct these problems


To fix this problem you need to


# apt-get install debian-keyring debian-archive-keyring
# apt-key update
# apt-get update


and the message will disappear.

Thursday, January 08, 2009

Merging pcap files

Today I wanted to merge several pcap files into one bigger file. Mergecap which is shipped with wireshark seemed to be a good tool for that task.

Since the pcap files where scattered into several directories under traces_files/, I needed to use find to gather all the file names. When trying to merge them together using


mergecap -w worms.pcap $(find ./ -name "*.pcap")


there was an error message:


mergecap: Can't open .//dir/file.pcap: Too many open files


If you do encounter that problem, you should check your open files limit with ulimit -n. Increase that value with ulimit -n <new number>.