Planet NoName e.V.

23. May 2013

RaumZeitLabor

Agenda Diplom für Kinder 2013

»Wir löten ein programmierbares elektronisches Schmuckstück« ist der Titel der Workshops die im Rahmen des Agenda Diplom für Kinder 2013 im RaumZeitLabor statfinden. Die erste Veranstaltung am 23.Mai stieß auf großes Interesse, die sechs Plätze waren schnell ausgebucht.

agendaworkshop1

Pünktlich um 11 Uhr begann der Workshop bei dem die drei Mädchen und drei Jungs unter Anleitung ein Hacklace löteten. Die als Verstärkung mitgekommenen Väter durften, nachdem sie schon fast neidisch die Ergebnisse ihrer Kinder sahen, selbst-verständlich auch ihr eigenes Hacklace zusammenbauen.

agendaworkshop5

agendaworkshop4

agendaworkshop3

agendaworkshop2

Löten und Zusammenbau funktionierten bei allen Beteiligten reibungslos und so hatten alle  innerhalb kürzester Zeit ihr Schmuckstück vollendet. Jetzt hieß es noch eine persönliche Animation auf das Display zu bringen und auch das kinderleicht. Mit dem HacklaceAnimator kann man die Anzeige des Hacklace mit einigen Klicks individuell “befüllen”. Programierkenntnisse sind dafür nicht notwendig.

programmieren

agendaworkshop

Weil drei Stunden angestrengtes Zuhören und Werken auch hungrig und durstig machen können, gab es für Zwischendurch ein kleines Buffet mit Obst- und Gemüsesnacks.

buffet

Sowohl den Teilnehmern als auch den RaumZeitLaboranten hat der Workshop Spaß gemacht und wir freuen uns schon auf die nächste Veranstaltung am 17. Juli.

by zwetschgo at 23. May 2013 14:08:24

21. May 2013

Atsutane's blog

Ein neuer Blog / A new blog

Ein neuer Server, ein neuer Blog. Es war ruhig geworden und auch hier wird nicht andauernd etwas Neues stehen, aber ein Ort an dem man seinen Gedanken mal freien Lauf lassen kann ist keine schlechte Sache. badboy_’s altes devbird wurde durch ein Octopress ersetzt und auch auf dem Server selbst läuft ein anderes OS, Arch Linux statt Debian. Manche Posts wird es in Deutsch und Englisch geben, andere nur in einer der Sprachen, aber ich werde die Anzahl von Posts die beide Sprachen vereinen gering halten.

A new server, a new blog. The old blog became a silent place and this one also won’t make much noise, yet it’s not bad to have a place where someone can give his thoughts some freedom. badboy_’s old devbird has been replaced by Octopress and the server also runs another OS, Arch Linux instead of Debian. Some posts will be written in german and english, others just in one of the languages, but I will keep the amount of “merged” posts – like this – at a low level.

Be aware that all posts will be tagged with the language they’ve been written in: deutsch and english.

21. May 2013 14:46:00

20. May 2013

sECuREs Blog

Galaxy Nexus slowness

My Galaxy Nexus was getting really slow over the last few weeks, meaning simple things like going to the homescreen took multiple seconds.

Turns out that the problem is the SD card filesystem / controller getting really slow once the SD card gets nearly filled up. You can verify this by running Androbench, a storage benchmark app. You should get a sequential write performance of a few MB/s (e.g. 8 MB/s), but when affected by the problem, you get about 0.x MB/s.

The fix is to delete files to make sure you have plenty of spare capacity, then run fstrim, neatly packaged in this app, followed by a reboot.

In case you haven’t rooted your phone for a while, the currently working way is using SuperSU, not Superuser.

20. May 2013 13:00:00

14. May 2013

Atsutane's blog

irssi, screen and urxvt - the urgency hint

A lot of i3 users miss a workspace notification when they are being highlighted in an IRC channel, in order to prevent people from getting tired of explaining this short setup over and over again I wrote this article in my old blog. As it’s still visited a lot it obviously survives the server move and enters also this blog.

For screen you only have to disable the vbell in the screenrc:

~/.screenrc
1
vbell off

When you use urxvt as a terminal the urgentOnBell option has to be activated in the Xdefaults file. In case you use an other terminal take a look at the respective documentation.

~/.Xdefaults
1
URxvt*urgentOnBell: true

For irssi there are two ways to handle this. If you have a running instance you can set this by using these commands:

irssi commands
1
2
3
4
5
/set bell_beeps on
/set beep_when_away on
/set beep_when_window_active on
/set beep_msg_level HILIGHT INVITES MSGS NOTICES CTCPS DCC DCCMSGS
/save

Or alternatively by editing the configuration:

~/.irssi/config
1
2
3
4
5
6
7
8
9
settings = {
#...
  "fe-common/core" = {
    bell_beeps = "yes";
    beep_when_away = "yes";
    beep_when_window_active = "yes";
    beep_msg_level = "HILIGHT INVITES MSGS NOTICES CTCPS DCC DCCMSGS"
  }
}

14. May 2013 20:12:00

04. May 2013

RaumZeitLabor

Projekt: Solar Powered Router

Bei der letzten offenen RaumZeitLaborierung hat Mitlaborant Felicitus ein interessantes Projekt vorgestellt, bei dem es um ein ein autonomes System geht, das einen WLAN Router dauerhaft mit Energie versorgen kann (Folien, Videoaufzeichnung). Genauer gesagt hat er einen Carambola 1 mit einer Solarzelle (20Wp), einem 12V Bleiakkus (5Ah) und einer Ladeelektronik kombiniert. Das Carambola Board wird vom OpenWRT Projekt unterstützt und zeichnet sich durch einen vergleichsweisen geringen Stromverbrauch aus.

IMG_20130501_170619           IMG_20130501_170732

Seit einigen Tagen ist das System im Freien ausgebracht und postet fleißig Statistiken zu cosm, welche ihr “live” verfolgen könnt. Hier könnt ihr beispielsweise die aktuelle Leistung der Solarzelle sehen:

Leistung der Solarzelle
Weitere Infos findet ihr in seinem Blog.

Du hast auch ein cooles Projekt, von dem du uns gerne berichten würdest? Wir freuen uns über jeden Vortrag bei der offenen RaumZeitLaborierung.

by else at 04. May 2013 21:39:25

01. May 2013

RaumZeitLabor

Indiespiele Themenabend im RaumZeitLabor

Am kommenden Samstag (4.5) findet ab 20 Uhr ein Indiespiele Themenabend im RaumZeitLabor statt. Was Indiespiele sind und wer sie entwickelt erklärt zu Beginn der Film Indie Game The Movie. Er begleitet 3 Entwicklerteams und ihre Spiele von der ersten Demo bis zum fertigen Release. Die 3 Spiele (Braid, Super Meat Boy und FEZ) können im Anschluss auch angespielt werden*.

<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/GhaT78i1x2M" width="560"></iframe>

<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/uqtSKkyJgFM" width="560"></iframe>

<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/Xz8Sj5moo1w" width="560"></iframe>

<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/tfpKTclOnfI" width="560"></iframe>

*ausgenommen FEZ, da mein Laptop kein OpenGL 3.0 kann.
**ausgenommen Tiernahrung

by xAndy at 01. May 2013 14:48:10

23. April 2013

RaumZeitLabor

Veranstaltungshinweis: zusätzlicher Lötworkshop-Termin am 15.05.2013

Aufgrund der hohen Nachfrage beim “Wir löten einen Arduino-kompatiblen Bausatz” bieten wir für diesen Workshop einen weiteren Termin an. Die Workshopinhalte sind gleich.

Mehr Informationen und die Anmeldung findest du hier: https://raumzeitlabor.de/events/lotworkshop-wir-loten-einen-arduino-kompatiblen-bausatz/

by muzy at 23. April 2013 18:55:12

ludum dare im RaumZeitLabor

Am Wochenende vom 26. – 29. April findet zum 26. Mal der internationale Gamejam “ludum dare” statt. Um 4 Uhr in der Nacht von Freitag auf Samstag fällt der Startschuss, alleine in 48 oder als Team in 72 Stunden ein Spiel zu einem vorgegebenen Thema zu programmieren.
Wer keine Lust hat, in Einsamkeit zu programmieren oder schon immer mal jemandem beim Spiele programmieren zuschauen wollte, ist eingeladen, im RaumZeitLabor vorbeizukommen.
Bitte tragt euch in den Kommentaren ein, damit wir einschätzen können, wie viele Leute kommen werden.

<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube-nocookie.com/embed/9MfXw-uKSok" width="560"></iframe>

by xAndy at 23. April 2013 13:08:14

Wohnzimmerkonzert (Episode VI)

Am Donnerstag (25.4.) findet bei uns mal wieder ein Wohnzimmerkonzert statt. Nachdem sich das Konzept seit Ende letzten Jahres im RaumZeitLabor etabliert hat, kommt uns diese Woche einer der beiden Gründer dieser “Bewegung” besuchen:

Ben Schadow Band Logo

Ben Schadow aus Hamburg kommt mit seiner Band vorbei und spielt bei uns live! Kommt zahlreich, ladet Freunde und Verwandte ein. Merkt euch die Anfahrtsbeschreibung, schreibt euch die RaumTelefonNummer auf und findet euch am 25.4. um 19:00 im RaumZeitLabor ein, um Ben und Band zu lauschen.

Wer sich ein Bild von Ben und seiner Musik machen will, kann sich das erste Wohnzimmerkonzert von Ben&Pele im RaumzeitLabor noch einmal auf youtube ansehen.

by TabascoEye at 23. April 2013 08:33:48

20. April 2013

Moredreads Blog

Game Announcement: Qubarchy

Two weeks ago Eduard and I began to work on a open source real time strategy and exploration game named qubarchy. I hope we get out a public version soon. :)

20. April 2013 15:30:00

17. April 2013

RaumZeitLabor

Veranstaltungshinweis: Wir löten einen Arduino-kompatiblen Bausatz (11.05.13)

Update: Der Workshop am 11.05.2013 ist leider ausgebucht. Wenn du Interesse an einen weiteren Lötworkshop hast melde dich einfach in den Kommentaren. Wir organisieren dann einen zweiten Termin! 

Du willst löten lernen? Kenntnisse vertiefen oder einfach mal wieder in netter Gesellschaft löten? Dann ist der Lötworkshop am 11.05.2013 ab 14:30 Uhr genau das richtige für Dich!

Die Arduino-Plattform ist eine Microcontroller-Plattform für Einsteiger und Fortgeschrittene. Eine einfach erlernbare Programmiersprache mit vielen Funktionen läd zum programmieren ein – die ausgeklügelte Hardware ermöglicht auch Anfängern schnelle Erfolge!

Während des Workshops lötest du unter Anleitung ein Arduino-UNO kompatibles Board. Vorher lernst Du gemeinsam mit anderen Workshopteilnehmern die wichtigsten Löttechniken.

Ist Dein eigenes Board erst gelötet werden wir das Board gemeinsam in Betrieb nehmen und wenn nötig noch einige Stellen verbessern. Zusätzlich unterstützen wir Dich dein erstes kleines Programm zu schreiben und geben Dir die Möglichkeiten der Arduino-Plattform zu entdecken!

Mehr Informationen & Anmeldung

Mehr Informationen und die Anmeldung findest Du unter: https://raumzeitlabor.de/events/lotworkshop-wir-loten-einen-arduino-bausatz/

Die Anmeldung ist bis zum 30.04.2013 möglich, die Teilnehmerzahl ist auf 8 begrenzt.

by muzy at 17. April 2013 10:52:50

13. April 2013

wobbleing soup

07. April 2013

wobbleing soup

06. April 2013

RaumZeitLabor

Burger Madness Invasion 2 #bmi2 – Rückblick

Zwar sind noch nicht alle Fettspritzer wieder eingesammelt und die Vorhänge werden noch länger danach riechen, aber der Hauptteil der großartigen 2. Burger Madness Invasion (#bmi2) liegt leider schon wieder hinter uns.

Insbesondere Dank der Chefburgeranwerberin Kentucky Fried Haki konnten wir beim diffizilen Burgerbau auf eine Vielzahl interessanter Zutaten zurückgreifen.

Neben echtem Pecorino aus Italien und “schee doschenem” Gorgonzola gab es noch 3 weitere Käsesorten zur Auswahl. Unmengen Bacon, Romana und Feldsalat sowie weitere Gemüsearten von Chilli bis in Honig gedünsteten Zwiebelringen standen den Burgerbaumeistern zur Verfügung.

Die enstandenen Kreationen konnten der Nachwelt leider nur teilweise photographisch erhalten werden.

bmi2 halberburger bmi2 makitawolf bmi2 burger bmi2 burger bmi2 beginningburger bmi2 einkauf bmi2 burger

Den Bonuscontent haben wir unter dem Weiterlesen-Button versteckt…


<iframe allowfullscreen="allowfullscreen" frameborder="0" height="360" src="https://www.youtube-nocookie.com/embed/kesz_8iPck4" width="480"></iframe>

by Unicorn at 06. April 2013 21:08:56

05. April 2013

ociru.net

Get the most out of your SSD for ZFS

I recently talked about using ZFS on a home server. In my case, that’s a HP N36L Microserver equipped with four 1.5TB Harddisks combined as a RAID-Z sitting in the drive bays and an additional 60GB SSD packed in the 5.25” slot as boot device. Of course, you can use the internal USB slot sitting on the mainboard itself to boot up the system, but I wanted to use the SSD as Cache as well.

ZFS supports two kinds of caches: the ZIL as write cache and the L2ARC as read cache. My home server is mainly used for reading data, so my priority is the L2ARC. To get the most out of my SSD, I created three partitions. One for the OS (in that case FreeBSD) and one for each cache. Resizing the caches is a pain, so be careful to plan the sizes in advance. I choose to use 8GB for the ZIL, 24GB for the L2ARC and spend the remaining 26’ish GBs for the system which is more than sufficient for FreeBSD including my /usr/local and /package. If you already have installed your OS on the SSD, you couldn’t just export VDEVs for ZIL and L2ARC because both caches have to be disks or slices (or partitions of course). But you could use zfs send and receive to temporarily move your installation to another disk and then move it back to the SSD. Don’t forget about your bootloader.

Let’s create the partitions: (all your data will be lost!)

1
2
3
4
5
6
7
8
9
10
11
12
gpart create -s gpt ada0 # first disk in drive bay
gpart create -s gpt ada1 # 2nd disk in drive bay
gpart create -s gpt ada2 # ...
gpart create -s gpt ada3 # ...
gpart create -s gpt ada4 # boot disk in 5.25" slot (the SSD)
gpart add -t freebsd-zfs -b 2048 -a 4k -l disk1 ada0
gpart add -t freebsd-zfs -b 2048 -a 4k -l disk2 ada1
gpart add -t freebsd-zfs -b 2048 -a 4k -l disk3 ada2
gpart add -t freebsd-zfs -b 2048 -a 4k -l disk4 ada3
gpart add -t freebsd-zfs -b 2048 -a 4k -l system -s 26G ada4
gpart add -t freebsd-zfs -a 4k -l log -s 8G ada4
gpart add -t freebsd-zfs -a 4k -l cache -s 24G ada4

And than create the pools:

1
2
zpool create zroot gpt/system
zpool create zstore raidz gpt/disk1 gpt/disk2 gpt/disk3 gpt/disk4 log gpt/log cache gpt/cache

At the end, you’ll have something like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  pool: zroot
 state: ONLINE
 scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        zroot           ONLINE       0     0     0
          gpt/system    ONLINE       0     0     0

errors: No known data errors

  pool: zstore
 state: ONLINE
  scan: none requested
config:

        NAME            STATE     READ WRITE CKSUM
        zstore          ONLINE       0     0     0
          raidz1-0      ONLINE       0     0     0
            gpt/disk1   ONLINE       0     0     0
            gpt/disk2   ONLINE       0     0     0
            gpt/disk3   ONLINE       0     0     0
            gpt/disk4   ONLINE       0     0     0
          logs
            gpt/log     ONLINE       0     0     0
          cache
            gpt/cache   ONLINE       0     0     0

errors: No known data errors

If your pool already exists, you could add the ZIL and the L2ARC with the following commands:

1
2
zpool add zstore log gpt/log
zpool add zstore cache gpt/cache

I won’t lie to you, there is a downside: you now have two independent pools in your system, but to be realistic, they are not independent any more. If your SSD dies, you won’t be able to boot up your system (who would guess that?) and you have to manually remove the log and the cache device from zstore before mounting the pool without errors (possible since ZFS v22).

1
2
zpool remove zstore log gpt/log
zpool remove zstore cache gpt/cache

After that, you should be able to import your pool without errors.

Have fun with your caches! :-)

05. April 2013 09:48:00

03. April 2013

RaumZeitLabor

Chaotic Congress Cinema Mannheim Reboot

Nach einer längeren Pause startet an diesem Donnerstag, dem 04. April 2013, das Chaotic Congress Cinema Mannheim neu.

Ab dem 04. April werden wir jede Woche donnerstags ab 20 Uhr im RaumZeitLabor Mannheim in geselliger Runde jeweils zwei Stunden lang Vorträge, die auf dem 29C3 aufgezeichnet wurden, vorführen.

Der Eintritt ist kostenlos und jeder ist willkommen. Getränke, Popcorn, Pizza und Junkfood kann käuflich erworben werden.

Weitere Hinweise zur Programmgestaltung und wie du diese beeinflussen kannst findest du auf der Chaotic Congress Cinema Wikiseite.

Das Programm für Donnerstag wird jeweils über die Mailingliste bekanntgegeben.

by blabber at 03. April 2013 04:51:56

01. April 2013

RaumZeitLabor

Geht mit der Zeit und besucht uns im Gopherspace

250px-Pocket-Gopher_Ano-Nuevo-SPAls Hackerspace sind wir immer bemüht am Puls der Zeit zu sein und auf den verschiedensten Wegen für Interessenten und Mitglieder erreichbar zu sein. Mit dem heutigen Tag ist das RaumZeitLabor dementsprechend auch im Gopherspace vertreten. Wir präsentieren euch gopher.raumzeitlabor.org!

Solltet ihr Gopher nicht kennen ist das durchaus verständlich, schließlich handelt es sich hierbei um ein hochmodernes Netzwerkprotokoll, welches in den meisten Browsern noch nicht implementiert ist. Den einfachsten Zugriff auf unser Gopherhole bekommt ihr über einen Gopherproxy.

Falls ihr an den technischen Grundlagen interessiert seid, findet ihr einen kleinen Vortrag über das Gopherprotokoll in unserem Videopodcast und einen Artikel bei der Wikipedia.

Wenn ihr eine gute Idee habt wie wir die Qualität dieses Dienstes noch weiter verbessern können, zögert nicht einen Kommentar zu hinterlassen.

Euer Gopher Operation Centre (GOC)

by blabber at 01. April 2013 09:38:03

21. March 2013

sECuREs Webseite

Hacking your own Kinesis keyboard controller

Hacking your own Kinesis keyboard controller

Geschrieben von: Michael am 21.03.2013

The Kinesis Advantage Contoured is an ergonomic keyboard which I have been using for four years. It has many features that make it a great keyboard, and it’s certainly the best I have ever used.

However, as you can also read on many places on the internet, many users have a tiny problem with the keyboard: the modifier keys sometimes get stuck. For example, you press Shift, followed by A, release Shift, press n. What appears on your screen is AN instead of An. You can only get out of this state when pressing Shift once again. It seems like the firmware doesn’t register the key release.

Last year, I decided to write Kinesis about it and they offered me a firmware upgrade. I was surprised to learn that a firmware upgrade actually means getting shipped a new microcontroller with a new firmware on it :-). After swapping the microcontroller, I noticed that the problem did not appear as often as it used to, but it still appeared. Of course, that is not satisfactory for perfectionists and heavy keyboard users :-).

The Humble Hacker Keyboard

The Humble Hacker Keyboard is a project by David Whetstone, who started out his project by modifying existing keyboards, amongst them the Kinesis Contoured. Thankfully, he documented his modifications in his blog.

After reading what he did, I decided to replicate his approach and swap the electronics of my Kinesis. It seemed reasonably straight-forward: Use a Teensy++ 2.0 USB development board, connect the different parts of your Kinesis to it and use David’s Open Source firmware. So I ordered the Teensy++ and had a look at how to modify my Kinesis so that I could test whether everything works before destructively modifying the keyboard.

The flex connectors

The original Kinesis Keyboard controller

In comparison to David’s version of the Kinesis Contoured, my version was newer and used flex connectors for connecting the left/right keyboards to the controller board, as you can see on the picture above. Thankfully, Kinesis is very friendly to the enthusiast community around its products. Rick revealed that they are using the Cvilux CF01131V000 flex connectors. Unfortunately, it seems impossible to order just a few Cvilux parts to Europe.

flex connector to jumper wire adapter

From an earlier modification I still had a few spare Kinesis parts lying around, so I decided to unsolder the flex connectors from those for a quick test. Unfortunately, the grid of the flex connectors is different from the usual 2.54mm grid, so you cannot simply use such a connector on a breadboard. Volker came up with the idea of soldering a pin header directly to it, and that worked (see the picture). I then used a bunch of jumper wires to connect the flex connector to the Teensy++ and then the Kinesis keyboard parts to the flex connector. After flashing the firmware, I could press keys on the Kinesis and have them appear on my screen. Yay! :-)

Given that I could not order the Cvilux flex connectors directly, I spent quite a bit of research into finding a compatible part. In the end, I found and used the Molex 39-53-2135 which you can order from RS components. They even have free shipping for students :-).

The prototype board

Now that the proof of concept was done, it was time to design a prototype board on which I can mount the Teensy++ and connect all the Kinesis keyboard parts — essentially, one could call it a break-out board for the Teensy++. It really doesn’t contain any electronics.

I created the layout and board files with the free version of CadSoft EAGLE, based on David’s descriptions in his blog posts. I am not very experienced in EAGLE, so thankfully my friend Moritz helped out with creating an EAGLE library for the Molex flex connector and cleaning up my board.

We then milled the prototype board at Volker’s lab and soldered the flex connectors and pin headers on the prototype board. Here are two pictures of the board, one before soldering and the other one after putting it into the Kinesis:

The prototype board The prototype board inside my Kinesis

Note that the thumb keyboards don’t use a flex connector — they are soldered directly onto the controller board :-(. We decided to solder them to a pin header so that we can connect and disconnect them at will.

After connecting the prototype board, most of the keyboard worked properly. There unfortunately was one little mistake in the layout (and subsequently in the board), which we were able to correct with a bit of wire. I then decided to leave the prototype board in to test it for a bit of time until the PCBs were manufactured and delivered.

Unfortunately, we only noticed that there have to be two holes in the center of the board in order to be able to actually close the keyboard case. Furthermore, the microcontroller doesn’t have a lot of space, so you need to be careful when designing a board. I decided to eat my own dogfood and leave the Kinesis half-open for a while.

The PCB

Now that it was clear that the idea basically works, Volker and I decided to take measurements of the original board and design a proper board — with holes in it and LEDs on it. It took Volker about two hours to route the board, and the result looks pretty good.

board

Afterwards, we submitted the board file to BILEX-LP, a cheap PCB manufacturer in Bulgaria. It took them a few working days to manufacture the board and a few more for shipping it, but it finally arrived about two weeks after we placed the order. You can see the PCB on the picture below:

Teensy++ Kinesis controller manufactured PCB

Of course, not everything was perfect, both with our board file and with the manufacturing:

  1. One connection was disconnected because of a cut on the board. Not detecting this in the quality control was the manufacturers fault. But you have to expect this when ordering at a cheap PCB manufacturer — the other 5 boards look fine. We were able to fix this with a bit of wire.
  2. The bottom hole is too small for actually fitting the screw through it. That’s not a big deal though, since the upper hole is good and the PCB is held in place by the connection through the upper hole and the connected keyboards.
  3. The drilling holes for the Teensy++ (in the middle of the board) are 0.8mil instead of 0.9mil. Since the Teensy++ EAGLE library was downloaded from their website, we thought it’d be fine, but we should have double-checked. Luckily, you can still mount a pin header on the board, you just need to push a bit harder :-).

So all in all, the PCB is usable, even though it’s not perfect. I then soldered the ports onto it and we placed it in my Kinesis. Note: the Teensy++ faces the board, so the USB connector is also facing the board. Therefore, we plugged in the USB cable and positioned it so that the connected cable fits, then soldered it onto the pin header.

The mounted PCB inside my Kinesis keyboard

For the USB connection, Volker suggested to just rip out the board on the other side of the Kinesis case, then cut the cable and directly solder a USB cable to it. That way, we re-use the original Kinesis strain-relief and their cable, which is a pretty good idea. You can see the result here:

The entire case of the Kinesis

The firmware

As expected, David’s Humble Hacker Keyboard firmware does not suffer from the stuck-modifier bug that motivated me to start this whole modification in the first place. However, I noticed that some key presses were registered twice, so I implemented debouncing and sent a pull request. The whole implementation was finished surprisingly quickly, the code really is pretty clean and easy to understand.

You can find my version of the firmware at http://code.stapelberg.de/git/kinesis-firmware/. You can also download the .hex firmware image that you can flash on your Teensy++ — but beware: I use neo-layout.org, so I remapped all the keys in the firmware :-).

The layout and board files

In case you also want to replace the controller board of your Kinesis, or as a foundation for similar projects, here are the EAGLE files:

Note that I also have 3 spare PCBs to sell. You can have one for 10 € plus shipping, but without any warranty or support. First come, first serve.

Conclusion

Of course it was not strictly necessary to build my own keyboard controller. I could have just lived with the bug. But it was fun and it’s a great feeling to have a (mostly) selfmade keyboard with an Open Source firmware to type on :-).

The total amount of time spent on this project was about a full work week.

I also want to say a big thank you to David Whetstone for publishing his experiments and firmware, to Moritz Augsburger for the help with the early EAGLE files and last but not least to Volker Wunsch who spent a lot of time with me and helped me a lot in order to get this project done.

by Michael Stapelberg at 21. March 2013 10:49:42

17. March 2013

sECuREs Webseite

OpenWrt: Backup/Restore

OpenWrt: Backup/Restore

Geschrieben von: Michael am 17.03.2013

OpenWrt is a nice FOSS Linux firmware (primarily) for wireless routers, which I use for many years. Even though I never experienced a problem with my routers, I’d like to be prepared for hardware failures, software failures and getting my router compromised. Here is a short description of each scenario so that it is clear what I mean:

  • Hardware failure: The flash in my router dies and after rebooting, neither the read-only part nor my configuration can be read, so the device does not work anymore. The only solution is to buy a new router, or have a hot spare ready. This is the worst case.
  • Software failure: After my network provider’s intern decides to fuzz the customer IP range instead of their testbed, he discovers an implementation flaw in the router’s PPPoE software and subsequently, the router deletes all the read/write data (i.e. my configuration). The solution is to reformat the read/write part of the flash and restore the latest backup. This story covers not only software failure, but also human failure when upgrading the router firmware.
  • Compromised router: Some software has a security vulnerability and an attacker obtains access to the router. Since a backdoor might have been installed, I need to re-flash the firmware image and restore my configuration.

All of these points imply having a backup. But did you actually verify that your OpenWrt backup works? What’s your disaster recovery plan for each of the scenarios above?

Backing up

OpenWrt ships with a feature to provide a tar archive containing all your configuration files. You can find it in LUCI’s “System → Backup” tab. Obviously, you need to repeat this step after every configuration change you do.

If you have installed any additional packages, you also need to save the list of packages:

opkg list-installed | cut -f 1 -d ' '

If you have installed any services that ship an init script (e.g. OpenVPN), you also need to keep a note of which ones are enabled/disabled in LUCI’s “System → Startup” tab.

Restoring

The correct order in which to restore your router to a working state is this:

  1. Flash your firmware image (save the original one whenever you flashing, or at least note which precise version you used).
  2. Configure your router so that it can access the internet.
  3. Re-install your packages:
    opkg update && for i in $(cat /tmp/pkgs); do opkg install $i; done
    
  4. Restore your configuration by uploading the tar archive in LUCI’s “System → Backup” tab.
  5. Re-enable any services you have installed (e.g. OpenVPN) in LUCI’s “System → Startup” tab, because that information is not contained in the tar archive.

Restoring to a different device

In case you have a different router, for example because a hardware failure occured or because you want to setup that hot spare I have been talking about, you need to watch out for one little subtlety in the process:

The MAC addresses of the radio interfaces need to be replaced before restoring the backup. Otherwise, OpenWrt will not apply your wireless configuration to the interfaces it finds.

In order to do that, simply edit the relevant file with a text editor and re-pack the tarball:

mkdir /tmp/fix && cd /tmp/fix
tar xf ~/Downloads/backup-OpenWrt-2013-03-13.tar.gz
vi etc/config/wireless
tar czf ~/Downloads/backup-OpenWrt-2013-03-13-fixed.tar.gz *

Building your own firmware image

In case you are dissatisfied with the dependency on the internet in step 3 of the restore procedure, you could build your own firmware image which contains the extra packages that you use. I don’t want to describe that process in depth, but it seems worth pointing out that this is one way to go.

Alternatively, you could also keep a copy of the extra packages, scp them to the router and install them with opkg. Depending on your number of extra packages, one of these will clearly seem easier :-).

by Michael Stapelberg at 17. March 2013 21:42:00

15. March 2013

sECuREs Webseite

configfiles in git

configfiles in git

Geschrieben von: Michael am 15.03.2013

About 4 years ago, I started tracking my configuration files with git. The advantages of storing configuration files in some repository are numerous:

  1. You can destroy your configuration/computer and easily revert to a known good state.
  2. You can easily distribute and update the same set of configfiles across multiple machines (especially virtual machines or other test setups).
  3. You can refer other people to your configfiles if you store them in a public repository.

This article describes the way I use git to track my configfiles. My solution is simple and should be easy to understand even if you have not used git extensively before.

Please note that I am not trying to convince you to use my script(s), or my configfiles. Also, I am not going to support this — if you have any troubles with it, you have to debug it on your own. I am merely describing what works fine for me, in the hope that it will be useful to somebody else.

initialize.sh

Obviously, the first step to get the configfiles repository on a “fresh” computer is to clone the git repository: git clone git://code.stapelberg.de/configfiles

Afterwards, run the script initialize.sh: cd configfiles && ./initialize.sh. This script will create a corresponding dotfile for each file in your configfiles repository, e.g. when you have “configfiles/foorc”, it will create “~/.foorc” as a symbolic link:

$ ls -l .zshrc
lrwxrwxrwx 1 michael staff 32 2010-09-30 07:57 .zshrc -> /home/michael/configfiles/zshrc

Every already existing file, e.g. your current ~/.zshrc, will be preserved in ~/.configfiles.bak.

Files located in subdirectories

While this approach works well for a large number of configfiles, there are exceptions. MPlayer for example stores its configfile in ~/.mplayer/config. Since folders are reserved for a different purpose in my way of doing things, the solution for this problem is a file called MAPPING. It contains a simple lookup table of (filename → path) pairs, e.g. mplayer.config ~/.mplayer/config. initialize.sh takes care of creating the destination parent folders if necessary.

Furthermore, you can use that mechanism to group files together by giving them a filename with common prefix. As an example, all my emacs-specific configfilse start with “emacs-”, e.g. “emacs-init.el” and “emacs-zkj-notmuch.el”. I find this much clearer than just naming the file configfiles/init.el.

Host-specific files

If you have files which are specific to a certain host, you can store them in a folder named like your host (use “hostname” to see how the folder needs to be called precisely). To have a standard ~/.Xmodmap, but overwrite it on a single machine called midna (with a weird keyboard), use configfiles/Xmodmap and configfiles/midna/Xmodmap.

I have read about other people using branches to have different configfiles for different hosts. While that may be a more complete solution for some extreme cases, I find it way too hard to manage.

update.sh

In order to actually update the configfiles repository, one would normally run git pull. To make this happen automatically, I call update.sh from my zshrc:

cfgfiles=$(dirname $(readlink ~/.zshrc))
# If the configfiles are in a git repository, update if it’s older than one hour
find $cfgfiles -maxdepth 1 -name .git -mmin +60 -execdir ./update.sh \;

Whenever I log into a system which is automatically managed, it will update the configuration files. On the other hand, if I don’t use a system, it will not spend any bandwith/cpu time on updating.

The script update.sh itself is a wrapper around git pull, but has a few nice properties:

  1. Only one instance of the script will run, so that you can open multiple shells/terminal emulators quickly and not have any race conditions.
  2. The script uses git stash to preserve your local, uncomitted changes.
  3. Instead of operating inplace (and breaking programs that run precisely when git replaces a file, e.g. your shell), the script works in a temporary directory.
  4. It runs the update in the background so that you don’t have to wait for a terminal emulator window to open. This implies that the shell process which triggered the upgrade will not pick up changes to zshrc automatically.

Detecting and handling errors

Because update.sh runs its upgrade in the background, it will not post any messages about success or failures to stdout/stderr — that might interrupt what you are currently doing in foreground. Instead, it is entirely quiet in case everything is okay.

When something fails (e.g. the server which hosts your git repository is down), update.sh will create a file called ERROR in your configfiles directory. My zshrc is configured to pick this up in its prompt and display it prominently in red:

setup_prompt() {
    local _cfg_nag

    if [ -f "$(dirname $(readlink ~/.zshrc))/ERROR" ]; then
        _cfg_nag="%F{red}cfg-git-error%f "
    else
        _cfg_nag=""
    fi

    PROMPT="%K{cyan}%F{black}%m%k%f ${fg_green}%~${fg_no_colour} \$(get_git_prompt_info)$_cfg_nag$ "
}

setup_prompt

So whenever something is wrong, you will end up with a prompt like this:

zsh: cfg-git-error

In order to figure out what went wrong, view the file last-update.log in the configfiles folder. Afterwards, just delete the file ERROR.

Committing changes

There is nothing special to watch out for when committing your changes. That is, you could edit ~/.zshrc, then go to the configfiles directory and commit your changes with git commit -a. Don’t forget to git push your changes afterwards. Also, git add -p might come in handy to only add specific parts of a file.

Pitfalls

In order to help with trouble-shooting, here are a few mistakes I have done in the past:

  • I thought it’d be a clever idea to check out the configfiles repository once in /etc/configfiles and run initialize.sh for each user. The obvious problem is that as a user, you don’t have permission to write to /etc, thus you cannot upgrade. So this idea only works out when you log in as root by default, which you should avoid.
  • You should not use git stash on your own in the configfiles repository. update.sh tries to stash any changes and will then just unconditionally try to pop the latest stash entry after pulling.

by Michael Stapelberg at 15. March 2013 21:17:40

ociru.net

keeping your dotfiles in git

If you’re commonly working in different environments, you sure want to keep your dotfiles (like .zshrc, .vimrc and so on) in sync. Of course you can use rsync or unison for that, but let’s face it, it’s not that easy: in most cases, you can’t be sure that every system is loaded with the same versions of your tools and some configuration parameters may break your workflow if they are not supported by the installed release. In addition, you may want to have different settings (like http_proxy) in your environment, depending on where you’re working.

The goal of this article is to share my way of keeping my dotfiles in sync. Please, think about it before blindly adapting - it may not work for you!

I’m using a git repository for my dotfiles with branches for every system - or group of systems. There is also a master branch containing common files and settings. For dotfiles that support includes, I keep the settings split into the two branches where the master branch contains the common file and the host-specific branch contains another file with the specific settings for the local host. That way, I can update the master branch files and roll them out on every system and I can update side specific files without spreading them to systems where the settings may not work or are unwanted.

As an example:

1
2
3
4
5
6
7
8
9
10
11
12
13
shl@macbook ~/.dotfiles (git)-[master] % git branch
  macbook
* master
shl@macbook ~/.dotfiles (git)-[master] % ls -1
vimrc.common  
zshrc.common
shl@macbook ~/.dotfiles (git)-[master] % git checkout macbook
Switched to branch 'macbook'
shl@macbook ~/.dotfiles (git)-[macbook] % ls -1
vimrc.common          
vimrc.macbook  
zshrc.common          
zshrc.macbook

Deploying a new system would be a workflow like this: (git pull and git push are omitted)

1
2
3
4
5
6
7
shl@bigmac ~/.dotfiles (git)-[master] % git branch
  macbook
* master
shl@bigmac ~/.dotfiles (git)-[master] % git branch bigmac
shl@bigmac ~/.dotfiles (git)-[master] % git checkout bigmac
Switched to branch 'bigmac'
shl@bigmac ~/.dotfiles (git)-[master] % for f in `ls -1`; do ln -s ~/.dotfiles/$f ~/.$f; done

If you are into make, build yourself some macros like newbranch, install or update to create/update the symlink infrastructure. Keep in mind, that after the creation of a new branch, local/site specific files are included but not present, yet. Depending on the tool the dotfile is for, do something like this:

1
2
3
4
if [ -e "~/.zshrc.$HOSTNAME" ]
then 
  source ~/.zshrc.$HOSTNAME
fi

15. March 2013 12:16:00

11. March 2013

ociru.net

PXE with a FritzBox (without modifications!)

Deploying a new system with removable media like thumb drives or CDs is a pain, even without the initial boot floppies like in the old days. Booting from the network is pretty much straight forward, and having a rescue system like GRML on hand can be a blessing. But in most home networks, the infrastructure is based on a FritzBox to combine DSL/cable, DECT and other neat’ish things. These Boxes are not able to provide boot information from the integrated DHCP server without flashing a firmware-mod like Freetz. This will not only vanish your warranty, you could say good bye to some of the features as well.

Happy days: there is a workaround. ;-)

Dnsmasq can be used as a DHCP proxy and - in addition - can be used to enrich the answer from the FritzBox with boot information!

You’ll have to deploy Dnsmasq on another box or your home server - it can’t be run on the FritzBox itself. If you don’t have a suitable home server yet, I recommend to buy a HP N40L Microserver (simple, power efficient, cheap) or a (used) MacMini. On Debian/*buntu it’s aptitude install dnsmasq, on Red Hat based distributions it’s yum install dnsmasq. Have a look at /usr/ports/dns/dnsmasq if you’re on FreeBSD.

First: throw away the packaged configuration and replace it with this:

1
2
3
4
5
dhcp-range=192.168.178.0,proxy
dhcp-boot=pxelinux.0,192.168.178.16,192.168.178.0
pxe-service=x86PC,"Automatic Network boot",pxelinux
enable-tftp
tftp-root=/usr/tftproot

In this example, 192.168.178.0/24 (default on newer FritzBoxes) is the home network and 192.168.178.16 is the box running Dnsmasq. TFTP is provided by the same host (/usr/tftproot) and the boot file name is pxelinux.0. Line 3 is not a typo, don’t add the .0 here or the client will try to get pxelinux.0.0.

If you want to disable the DNS functionality - and you should, because the FritzBox is already keeping track on your home network - just add the following line to the config:

1
port=0

That’s pretty much everything. Of course, /usr/tftproot has to be populated by valid boot files, but that’s another tutorial or a short Google search.

11. March 2013 09:42:00

10. March 2013

sECuREs Blog

DavSync for Android

I just released github.com/mstap/android-davsync, a FOSS tool with which you can (automatically or manually) upload photos to your WebDAV server.

10. March 2013 22:55:00

09. March 2013

ociru.net

Hi there!

Welcome to my new blog.

For the last couple of years, I used to write articles at blogs.interdose.com but after I left Interdose and sold my share, I decided to move my blog to a more generic domain. But not only the URL is different, I also migrated from Wordpress to Octopress. And from now on, I’ll blog in english to reach a wider audience. My english is not perfect, but I’m eager to improve. :-)

So? Who is blogging here?

My name is Sebastian. I’m a Karlsruhe based IT professional with a passion for Un*x and Networking. This blog will be all about Linux, (Free)BSD, commercial Unices like Solaris or Apple MacOS (yes, I know), IP networking, OpenAFS (and maybe other storage mechanics) and other things coming to my mind - but with a focus on technology. I do maintain a second blog, this one in german, about paleolithic nutrition, self-organization and other things you can do with a fully equipped kitchen. Skydiving - a yearlong dream of mine - may get a topic, too.

Engines used

Seasoned with git, TextMate, some perl and various CLI tools on FreeBSD, stored on Dropbox.

Have fun reading!

09. March 2013 09:09:00

16. February 2013

SDK2.3b

Netatalk 3 + OSX Mountain Lion

Nachdem Debian mit netatalk 2 aufwartet und das unter Mountain Lion nicht funktioniert, hier gibt es hilfe:

http://www.zanechua.com/2012/09/linux-mint-debian-edition-with-netatalk.html

Kurz zusammengefasst:

wget http://sourceforge.net/projects/netatalk/files/netatalk/3.0.2/netatalk-3.0.2.tar.gz
tar xvzf netatalk-3.0.2.tar.gz
cd netatalk-3.0.2
./configure --enable-debian --enable-zeroconf --with-cracklib --with-acls --with-ldap --enable-tcp-wrappers --with-init-style=debian
make
checkinstall --pkgname=netatalk --pkgversion="$(date +%Y%m%d%H%M)" --backup=no --deldoc=yes --default --fstrans=no

Danach sollte netatalk installiert sein und im Homeverzeichnis eine .deb Datei mit Netatalk 3 liegen.

Nun die Konfigurationsdatei anpassen (/usr/local/afp.com):

;
; Netatalk 3.x configuration file
;

[Global]
; Global server settings
hostname = Tweety
uam list = uams_dhx.so uams_dhx2.so uams_guest.so
zeroconf = yes
guest account = nobody
save password = no
log file = /var/log/netatalk.log
log level = default:maxdebug


[Homes]
basedir regex = /home

[Raid5]
path = /mnt/raid
cnid scheme = dbd
ea = auto
mac charset = MAC_ROMAN
invisible dots = yes
unix priv = yes
search db = yes

Als letztes noch die Startskripte anpassen:

sudo update-rc.d -f netatalk remove
sudo update-rc.d netatalk defaults

...und schon rennt die Kiste...

by Stefan Krauth at 16. February 2013 16:56:46

27. January 2013

wobbleing soup

19. January 2013

sECuREs Webseite

The C write() pattern

The C write() pattern

Geschrieben von: Michael am 19.01.2013

When writing data to a file descriptor (file, socket, …) in C, it is recommended to use a loop to write the entire buffer and keep track of how many bytes write() could actually write to the file descriptor. This is how to write data to a file in C in a naive way:

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <err.h>
#include <errno.h>

int main() {
    int fd = open("/tmp/pattern.example",
                  O_CREAT | O_TRUNC | O_RDWR,
		  S_IRUSR | S_IWUSR);
    if (fd == -1)
        err(EXIT_FAILURE, "Could not open() file");

    const char *data = "This data illustrates my point.";
    /* This is WRONG, don’t do that: */
    write(fd, data, strlen(data));

    close(fd);
    return 0;
}

…and here is how to write data with the aforementioned pattern:

const char *data = "This data illustrates my point.";
int written = 0;
int n;
while (written < strlen(data)) {
    if ((n = write(fd, data + written, strlen(data) - written)) < 0) {
        err(EXIT_FAILURE, "Could not write() data");
    }

    written += n;
}

In case it is not entirely obvious what happens here: write() returns the amount of bytes it wrote, and that might be less than you specified. Therefore, we keep track of how many bytes were written and try to write the rest, until finally all data was written successfully. Be careful, though: a return value of -1 signals an error, so you need to handle these carefully.

The reason I am writing about this pattern is to illustrate it with real-world examples. We recently received a bug report for i3 (ticket #896, direct link omitted due to spam bots) which stated that i3bar would crash in a certain setup when switching workspaces. This report was only reproducible on OpenBSD, which tends to use conservative buffer sizes for many things.

It turned out that the cause for the crash was an error in our write code, which would fail to properly call write() multiple times. This never came to our attention previously because the data we send upon workspace switches got larger only recently and the buffer sizes on Linux still fit all of the data in a single write() call.

Another interesting behavior of some system calls is that they might return an error which means that you should just repeat that call. Two such error codes come to mind: EAGAIN and EINTR. The former is only relevant for non-blocking file descriptors, and means that performing that write() would block the process. EINTR means the system call was interrupted by a signal.

The same piece of code which contained the bug I talked about earlier was also not prepared to handle EAGAIN: when you switched workspaces often enough, the scheduler might give i3 so much CPU time — and none to i3bar — that i3 filled up the socket buffer and write() returned -1 with errno set to EAGAIN.

In conclusion, the correct write pattern looks like this:

const char *data = "This data illustrates my point.";
int written = 0;
int n;
while (written < strlen(data)) {
    if ((n = write(0, data + written, strlen(data) - written)) < 0) {
        if (errno == EINTR || errno == EAGAIN)
            continue;
        err(EXIT_FAILURE, "Could not write() data");
    }

    written += n;
}

by Michael Stapelberg at 19. January 2013 11:00:00