[208150 views]

[]

[toggle ads]

Odi's astoundingly incomplete notes

New Entries

BT battery strength support upcoming in 3.3

Yey, the 3.3 kernel will report the battery strength of Bluetooth mice and keyboards! The patch just went in.

posted on 2012-01-11 11:58 CET in Code | 0 comments | permalink

Upgraded from x86 to x86_64

Yesterday I have upgraded my 2006 MacBook Pro from 32 to 64 bit Gentoo. It went notably smooth. This was the ONLY reinstall in five years. Here the full beauty of Gentoo shows: smooth upgrades from a 2.4 kernel then to 3.1 today, kde-3 to kde-4.7, glibc, etc. everything without ever completely reinstalling and not being able to do something else while it's upgrading!
Downtime for this one: one night during which it was recompiling everything.

The steps involved were more or less: I don't have real performance figures. But it feels a lot faster and smoother on x86_64. Especially emerge --sync now takes only seconds while before it could take minutes. No idea what causes that much difference.

posted on 2011-12-28 21:25 CET in Updates | 0 comments | permalink

EDITOR and PAGER in Gentoo

Gentoo lets you define your locale, editor, visual (vim), pager (less). They set the respective environment variables. By default these are unset. Make sure to set them.:
eselect locale
eselect pager
eselect editor
eselect visual
eselect vi

posted on 2011-12-23 13:53 CET in Code | 0 comments | permalink

openssl version information in ELF binaries

It seems that on Debian the OpenSSL libraries (libssl.so, libcrypto.so) contain symbol version information. Binaries linked on a Debian system against OpenSSL may thus contain version requirements on these shared objects.

Gentoo (and other distributions) does not have OpenSSL built with version information. Using a Debian binary (like spotify) on such a system causes ldd to complain about the missing version information:
/usr/lib64/libcrypto.so.1.0.0: no version information available
/usr/lib64/libssl.so.1.0.0: no version information available
Gentoo's revdep-rebuild thus detects the binary as broken. To fix this issue we can modify the binary and remove the version information in question.

I have hacked up a little Java utility that does just that. It should work on most ELF binaries that link against openssl. Yes it's Java, as it's the language I'm fluent in. Feel free to convert it to C.

Download ElfFix.

posted on 2011-11-30 17:44 CET in Code | 0 comments | permalink

Oracle without swap works

I previously thought it wasn't possible. But now I have got it working.

posted on 2011-11-29 17:41 CET in Updates | 0 comments | permalink

Oracle without swap

I have been running Oracle 11.2 on x86_64 linux 2.6.39 with no swap and transparent hugepage support. The system has 6GB RAM and vm.overcommit_memory=0.
Oracle is configured to using automatic memory management with MEMORY_TARGET = 4000M. There is nothing else on the system. So 6GB vs 4GB should be plenty, right? Wrong.

While Oracle would run fine most of the time, sometimes connect fails with:
ORA-01034: ORACLE not available
ORA-27102: out of memory
Linux-x86_64 Error: 12: Cannot allocate memory
If you go to the server and check the memory usage, all seems fine however:
~ # free -m
             total       used       free     shared    buffers     cached
Mem:          5972       5714        257          0         11       4078
-/+ buffers/cache:       1624       4347
Swap:            0          0          0
After adding a little swap file (1 GB) the problem goes away. With vm.swappiness=40 the swap usage remains stable at around 250MB. So what's going on here?

Obviously free's output of 1.6GB used memory is wrong. The 4GB SGA lies in the shm filesystem, and obviously doesn't show up here. Why? Because in Linux shm is mapped to the filesystem cache. I guess this is a trick so that reads from shm do not get copied to cache. So to get the real memory usage you have to add the shm usage to free's output. And that sum is 5.6GB. Which is admittedly a bit much for a 6GB swapless system.

So to fix this, I reduced the SGA to  3.5GB. This results in a bit less than 5GB used memory. And now it works fine without swap!

posted on 2011-11-25 13:44 CET in Code | 2 comments | permalink
-this may be a fork() related problem: Linux doesn't let you fork unless it can pre-allocate enough space, even if it's never actually used. You may need enough swap space to host the memory image in swap if needed.
I am not convinced. That would mean fork() doesn't work at all in a system with no swap. Which is obviously not the case.

Localization gone wrong.

Today I recevied an Excel file with dates that look like this:
I guess this is an attempt to translate the AM/PM format into German. "nachm." meaning "in the afternoon". However in German the AM/PM notion for time is completely absent. And people always get it wrong (12 AM is noon or midnight?). We use the 24 hour format. Period.

posted on 2011-11-23 11:50 CET in Code | 0 comments | permalink

Spotify on Gentoo

Spotify is available in my country, yey! I have written an ebuild for Gentoo that actually works. The trick is to symlink old openssl so names to openssl-1.0.0. Spotify does not actually depend on the old version (it crashes with it). It merely expects the old so names instead of the (correct) new ones.

posted on 2011-11-19 13:28 CET in Code | 0 comments | permalink

Kaki jam

Winter is closing in. That's the time when the kaki ripen. So today I made delicious jam from kaki and apple.

I used This will give about 3 kg of jam. So make sure to have enough jars ready. Soak them in hot water and sterilize them with some cheap alcohol.




Carefully peel the kaki. They have a very thin but hard peel. This is going to be messy as the fruit easily turn into sludge while being peeled. You'll like it, trust me :-) Collect the peeled fruit in a large pot.



Peel also the apple and cube it. Pre-cook the apple in a sip of water in a small pot until soft.



In the large pot, mash the kaki. Then add the cooked apples. Add a small piece of real vanilla to taste. Cook a the mixture for 10 minutes while stirring constantly.



Blend the mixture into a smooth mash.



Now add the sugar and gellant. Stir gently and cook for another 5 minutes. Then fill into the prepared jars. After closing the lids turn the jars over and let them cool off.



Time to enjoy the remaining hot jam in the pot with your fingers!

posted on 2011-10-30 17:48 CET in Food | 0 comments | permalink

Strange J characters in email

Have you ever wondered why the character J appears seemingly randomly in email you receive? Raymond has the explanation.

On a side note this happens for me because my Linux installation does not have the Wingdings font installed.


posted on 2011-10-07 11:07 CEST in Code | 0 comments | permalink