/usr/portage

Ubuntu Linux on an Asus EeePC 901 1

I got an Asus EeePC for Christmas. As a long time Linux user the pre-installed Windows XP version had a very short life, something around ten minutes to check that the hardware is working. In general installing Linux is not very hard, actually the harder part was to build the install USB stick, as the EeePC has no disk drive. But first a few sentences about the EeePC.

The Good

The device is small and looks cute so the girl acceptance level is pretty high as my personal girl acceptance level test girl confirmed. It just feels right. The weight is alright, 1.1kg is fair enough. Three USB slots, one more than my Apple Mac Book, so good too. VGA out, fine, SD card slot, alright, not that I need it but … RaLink WiFi chip, Gigabit network, built-in web cam, Bluetooth, synaptics touch pad. That’s pretty good, sounds like a complete computer, doesn’t it? The display resolution is 1024×600 – good for such a small device.

The Bad

As as result of the overall size, the keyboard is of course small too. Also I’m now writing this entry on it, it takes some time to get used to it. The position of the pipe/less/greater-key is annoying as it can only be reached in combination with the fn modifier key. This is not very convenient for a programmer. The rest of the layout is more or less standard and it doesn’t take so long to not miss every key.

The Ugly

When I tried Bluetooth the first time, the device was not detected at all. Neither on Windows nor on Linux. But while changing other stuff I found out that the Bluetooth adapter was disabled in the BIOS. It is a nice feature to allow to hard disable some features in the BIOS but disabling anything by default seems not like the most clever idea. So please fix, Asus.
Sadly the EeePC suffers a heat problem. If you stress it a bit it gets really hot on the downside (like the Mac Books). So don’t put it on your naked thigh.

Choosing the Right Distribution

I have the model with two solid state discs which makes a total of 12GB disk space. Not very much but enough for my use cases (and I always wanted to have a SSD based device). I decided to go with Ubuntu:http://ubuntu.com also I normally prefer Gentoo because of the size. Source base distributions like Gentoo don’t differentiate between the actual packages and the header files so a complete Gentoo installations takes a lot more disk space than any binary distribution. Additionally, it was Christmas evening and I wanted something quick. While Gentoo is flexible, it is not quick to install.
Although I chose Ubuntu, I would roughly guess that Fedora or SuSE would work fine too, please leave a comment if you have an experience to share.
I chose Ubuntu mainline, not Eeebuntu because I want to have the latest and greatest Ubuntu and I can configure my panel myself.

Preparing the Installation

Before you read on further make sure you understand that this is not about a dual boot installation. I completely removed the Windows system, so please make sure this is what you want too.
First of all we need a boot medium. There is an SD card slot and a number of USB ports, so the alternatives are USB disk drive, SD card, USB stick. I chose the latter but the rest should work too. Creating an USB boot stick requires a bit of manual work: download the Ubuntu Intrepid Ibex (8.10) ISO image for 32bit computers (Atom CPU) then:

Installing Ubuntu from the Stick

Now the USB boot stick is ready. Just plug it in, type F1 to select the boot menu, choose the stick as the boot medium, boot from it and install Ubuntu as usual. Everything is detected and configured correctly including the synaptics touch pad, web cam and screen. The only missing components are the WiFi adapter and the specials keys. The keys generate ACPI events so it should not be hard to get them running. However, I don’t use specials keys so I don’t care.
The WiFi adapter is a RaLink RT2860 and RaLink provides a driver for it. You could download and manually compile this driver but I found it more convenient to have specific package for it.

Installing the Right Kernel

The linux-eeepc-lean kernel from array.org works really well and includes support for the RaLink WiFI adapter. Just follow the setup instructions to install it. Then boot the new kernel and, if everything works fine, edit /boot/grub/menu.lst to use the eeepc lean kernel as the default kernel. The Ubuntu installation is now done, enjoy!

Filed on 28-12-2008, 18:06 under , , , , & one comment & no trackbacks

Recovering a software RAID 0

The scenario: my RAID crashed because I’ve messed around with the partition table of one of the disks in there. This results in a RAID array not being able to assemble itself because the superblock of the messed up device is invalid. The trick is pretty easy: just recreate the whole RAID with mdadm. The existing metadata will not be overwritten, the current information is just replicated. I used to have a simple RAID1, but I’ve now recreated it as an incomplete RAID5 (--level=5, --raid-devices=2) as the missing disk is soon to be bought.

$ mdadm --create /dev/md0 --level=5 --raid-devices=2 /dev/<original> /dev/<crashed>

If you like to stick with a RAID1, and not doing the migration to RAID5 along the way, just use --level=1 instead. I’m not really sure if the order of the disks matter and I’m not brave enough to find it out.

Tomorrow I’m going to buy the next disk for the RAID to make sure the redundancy level is alright. Generally I’m pretty amazed that this kind of setup is so robust. Even me messing around with it can’t bring it down.

Filed on 13-09-2008, 03:03 under , , , & no comments & no trackbacks

Sound on a 3rd generation MacBook 2

Thanks to the heros on the Mactel list I have sound again. If you use Linux on a MacBook of the third generation and your soundcard has been detected but just no sound will come out, putting the following in /etc/modprobe.conf (on Gentoo: /etc/modprobe.d/alsa and modules-update afterwards) should fix the problem. Please reboot or reload snd-hda-intel after changing the configuration. NOTE: it has been reported to work fine on MacBook Pro’s too.

options snd-hda-intel index=0 model=mbp3

Filed on 10-06-2008, 08:08 under , , , , , , & two comments & no trackbacks

Browse Ubuntu patches 0

Ubuntu does a lot of patching on free software/open source projects. This patches are often really helpful but they were hard to find in the past. This has changed now as there is a location to browse applied patches by packages. Thanks, Ubuntu!

Filed on 14-11-2007, 14:02 under , & no comments & no trackbacks

Xorg and Samsung SyncMaster 205BW 2

Next time I when try to set up a huge display as an external monitor for my MacBook, I will use DVI, not VGA. Because DVI works wonderfully, VGA does not. This enables the display above the builtin LCD (left or right is not possible with current intel drivers, because maximum virtual screen size is 2048×2048):

xrandr --ouput TMDS-1 --auto --above LVDS

Update

Sometimes after plugging in xrandr does not list the correct resolution for the external device. In that situation you need to create them by hand. The following three-liner does all the work for you:

xrandr --newmode "1680x1050" 149.00  1680 1760 1944 2280  1050 1050 1052 1089
xrandr --addmode TMDS-1 1680x1050
xrandr --output TMDS-1 --mode 1680x1050 --above LVDS

Filed on 30-10-2007, 13:01 under , , , & two comments & no trackbacks

Wireless LAN with a 2nd generation MacBook and kernel 2.6.22.1 0

First of all, you need hal from the 0.5.9-serie, then fetch madwifi-hal-0.9.20.3-current.tar.gz and my patch (adapted from http://madwifi.org/attachment/ticket/1315/141-Madwifi-fixes.patch). Apply this patch, ignore the first two chunks, execute make, make install and then reboot. Finally the device ath0 exists which is your wireless device.

Filed on 13-07-2007, 09:09 under , , , & no comments & no trackbacks

To spread or not to spread 3

A few days ago, SpreadGNOME has been launched. While it is a good idea to split developer-pages and marketing-pages, as like Mozilla does it with mozilla.org and SpreadFirefox, pages like SpreadGNOME should have the appeal of a marketing-page. There should be funky screenshots, big headings, concise texts – the page should give the visitor the impression of cool people, writing sexy software which is much better than the thing he currently uses. Just ask yourself: is this the impression you get when you visit SpreadGNOME?

Update

There is a new design but this does not look like a »The most important thing you miss in your life is using GNOME«-page, sorry. Putting links to a tech-orientated news-portal, a wiki-page for developers and gnome.org is not that imaginative.

As they are calling for suggestions, they could have them:

Filed on 27-08-2006, 18:06 under , , & three comments & one trackback

What to do? 0

During my daily work I often heard discussions about how to handle charset properly. What a server must provide to handle charsets correctly, which configuration for Apache is needed, what options must be set in php.ini to make PHP correctly working, which functions should be avoided when using PHP, which locales must be used and so on. So I want to give a short overview how to sail around common problems in a LAMP-setup.

Kernel

Just to make sure the option CONFIG_NLS_UTF8 is set to y.

Environment

To make sure, newly created filenames are there in UTF-8 and in general VT-input is handled correctly, you have to choose a charset, which comes with an .UTF-8-suffix. For german feel free to choose de_DE.UTF-8. Make sure your glibc is provides this locales. To convert current names of files you can just use convmv. For a desktop you must also adjust the font and set a correct TTY-font but this could be ignored for a server which is just administrated via remote shell.

Webservers in general – focus on Apache

To make sure, the users input is UTF-8, the server has to deliver the correct Content-Type-header. Take a look at the output of wget -S http://usrportage.de, my weblog, which is hosted on Schokokeks.org, a properly configured server (sure!):
wget -S usrportage.de
—21:00:33— http://usrportage.de/ => `index.html’
Resolving usrportage.de… 87.106.4.7
Connecting to usrportage.de|87.106.4.7|:80… connected.
HTTP request sent, awaiting response… HTTP/1.1 200 OK Date: Thu, 13 Jul 2006 19:00:27 GMT Server: Apache X-Powered-By: PHP/5.1.4-pl0-gentoo with Hardening-Patch X-Blog: Serendipity Set-Cookie: PHPSESSID=9da2ded6522851ef8ddc3ebe7590b354; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache X-Serendipity-InterfaceLang: de X-FreeTag-Count: Array Connection: close Content-Type: text/html; charset=UTF-8
Length: unspecified [text/html]

[ <=> ] 65,557 250.71K/s

21:00:33 (250.19 KB/s) – `index.html’ saved [65557]


You see the header Content-Type: text/html; charset=UTF-8. (You can also the a bug in S9Y, which poorly casts an array, but anyway.) So your browser is notified, that it should send UTF-8 encoded data. That’s the whole secret. To configure Apache properly, make sure the directive AddDefaultCharset is set to UTF-8.

One thing at last: if you’re using AJAX-functions from Prototype for JavaScript-purposes, you have to reencode the string delivered by the AJAX-call. In PHP the following would work:
$string = utf8_encode( $_POST[‘key’] );

MySQL

Before transacting any data, make sure your connection charset is set to UTF-8:
SET NAMES utf8;
By the way: have I ever mentioned you should ever use mysql_real_escape_string() instead of mysql_escape_string()?

PHP

Just two rules: use mb_string-functions whereever it is possible, set the INI-setting default_charset to UTF-8 and – anyway – don’t use functions from the ereg-family also they have an mb_-Prefix. They aren’t binary-safe, that’s all you need to know.
Also make sure, your sources are UTF-8 encoded. Use iconv to correct those who are not.

Update


I forgot to mention, that the functions htmlentities(), html_entity_decode() and htmlspecialchars() does not reflect PHPs default_charset-directive but assumes iso-8859-15 as the default charset, which is pretty annoying and should be considered as a bug, from my point of view. So you need to pass UTF-8 as the third parameter to the function to make sure it will work properly with Unicode.

Filed on 13-07-2006, 20:08 under , , , , , , , & no comments & no trackbacks

Zeroconf magic with Gentoo 1

With GNOME 2.14 Avahi, the implementation of the Zeroconf-specification from Freedesktop, is shipped with. It brings the convenient feature to autodetect services. As you can see on the screenshot, it detects a lot of services and provides the possibility to use them on »one-click«. This Zeroconf-technology is looking back to a confusing history: there are two implementations before avahi: howl and mDNS, which both have licensing issues. So the Freedesktop-project brings us a good step forward and it works as easy as you can’t imagine. Licensing issues prevents Ubuntu from integrating howl or mDNS, but let us hope, they will integrate it now.


Gentoo-magic:


Build required packages:
Set the USE-flags »avahi«, »bookmarks«, »dbus« and »python« and emerge net-dns/avahi. Now emerge x11-misc/service-discovery-applet. After all, rebuild affected packages to reflect the USE-flag change (emerge -DuN world) and to guarantee full support for avahi.


Start required services on boot
Add avahi:

# rc-update add avahi-daemon default
	
  1. rc-update add avahi-dnsconfd default


Start required services

# /etc/init.d/avahi-daemon start
# /etc/init.d/avahi-dnsconfd start

To be complete, just add the new panel-applet to your panel and employ the new possibilities.

Filed on 08-06-2006, 02:02 under , , , , , & one comment & no trackbacks

Portage-notification for Gentoo via Jabber 3

Getting notified via mail about recent warnings, information messages and error on your Gentoo system is good thing but getting notified via Jabber could be also helpful in some cases. The new notification framework of portage in the current 2.1-serie previews makes it easy and possible to implement somthing like this. To show how easy it is, I did it. You can see the result in the Gentoo Bugzilla. I am utilizing XMPPPY, a friendly Python-library to do so.

How to use?
1.) Install an ebuild of the 2.1-serie of sys-apps/portage
2.) Install dev-python/xmpppy
3.) Copy this file to /usr/lib/portage/pym/elog_modules/mod_jabber.py
4.) Edit /etc/make.conf and set the following options:
PORTAGE_ELOG_SYSTEM="jabber" PORTAGE_ELOG_JABBERFROM="sender@host.com:password" PORTAGE_ELOG_JABBERTO="jid1@host.com jid2@host.com admin@foo.com"

Update:
As of a request by solar and Jacub Moc I did a proper release which is availiable there and wrote an ebuild. All you have to do now is to install the ebuild and edit you configuration.

Filed on 21-05-2006, 15:03 under , , , , , , , & three comments & no trackbacks

Ejabberd 1.1.1 in BreakMyGentoo 0

I’m proud to provide a new Ejabberd-ebuild to our users. Ejabberd 1.1.1 comes with an important new feature: it supports MySQL natively. I fixed up PostgreSQL-issues in the ebuild and provide now the native drivers for MySQL and PostgreSQL Also I’m happy to mention that NU2M, the company which is involved in Mabber and for which I’m currently working for, is going to release some really interesting Jabber-components, especially for Ejabberd, during the next weeks.

Links

Filed on 07-05-2006, 02:02 under , , , , , , , , & no comments & no trackbacks

Just broken 10

Some months ago I ranted about Gentoo’s Ejabberd-ebuilds and I want to comment another issue: Ejabberd provides support for PostgreSQL via its ODBC-drivers. That’s reflected in the ebuild, there is a postgres USE-flag. That’s generally fine, but helps nothing, ’cause you need the native PostgreSQL-driver from the jungerl-distribution. But: there is no ebuild in portage. Whether you can’t find jungerl nor the native PostgreSQL-driver in portage, which makes the USE-flag buggy one the one hand and completely useless on the other hand. Is it common not to test functionality when adding a USE-flag?

Filed on 01-05-2006, 17:05 under , , , , , , , & ten comments & no trackbacks

April, April 0

Machte meinen Tag:

From: Georgi Guninski
To: full-disclosure@lists.grok.org.uk
Subject: [Full-disclosure] Linus mass killing integer overflows
[...]
the news is, the benevolant dictator has said “let there be C++”, and there is more secure, full featured, reliable and faster linux kernel written2 mainly in C++. the official release is scheduled for 2.8 or when redhat™ becomes ready for the desktop3, whichever comes first.

key improvements include:

a) integer overflows were PITA for the kernel janitors. once the classes SafeInt and SafeLong were implemented with suitable operators, the new kernel is 100% “int/long too big” free. the refactoring tool made this part easy.
b) some clever abuse of exceptions dramatically reduces the amount of OOPS:
cases like ‘(SafeInt)0=foo->bar()’ are now gracefully catch()ed, killing
the OOPS.
c) kernel structures were just lame emulation of C++ objects. now they are native C++ objects.
d) exceptions result in cleaner, easier to read code and almost stop the nasty abuse of “goto”

currently there are discussions for implementing COM in the kernel and/or scripting the kernel from userland, but Linus hasn’t made up his mind yet.

the first public prerelease will be available from ftp://ftp.kernel.org/pub/linux/kernel soon.


Reply:
My wishlist for 2.8:
-jvm (should boost my swing apps)
-sql support to query kernel table and fs data
-lisp and prolog interpreters (don’t have a use for this but I’m sure somebody will need it)

Reply:
The kernel folks have taken a seriously wrong turn here. They should have delayed the preview release until the garbage collector was ready. That’s where the real value for these patches starts.

Regards,
Brian


Reply:
> My wishlist for 2.8:
> -jvm (should boost my swing apps)

agreed. i vote for implementing parrot – http://www.parrotcode.org/ to avoid
perl vs python vs java flames.

> -sql support to query kernel table and fs data

this seems a bad idea. what if a mcse discovers a sql injection in kernelspace? the side effects may be worse than a cake on b1l1.

> -lisp and prolog interpreters (don’t have a use for this but I’m sure
> somebody will need it)

rms likes lisp, so we can count on him.

Filed on 01-04-2006, 20:08 under , , , , , & no comments & no trackbacks

Migration allenthalben erledigt 0

Was Hanno und Stefan schon zu berichten wussten, gibt es nun auch hier zu lesen: Schokokeks.org ist umgezogen.


Continue reading "Migration allenthalben erledigt"

Filed on 28-03-2006, 11:11 under , , , , , , , , & no comments & no trackbacks

jabber.breakmygentoo.net 0

I’d put jabber.breakmygentoo.net in the vhosts of our ejabberd, so feel free to register a Jabber-account, if you are a BreakMyGentoo-developer. Otherwise you’ll become virtually tared and feathered, you understand?
Also you can join us in breakmygentoo@conference.jabber.breakmygentoo.net.

Filed on 05-03-2006, 20:08 under , , , , , , & no comments & no trackbacks

Newer Entries ↘