bouni's blog

locale-gen fails on raspberry Pi

| Comments

I’ve tried to generate the locales on my Raspberry Pi, but i ran into a problem that i was not able to solve for a few hours.

1
2
3
4
5
root@rpi: ~$ locale-gen
Generating locales...
  en_US.UTF-8.../usr/bin/locale-gen: line 41:   303 Killed
localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias
$locale

locale gave me another error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@rpi: ~$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES=C
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

But finally i found the solution in an inconsiderable forum post. The reason for the locale-gen error is simply not enough RAM!

The solution is easy, just create a swapfile:

1
2
3
4
fallocate -l 512M /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

Then run locale-gen again and it works :–)

Good bye Arduino IDE

| Comments

I’ve worked with the Java based Arduino IDE for a long time now, and always thought that i miss the comfort of vim. But for soom reason i never searched for an alternative, but yesterday i had enough of that shit piece of software!

Ino

So i googled a bit to find an alternative and stumbled upon ino. After a few test i must say that ino is exactly what i was looking for :–) Take a look at the quickstart to see how easy it is.

HTML5 ajax file upload with flask

| Comments

Making web uploads less painfull

For one of my current Flask projects i want to have a nice looking and easy to use file upload form. That means no <input type="file"> form field where i have to select each file and the upload it on at a time. I came across this nice tutorial for a HTML5/jquery file uploader, but the backend is written in PHP. So I decided to try to get this working with Flask and it was easier as I supposed :–)

Comments activated

| Comments

I finally activated the Disqus comment system for my blog. I wanted to do this for a while now but was to lazy to do it :–)

The MDB protocol [part 3]

| Comments

Last Tuesday I’ve nearly finished the complete code for the MateDealer project. After I’ve successfully vended a Club Mate (that is the drink the MateDealer got it’s name from) I loged the MDB communication with my logic analyzer. I have taken a few screenshots of the logic trace and now i will try to explain the complete procedure.