HomeHome ArchiveArchive

Chopped up SIP

Since upgrading to Karmic I had the problem under Ubuntu that SIP calls under Twinkle would start get all chopped up every few minutes.

Turns out it’s NetworkManager that scans the wireless spectrum every two minutes for networks even if you are allready connected to some AP.

While people seem to be fixing the problem in the proper way, by making scanning interfere less with an active connection, there’s a good soul that provides patched versions of NetworkManager that gives up scanning while there’s an active connection to an AP.

See https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/373680

removing gnome-screensaver

In https://bugs.launchpad.net/bugs/509411 I had the problem, that locking the screen would just not work any more. It turned out that gnome-screensaver must be perpetualy runnung in the background in order to be able to lock the screen.

Also this would affect the computer not locking the screen when suspending.

It might be that Gnome/Ubuntu are user-friendly, however the bloat is starting to annoy me. Why do I need to be running 214 processes, when the only thing that is actually being used is firefox and a terminal? Why do I need a process (gnome-screensaver) that is using up CPU cycles and virtual memory, when it’s actually never doing anything useful?

Thus I purged gnome-screensaver (8MB) and installed i3lock.

There are three things missing:

​1) Make the laptop lock the screen when suspending:

$ cat /etc/pm/sleep.d/01_screenlock
# 01_screenlock: lock screen at suspend with i3lock
# based on http://bbs.archlinux.org/viewtopic.php?id=68158

IS_ACTIVE="$( pidof i3lock )"

lock_screen() {
  # skip if i3lock is allready running
  if [ ! "$IS_ACTIVE" ]; then
       su - $USER -c "/bin/sh -c 'DISPLAY=$DISPLAY /usr/bin/i3lock'" &

case $1 in
       # not required.
       # not required.
   *) exit $NA

​2) Add it to the panel:

$ cat ~/.gnome2/panel2.d/default/launchers/i3lock.desktop
#!/usr/bin/env xdg-open

[Desktop Entry]
Name=Lock the Screen

​3) integrate it into package management, so that I don’t accidentaly remove packages on which the screen locking depends:

$ cat control
Section: misc
Priority: optional
Standards-Version: 3.6.2

Package: lock-screen
Maintainer: Tomas Pospisek 
Depends: i3lock, pm-utils, gnome-icon-theme
Files: 01_screenlock /etc/pm/sleep.d/01_screenlock
 i3lock.desktop /home/henry/.gnome2/panel2.d/default/launchers/i3lock.desktop
Description: lock screen on suspend/hybernate
$ equivs-build control
$ sudo dpkg -i lock-screen_1.0_all.deb

Of course, it's a hack. However it works and is easy to adapt. Let me know at tpo at sourcepole.ch in case you get to make it more generic.

That's it. Saved runtime bloat. Saved disk space (i3lock is 60K large).


It can be integrated in any Rack based appication. Sample configuration for Ruby on Rails:

 config.middleware.use Rack::Monitor, :url => '/rack_status', :watch => ['/', '/ping']

The collected statistical values can be accessed at /rack_status. It is recommended to limit access to this path with our contributed middleware Rack::Access from rack-contrib.

Sample munin output:

rack_memory-day rack_requests-day rack_status_codes-day

osgEarth for Ubuntu

osgviewer sample call:

 OSG_FILE_PATH=/usr/share/osgearth osgviewer --window 50 50 900 700 /usr/share/osgearth/maps/srtm.earth

Press ‘h’ for help. See also OSG Wiki

osgearth_simple sample call:

OSG_FILE_PATH=/usr/share/osgearth osgearth_simple --window 50 50 900 700 /usr/share/osgearth/maps/geopole.earth

Press ‘1’-‘5’ for predefined viewpoints. Drag mouse with left+right click for tilt.