Last Updated: 27/May/2004

The Samsung X10 was, for a long time, the thinnest notebook available. It’s also silver and all shiny. Obviously, I just had to have one! Specifically, the XTC1400 which boasts a Pentium-M 1.4GHz, 512Mb RAM, 40GB disk, CD-RW and wireless networking (it’s a Centrino notebook).

By default, it comes with WinXP Professional. Obviously, that just will not do! Unfortunately, it’s not the easiest laptop in the world to install Linux on. I’ve done a number of installs with several distros and have had wildly differing results – even between reinstalls of the same distro! Eventually though, Gentoo won the day…

Not that it was an easy process, mind you. Indeed, as I type this, a few features are still not working (read: ACPI). But by and large, the laptop is fully usable for day-to-day tasks. Even my Girlfriend can use it, so it must be ok!

Here’s a quick run-down:

  • Kernel – currently 2.6.6 love4. Seems very stable and relatively nippy. Edit 27/May/2004 – Now using 2.6.1 + a handful of patches.
  • Display – The biggest stumbling block for the X10 at one point. Using XOrg X11 + the latest Nvidia Kernel & GLX (5336) from Portage works a treat.
  • SoundALSA’s a bit temperamental at the moment. I had it fully working at one point, but forgot the fix when I did a reinstall. Normal users get a “Cannot find /dev/mixer” error. I know it’s fixable though, but I want to get other pieces working first.
  • Networking – The wired LAN card works a treat straight off the bat. The WiFi card took a bit of work though. Read this post on Centrino Wireless + Gentoo to get it working. I’ve had no need to use the modem, so I don’t have a clue if that works or not… From what I’ve read, it might only work with a 2.4 kernel.
  • ACPIThe major stumbling block at the moment. Some things are working, others aren’t – at the moment, only the AC adapter and battery aren’t being picked up. The problem lies with the common (missing?) ECDT error. I’ve tried adding the several potential patches to the kernel, but none have ever installed properly. Edit 27/May/2004 – fixed by reverting to 2.6.1 kernel + patches. Guide Coming Soon.
  • Speedstep – I’m not going to try the CPU frequency scaling until I’ve gotten ACPI properly working. Just in case.
  • Touchpad – Using the Synaptics touchpad driver, everything works apart from the scrollwheel/middle button. No matter of tinkering could get this to work. The driver does provide features that make up for this, but in the end, I installed a MS Bluetooth mouse instead… (guide coming soon)
  • Keyboard – Not tried to get the extra keys going yet. Last time I installed I couldn’t get them working, but I didn’t exactly try hard.

Currently I’m running Gnome 2.6 and find it very responsive. Apps load up quite fast, although I’ve not been doing anything particularly strenious with the machine since I installed Gentoo.

This page will be updated as I get more things working (and write the guides for the fixes)

Centrino is the big thing in laptops at the moment. Longer battery times despite more powerful processors and inbuilt 802.11b wireless. Unfortunately, Intel have yet to provide Linux support for the wireless component of Centrino and are a little cagey as to when it will be available.

Thankfully, the open-source community is a crafty community. NdisWrapper provides a method of loading Windows drivers to enable the wireless card.

At the time of writing, there are ebuilds in portage for NdisWrapper (latest version is 0.6-rc1). Unfortunately, they seem to be quite buggy and I’ve yet to get them to work. Instead, what I found to work best was to get the latest version from the NdisWrapper site and compile it from that source. At this time, the latest version is 0.7. Then follow the steps below to release yourself from your cat-5 tether!

Note 1: as a prerequisite, you need to emerge wireless-tools.

The Driver

  1. Download the latest source tarball to your system from the Ndiswrapper Sourceforge Project and unpack the archive.
  2. For the Intel PRO/Wireless 2100 (standard Centrino wireless card), download this driver. Otherwise, consult the NdisWrapper homepage.
  3. Open up a terminal and su to root then cd to the directory you extracted the source to.
  4. make install
  5. Unpack the Windows driver and check for a .inf file. In the above package, it should be “w70n51.ini”.
  6. ndiswrapper -i /path/to/win/driver.inf
  7. Once that’s done, type ndiswrapper -l. The name of the inf file should be listed. If not, you may have mistyped the path, so try again.
  8. modprobe ndiswrapper to load the driver. Providing there are no errors, typing dmesg should return “wlan0: ndiswrapper ethernet device…”

Configuring Your Card

The next bit will either be straight-forward or trial and error. It just depends on your setup. I had a bit of bother getting the right combination of authentication settings before I got my card to work.

iwconfig should list your card and its current settings, which will be all empty. To change this, you need to do the following:

  1. iwconfig wlan0 mode Managed if you use and access point. Otherwise, set mode to “adhoc”.
  2. iwconfig wlan0 key restricted <wifi key> will set your authentication key (hex format). Pass the -s option after key to type the key in ascii format. Depending on your setup, you may have to subsitute “restricted” for “open”.
  3. iwconfig wlan0 essid your_essid sets your network ID.
  4. ifconfig wlan0 up should now bring your wifi card online. If not, fiddle around with the settings above. Also take a look at the other options you can set through iwconfig.
  5. DHCP users should type in dhcpcd wlan0 to assign an I.P. to your card.
  6. Alternatively, to assign a fixed I.P. you need to copy /etc/init.d/net.eth0 to /etc/init.d/net.wlan0 and edit accordingly. Then type in /etc/init.d/net.wlan0 start.

If you were to ping Google or similar, you should see your connection working.

Final Steps

The tricky bit is now out of the way. All that should be left to do, is to get the card to come back up at boot time:

  1. Add ndiswrapper to /etc/modules.autoload.d/kernel-<kernel version>
  2. If using DHCP, add the five steps in “Configuring Your Card” (above) to /etc/init.d/local.start.
  3. Otherwise, you’ll probably want to add the net.wlan0 file to startup with rc-update add net.wlan0 default.

That should be it! I’ve been happily connecting with the card in my Samsung x10 since I reinstalled Gentoo about a month ago.
One point – DHCP users might want to try the net.wlan0 method of configuring/bringing the card up/down instead of using local.start. It seems to be the “correct” way to do it and a lot “cleaner”.However, I had no success getting this method to work with Ndiswrapper 0.7 (0.4 worked, IIRC). That’s not to say it won’t work for you, it just didn’t work for me… Give it a try by all means, then let me know how it went by leaving a comment.

This post was originally inspired by this thread on the Gentoo Support Forums.

It seems that SPAM is forever on the increase. Daily, our inboxes are flooded with offers of riches, pills, or other such junk. Dealing with SPAM can take a long time – time that would be better used on something more productive (like Unreal Tournament 2004…)

There are tools for helping to automate the task. Nearly all mail clients allow you to setup filters to direct messages that match certain patterns to certain mailboxes. With the all the different tricks used by spammers, this can lead to a lot of filters having to be setup! Some clients (such as Mozilla Thunderbird) have built-in anti-spam filtering. Depending on the level of mail that you receive, these might be perfectly adequate for your needs.

Sometimes though, you just need a little bit more power…

SpamAssassin is a powerful program for filtering SPAM from your mailbox. I’ve seen it used a lot on the server-side – filtering messages as they come into a mail server. It can also be used client-side, which is the method we’re going to setup today.

Evolution is the mail client/calendar/task list program from Ximian (now part of Novell). It’s a pretty powerful app, on a par with Outlook in most respects, but with none of the flub. It offers a lot of options for filtering your mail, including one very useful option in particular: “pipe message to shell command”.

Can you guess what we’re gonna do? That’s right. Use Evolution’s filters to pass incoming mail to SpamAssassin, then decide what to do with the message based on its spam score. Ready? Then lets begin.

emerge evolution

Let it churn away…

emerge SpamAssassin

More churning…

When all the compiling is done, add the spamassassin daemon (spamd) to the default run level so it starts at bootup:
rc-update add spamd default

If you haven’t already done so, set up Evolution with your e-mail account(s). Next comes the laborious part – setting up the quarantine area, the training area and the filter.

Create a new folder in Evolution, called Quarantine. This will be where messages marked as spam will be put. Now create a subfolder under Quarantine called SPAM Training. This is where we will manually place SPAM mail that SpamAssassin misses and later use it to train SpamAssassin to catch it next time.

With the folders setup, lets create our filter. Filter options can be accessed under Tools > Filters. Create a new filter called “SPAM” (or similar). The settings for this filter should be:

IF
pipe message to shell command spamc -c returns greater than 0
THEN
move to folder "Quarantine" in "Local Folders"

That should be it. Instantly, you’ll find less spam in your inbox as it gets filtered into your quarantine folder instead. You could set it to delete spam instead of quarantining it, but there’s always the chance of false positives, so I like to double-check the quarantine area every couple of days in case there’s something there that I might want to keep.

Inevitably, some spam will get through. To deal with this, we need to train SpamAssassin into a lean, mean, spam-eating machine. Remember the “Spam Training” folder we set up? Now’s when it comes in useful. When SpamAssassin misses a message, manually move it into the training folder. Then, type the following command, changing @@ with the path to your home directory: sa-learn --spam --mbox "<home dir>/evolution/local/Inbox/subfolders/Quarantine/subfolders/SPAM Training". This command tells SpamAssassin to look in the folder and that everything in it should be classed as spam from now on. After a few days/weeks of training, the amount of spam in your inbox should drop to next to zero!

If – like me – you do a lot of “tinkering” with your Gentoo installation, you’ll invariably end up typing a lot of commands over and over again.

Aliases save you from having to remember/repeatedly type in these commands. Aliases, in case you are new to them, are command line shortcuts. As such, they can save you a fair bit of time when working in the terminal.

To set up an alias, you use the alias command:
alias aliasname='command'

There are a couple of Gentoo specific aliases that I have set up:

  • unstablemerge—a shortcut to ACCEPT_KEYWORDS="~x86" emerge
  • retrymerge—saves typing in emerge --resume
  • rc-add—instead of rc-update add
  • rc-del—instead of rc-update delete

Got any more? Leave ‘em in the comments!