Powered by
Movable Type 3.38 mod_perl/2

 June 2007 Archives

2007, June 18 (Mon)

Linux How to set the environment using GDM

There seems to be a nearly undocumented way how to set the environment using GDM:

~/.gnomerc

This file is sourced by /etc/X11/Xsession.d/55gnome-session_gnomerc which might be debian-specific.

Linux Small trick to execute something after an already running command has finished

Small trick to execute something after an already running command has finished:

^Z
fg; beep


2007, June 21 (Thu)

Linux ssh client keep-alive

man 5 ssh_config


TCPKeepAlive
Specifies whether the system should send TCP keepalive messages to the other
side. If they are sent, death of the connection or crash of one of the machines
will be properly noticed. This option only uses TCP keepalives (as opposed to
using ssh level keepalives), so takes a long time to notice when the connection
dies. As such, you probably want the ServerAliveInterval option as well. How‐
ever, this means that connections will die if the route is down temporarily, and
some people find it annoying.

So maybe echo TCPKeepAlive true >> ~/.ssh/config could prevent those dead ssh-sessions after resume. Let's give it a try.


2007, June 28 (Thu)

Linux, Programmierung Direct I/O filesystem access in Linux with O_DIRECT

I just tried to read files from the filesystem using direct i/o to avoid the operating systems caching effects.
The manpage of open lists the flag O_DIRECT for this. Although I included fcntl.h, my compiler complained that it couldn't find O_DIRECT:

contrib/myfile.c:44: error: ‘O_DIRECT’ undeclared (first use in this function)

The solution was easy:
You just have to

#define _GNU_SOURCE

before including fnctl.h.

This is actually mentioned in the manpage, but only in a footnote that is easy to overlook.