Monday, December 29, 2014

Yes, Debian stinks

# apt-get dist-upgrade
...
dpkg: dependency problems prevent processing triggers for hal:
 hal depends on libdbus-glib-1-2 (>= 0.78); however:
  Package libdbus-glib-1-2:amd64 is not configured yet.
 hal depends on pciutils; however:
  Package pciutils is not configured yet.
 hal depends on dbus (>= 0.61); however:
  Package dbus is not configured yet.

dpkg: error processing package hal (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for hal:
 hal depends on libdbus-glib-1-2 (>= 0.78); however:
  Package libdbus-glib-1-2:amd64 is not configured yet.
 hal depends on pciutils; however:
  Package pciutils is not configured yet.
 hal depends on dbus (>= 0.61); however:
  Package dbus is not configured yet.

...
dpkg: error processing package hal (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: too many errors, stopping
Processing triggers for libc-bin (2.19-13) ...
Errors were encountered while processing:
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
 hal
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)



Jesus, do you guys really have no QA???

Monday, October 20, 2014

Democracy 3 on Debian Jessie

Note to self:
To be able to run Democracy 3 on Debian one needs to:
# dpkg --add-architecture i386
# apt-get update
# apt-get install libpng12-0:i386 libsdl-image1.2:i386 libgl1-mesa-glx:i386

Friday, June 6, 2014

Rearming KitKat with a frickin' laser (and USB)

The kids returned from a Children's day festival with a bag of more or less worthless trinkets, among them a lovely KitKat promotional ball mouse. Its fatal handicap is the connector - the last time I had a PS/2 in my machine was a decade ago ...
I contemplated building a PS/2-USB interface with an Arduino, but lacked the 3.6V Zeners used in the circuit I found on the intertubes.

Fortunately there was an old USB laser optical mouse lying in my drawer.
I decided to transplant its innards to KitKat.
The scroll-wheel is broken, but since KitKat doesn't have one it's not a problem :-)

The PCB was too large to fit into the enclosure and the switches needed to be repositioned.
Cut, resolder, rewire, fasten with hot glue,

et voilà - a USB KitKat laser mouse!














Thursday, April 24, 2014

Opening cheap chinese USB charger

My USB charger has died so I ordered a new one. I chose a neat pink one :-)

While the seller claimed it to be a EU plug it turned out to be only compatible with the other part of the EU - it won't work with the ground pin of the CEE 7/5 socket.
I got a refund from the seller and kept the product. Since it's not usable anyway (apart from the cables) I looked inside.
First I pushed a thin screwdriver into the seam and pried gently
Then I was able to pull the insides out of the box
I guess there's no room for the ground pin there :-)
The PCB contains standard parts - Vishay MB6S bridge rectifier, Sharp PC817c optocoupler a power NPN 13003, a bunch of capacitors, diodes, resistors and a transformer.
I'm not desperate enough to repackage it to work with my sockets ... yet.

Wednesday, April 9, 2014

tail -f /dev/ttyUSB0 in Debian

After a recent Debian 7.4 (I hate the codenames!) update I was no longer able to read data from the Arduino's USB serial.
I found out that
cat /dev/ttyUSB0
worked, while
tail -f /dev/ttyUSB0
did nothing. Strangely enough, running the command in strace revealed that tail was reading the data correctly, it just failed to display them ...

I'm not sure whom to blame - coreutils or Debian. Anyway, here's the solution/workaround I found at debianforum.de:

$ stty -F /dev/ttyUSB0 0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
$ stty -F /dev/ttyUSB0 9600 raw hupcl min 0
$ tail ---disable-inotify -f /dev/ttyUSB0

Wednesday, April 2, 2014

fuck debian

"If the suspend / resume works well on your system, you are lucky"
https://wiki.debian.org/Suspend

Tuesday, February 18, 2014

Running a Tor relay on a TP-Link TL-WR741ND

... is not possible (for now).
It tuns out even the spacious 32 MB RAM on the 741 is not enough for Tor.
Even with a custom minimized firmware, logging in via serial so I can kill dropbear and save a meg of RAM, this is not enough.
I was able to get to ~70% of the setup, with about half of the caches loaded when the system went out of memory.
I tried to put the caches into a compressed loopback image with

# rm -rf /var/lib/tor/*
# mkdir /tmp/jffsroot
# mkfs.jffs2 --pad=0x500000 -o /tmp/rootfs.jffs2 -e 0x4000 -n -d/tmp/jffsroot
# losetup -f
/dev/loop0
# losetup /dev/loop0 /tmp/rootfs.jffs2
# modprobe block2mtd
# echo "/dev/loop0,131072" > /sys/module/block2mtd/parameters/block2mtd
# mount -t jffs2 -o rw /dev/mtdblock6 /var/lib/tor
# chown tor /var/lib/tor


but it only helped a little bit, mostly because their contents does not compress well. The tor binary kept growing in RAM and eventually reached about 20 MB. Then I was out of memory again.
So it looks like it might only be possible to run Tor with the caches located on an external storage, provided Tor's RAM usage won't grow over ~25 MB.