Headless RaspberryPi 2 installation with Raspbian Jessie
Last night, I wanted to setup my new RaspberryPi 2. I don’t have a TV, and also no spare monitor with HDMI around the appartment, so it had work without it. I ran into an issue with the Raspbian update to Jessie, so here’s how to avoid that.
- Download the Raspbian image from the Raspberry Pi Foundation. You’ll have to extract it and write it to your Micro SD card. That’s pretty well explained in their documentation, so I will let you read that. Unfortunately, the image is based on Raspbian Wheezy, so we’ll have to update to Jessie by ourselves later.
- Put the flashed SD card into your Raspberry Pi 2, connect a network cable to it, and power it up.
- I used SSH to connect to my newly booted RPi. To do that, you need to find out its IP address. The simplest way for me was to log into my router, and get a list of all connected computers. Your RPi will have the hostname “raspberrypi”.
- Login with SSH (Linux or OS X, for Windows use a client like PuTTy):
1ssh pi@<IP address>
You’ll be asked for a password. Use raspberry . - Run through the configuration wizard, which you can start with the following command:
1sudo raspi-config
Importantly, expand your file system, and set a new password. - It’s time to update to Jessie. To do that, you need to adjust Raspbian’s sources lists. You can do so manually, by replacing “wheezy” in
/etc/apt/sources.list
and all files in the/etc/apt/sources.list.d/
directory with “jessie” using an editor likevi
ornano
, or just use the following to commands.
12sudo sed -i 's/wheezy/jessie/g' /etc/apt/sources.listsudo sed -i 's/wheezy/jessie/g' /etc/apt/sources.list.d/*
Now, update your package list:
1sudo apt-get update
and start the upgrade to Raspbian Jessie:
1sudo apt-get dist-upgrade
You’ll be asked a few times whether you want to replace certain files with newer versions. I did confirm all those with “y”, but feel free to check the actual changes and decide on each individually. - Now to the thing that kept me up a few hours longer than I planned. You’ll have to reboot after the update (because the init system changed during the update, which means Raspbian starts programs a bit differently with the new version). However, some part of the upgrade does not clean up properly after itself, and leaves you with some files that will stop the RPi from booting properly, and not letting you login via SSH after a reboot. To avoid that problem, run the following command before issuing the reboot:
1sudo apt-get purge cgroup-bin
There’s a bug report with Debian on the issue, if you want to get more details. If you already rebooted, like I did, there’s a way to recover. Unplug your RPi, put the SD card into a linux machine, and delete the file/etc/init.d/cgroup-bin
from its file system (make sure you remove it on the SD card, not your local system). Afterwards, your RPi should boot properly again, and you can run the above command to clean up properly. In this case, no need to reboot again. - Reboot your Raspberry Pi to apply the new init system
1sudo reboot
Automatically sync all folders in Thunderbird
Man, that had been annoying me for years. To access my emails, I use Thunderbird and IMAP (no Gmail). I also make extensive use of server side email filtering/sorting. It took a while to set up, due to the interface my email hoster uses, but it works like a charm. The only annoyance was that Thunderbird only ever synced my main Inbox folder, not all subfolders. So I had to go through them manually to check for new email.
Today, I finally set out to find a solution to this, and I was surprised how little of an issue that actually was. Turns out, there’s a flag in Thunderbird’s extended configuration, that let’s you enable automatic sync of all folders.
So what did I do? Start up Thunderbird, open the Config Editor (Tools -> Options -> Advanced -> General -> Config Editor), and change the mail.server.default.check_all_folders_for_new
setting to true
.
And that was it. No more going-through-all-folders. I don’t know how many hours I would have saved if I’d done that earlier.
Source of the solution was a KB article on mozillaZine.
SD card recovery using an Arduino
One of my SD card “died” the other day. More specifically, my laptop wouldn’t read it anymore, and neither would any other machines or cameras I tried. It did react (looking at the dmesg output), but would only throw errors, and not recognize any partitons on the card. So I decided to try and read it using an Arduino.
All software mentioned here is either included in your Arduino IDE (the CardInfo sketch), or available on Github. Feel free to check out some of my other stuff there as well.
ThinkVantage key to lock your screen under Windows 7
At home, I use Debian on my ThinkPad, and have remapped the ThinkVantage key on top of the keyboard to lock my screen. It’s just a single press of a button, and it makes you feel a little safer if you have your laptop standing in a semi-public space.
At work, I also have a ThinkPad, but with Windows 7 on it. Now, I wanted the same functionality on there as well. I tried doing so using AutoHotkey, but that would not recognize the key press. So some digging got me to the following solution:
- Create a small batchfile, let’s say under “C:\lock.bat”, with the following contents:
12@echo offrundll32 user32.dll, LockWorkStation - In you registry, create (I had to do so, along with the directory) or change the following key:
12[HKEY_LOCAL_MACHINE\SOFTWARE\IBM\TPHOTKEY\8001]"File"="c:\\lock.bat"
Make sure, the path matches the path to the file you created. Every backslash is converted into two backslashes.
And there you have it. For me, it worked right away. No reboot, no logging in again, it just worked immediately.
mEintopf v0.2
A few weeks ago, I jotted down some ideas on an open source soup.io clone, or at least something close to that. Since then, quite a few things have happened in that direction, which I want to get into right now.
Initially, my intention was to just throw that idea out into the open, and hope for someone to grab it and start building something awesome. As it turned out, this was a little too much hope. And since I’m not exactly the most patient creature under the sun, I soon afterwards started developing something in that direction. Continue Reading →
MySQL query log
So I was doing some work on mEintopf last night, and wanted to see, if my changes to SQL queries made it to the MySQL database or whether they got stuck somewhere in the WordPress framework. Turns out you can enable and disable query logging in MySQL with two simple SQL commands.
1 2 |
SET GLOBAL general_log_file = '/tmp/mysql.log'; SET GLOBAL general_log = 'ON'; |
The first one sets the location of your log file, and the second enables logging. Now, just do a tail -f /tmp/mysql.log to see all queries coming to your RDBMS.
Once you’re done, don’t forget to disable it again.
1 |
SET GLOBAL general_log = 'OFF'; |
Firefox debugging
Just lost my Firefox session after a restart. Apparently, it had problems parsing the sessionstore.js
file. While I didn’t fix that problem, I found out how to get firefox to be much more verbose about what it does. You have to set an environment variable, and then firefox will spit out a whole lot more on the console than it usually does.
1 2 |
tiefpunkt@tiefpunkt ~ $ export NSPR_LOG_MODULES=all:5 tiefpunkt@tiefpunkt ~ $ firefox > stdout.log 2> stderr.log |
Backup your Soup to WordPress
Let’s say you’ve spent a few minutes (or hours, or even days) of your precious lifetime on soup.io, and now you don’t want to loose your work. How would you do this? Thanks to the soup’s RSS export and a nice plugin, it’s fairly easy to copy all the content of your own soup to a WordPress installation. Including all the pictures, of course. So let’s start. Continue Reading →
Wikipedia without the BS
The german Wikipedia wiki is the second biggest Wikipedia wiki there is. Which is awesome, because if you are looking for some kind of information on pretty much any topic, there is usually something to find in de.wikipedia.org.
Es ist wieder offiziell: Das @raumzeitlabor ist irrelevant. de.wikipedia.org/wiki/Wikipedia…
— Felix Arndt (@silsha) February 2, 2013
But it is also known for its ridiculously tight rules/decisions on what is relevant or not. These discussions sometimes take quite bizarre forms, as they grow longer than the wiki article itself. A perfect example is the German hackerspace RaumZeitLabor, which has now been deleted twice, after more than a month of discussion about its relevance for the Wikipedia project (Disclaimer: I am a member of that hackerspace). Continue Reading →
Your own soup.io? – An idea.
tl;dr at the end of the post.
Let’s face it, soup.io is pretty much dead. Yes, it’s still breathing, somewhat heavily. But a lot of people are jumping the ship, and moving to Tumblr, or they just stop wasting their timesouping around.
I loved soup. I spent hours and hours scrolling and scrolling. I haven’t done it as much recently, because it’s so slow, and I just can’t seem to find the time. But if it were gone, or at least if everyone left, it would be pretty sad. I would definitely miss it. And I have a hard time believing Tumblr is the solution. I have used it for a very different purpose in the past, so for using it as a soup replacement, I would have to either get a new account (which I don’t want; too much switching around), or give up the way I currently use it (also not really an option).
So why not build something new?