Dthwebnet /Main

welcome to dthweb.net

news

Continous Delivery

Big difference: Continous delivery vs. Continous de-livery!

dth? October 10, 2013, at 19:31 UTC

Godmode

This time I was debugging vino-server ... and as soon as you start to debug .. SEGFAULTs do not happen anymore. We all know this. So, this is my new Reallife-Alias:

alias iddqd='sudo gdb -p $(pidof dth)'

dth? October 28, 2011, at 11:17 UTC

Famous moviequotes ...

...as if spoken by a proper Englishman:

Then why is it, good sir, that you are attempting to have coital relations with him, as if he were a female canine?

dth? September 21, 2011, at 22:17 UTC

Phantom actions with closed (netbook-)lid

My Eeepc 1015PN exhibits some strange behaviour when the lid is closed. I open it again, only to find newly created folders, last night "the phantom" even went through my panel and deleted all network applications.

Long story short, the touchpad seems to be pretty sensitive and all symptoms can be traced back to a couple of hours of bogus input data.

Conclusion: We need to turn the touchpad off when the lid is closed

/usr/bin/lidtouchpadfix
#!/bin/bash

# Small fix for turning off the touchpad when the lid is closed.
# License: GPLv2
# Author: Jörg Eitemüller <destotelhorus@googlemail.com>

# XINPUT_DEVICE can be obtained by typing xinput list, then take the id of the touchpad device in question.
#  Example:
#  ⎜   ↳ ETPS/2 Elantech Touchpad                   id=14   [slave  pointer  (2)]
#   The id would in this case be 14
XINPUT_DEVICE=14

# XINPUT_PROPERTY can be obtained by typing xinput list-props $XINPUT_DEVICE, then take the id of the property named "Off" or "Synaptics Off"
#  Example:
#       Synaptics Off (275):    0
#   The id would in this case be 275
XINPUT_PROPERTY=275

LIDSTATE="unknown"
while true; do
        grep -q 'closed$' /proc/acpi/button/lid/LID/state 1>/dev/null 2>&1
        GREPRET=$?
        if ( [ "$GREPRET" -eq "0" ] && [ "$LIDSTATE" != "CLOSED" ] ); then
                #echo Turning the touchpad off
                xinput set-prop $XINPUT_DEVICE $XINPUT_PROPERTY 1
                LIDSTATE="CLOSED"
        elif ( [ "$GREPRET" -ne "0" ] && [ $LIDSTATE != "OPEN" ] ); then
                #echo Turning the touchpad on
                xinput set-prop $XINPUT_DEVICE $XINPUT_PROPERTY 0
                LIDSTATE="OPEN"
        fi
        sleep 1
done

Start this automatically with your X-session and expell the ghosts :-)

dth? August 28, 2011, at 11:50 UTC

VLC Memleaks

VLC - on occasion - loves to take every bit of RAM away for itself ... which kind of sucks. Valgrind doesn't turn up anything, since as soon as virtually every bit is drained VLC starts to free the memory again.

I kind of circumvented the whole issue with this:

Now it will just silently hit the 600 MByte mark, and then VLC will free the memory again stopping the video playback.

dth? May 04, 2011, at 21:18 UTC

(C)ouchDB

Memory leak candidate #3 during the last 24 hours on Ubuntu: CouchDB.

dth? April 05, 2011, at 18:09 UTC

For the last time - Why wrestool uses up all your RAM

What is wrestool?
wrestool is a resource extractor used in GNOME's thumbnailer. So when you view a Win-executable, it's icon has probably been extracted by wrestool. Now there are many people who had issues with this small program, namely that it started to use up all your RAM and grinds your system to a halt.

The reason for this behaviour can be found rather quickly. Though - without wanting to debate xmalloc - it makes me want to rip my hair out. Take a look at the following lines pulled from the wrestool/main.c file.


                /* get file size */
                fi.name = argv[c];
                fi.total_size = file_size(fi.name);
[...]
                /* open file */
                fi.file = fopen(fi.name, "rb");
[...]
                /* read all of file */
                fi.memory = xmalloc(fi.total_size);
                if (fread(fi.memory, fi.total_size, 1, fi.file) != 1) {

..... I am at a loss for words. And I thought using mmap was lazy.

dth? April 05, 2011, at 01:46 UTC