Categories
GNU/Linux Free Software & Open Source

Debian on Lenovo Thinkpad X240

I recently got myself a new computer, the Lenovo Thinkpad X240. It’s my first Thinkpad so I cannot compare it to previous models. My old laptop is a Dell XPS m1530 that’s about 5 years old by the time of this writing. Still very functional but I wanted an upgrade in hardware and a lighter computer to travel with.

The pros:

– weight
– matte screen and higher resolution
– keyboard
– speed (processor, RAM, SSD, USB3)

The cons:

– GNU/Linux compatibility
– wireless
– brightness controls
– FN key and FN Lock

So let’s go and review the whole thing:

### BIOS

It came with Windows 8 pre-installed, but I immediately installed Debian Testing (Jessie) on it. This machine comes with UEFI boot, but fortunately it has a Legacy mode to behave like normal BIOS. Installing like normal boot instead of UEFI boot is a lot easier and you don’t have to struggle with the disk partitions and boot options. On the boot configuration settings, disable secure boot and set it to legacy boot first instead of UEFI boot first.

### Hardware

Lenovo X240 open

The X240 is very light, even with the additional 6 cell battery instead of the default 3 cell battery. It is a 12.5″ computer, so it can be comparable to a Macbook Air or similar computer. The case is plastic, but feels very well built and durable.

X240 width

There are no indicating LEDs anywhere except for the power button LED that indicates if the computer is on, off or suspended (blinking). There are no hard disk writing indication, battery charging indicator, wireless, bluetooth or any. Just an additional led behind the screen, the dot in the “ThinkPad” logo lights following the power button LED and that’s it.

This is a bit confusing specially when charging the laptop, since the charger also lacks any LED indicator, so the only way to know if your computer is charging is with the software indicators in your desktop environment (the battery monitor icon in your system tray).

It has no HDMI port, but it has the old VGA adapter and a mini digital port for external monitors. Only 2 USB ports, both are USB 3.0, and one with power over USB. My model came with a fingerprint reader, an SD card reader, a 720p webcam and an Ethernet port.

### Keyboard

Lenovo X240 Keyboard

It seems that all new Lenovo models are coming with the new “chicklets” style keyboard and its new layout. I’ve heard some criticism about it, but since this is my first Thinkpad, I’m not biased. Comparing to other laptop keyboards, it is nice. The keys feel good and not fragile and is very silent. My only compliant was the strange placement of the Fn key where I usually expect the Ctrl key. Fortunately for me as an Emacs user I map my CapsLock key to an additional Ctrl and use that instead, so my key stroke memory doesn’t get much affected by that. What I didn’t like is that the F keys are now by default media keys and to use them as F keys you need to press Fn+key or Fn+Esc to activate ‘Function key lock’ then press the F key you need. So, for example, if you want to reload your browser and immediately lower the volume of the speakers, you have to strike additional keys.

The screen brightness control keys by default didn’t work for me, but there is a fix. You need to load the thinkpad acpi kernel module on boot. So edit /etc/modules file and add:

thinkpad_acpi

Then you’ll need to add this to your /etc/default/grub file and check that your kernel options are as follows:

RUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=!Windows2012 acpi_backlight=vendor"

This will enable the volume, mute, brightness and wireless media keys. I haven't been able to make the microphone mute button work.

The keyboard backlight works by default using FN+spacebar and it looks nice. It has three states: dim, bright and off.

### Pointers

As many other previous ThinkPads, the X240 still keeps the nipple mouse or clit mouse or however you've heard it's called. The downside is on the trackpad, now called clickpad which has no hardware buttons but does have a larger surface area. By default on Debian Jessie + KDE the clickpad works but it's not precise. When trying to press for a click it inevitably moves from the target area, so clicking is hard. Right click worked out of the box for me by just pressing the pad on its bottom right area. Clicking can be fixed by addding:

sudo apt-get install kde-config-touchpad

and configure single tap clicking, two-finger scrolling and three finger tap for middle click. If you like to use the /nipple/ pointer and miss the buttons for it on the top of the pad, you can configure the button area to be on the top part instead of the bottom part in the X config file.

Make sure you have the following in your file /usr/share/X11/xorg.conf.d/50-synaptics.conf

    # This option enables the bottom right corner to be a right button on
    # non-synaptics clickpads.
    # This option is only interpreted by clickpads.
    Section "InputClass"
            Identifier "Default clickpad buttons"
            MatchDriver "synaptics" 
            #Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
            Option "SoftButtonAreas" "60% 0 0 5% 40% 60% 0 5%"
    #       To disable the bottom edge area so the buttons only work as buttons,
    #       not for movement, set the AreaBottomEdge
            #Option "AreaBottomEdge" "82%"
            Option "AreaTopEdge" "4%"
    EndSection

I found this solution at this blog

### Wireless

The wireless card is an Intel 7620 rev 6. After having to struggle with a Broadcom card for many years I thought my wireless card struggle days were going to be over. Well, turns out that the 7620 card is a very recent card and is not very well supported yet. By default it doesn't work with Debian. To make it work you need to enable the non-free repository and install

sudo apt-get install firmware-iwlwifi

This will enable your card and make it work, but if you suspend the computer, you'll loose bluetooth conectivity. To fix that you need to disable the 802.11n compatibility in the driver configuration. Add this to a file in a new file called: /etc/modprobe.d/wifi-disable11n.conf

options iwlwifi 11n_disable=1

I have experienced some instability with it. At random times the driver would just stop working and your card will seem working and connected but no traffic goes on. If you suspend the computer with the card in that state, it will not suspend and will hang the system. Once the wifi card is stuck the only way to bring it back is with a restart. I've tried rfkill, unloading and loading the module, but nothing works.

Another issue is that it will not connect to a wireless-n router, even when disabling n-band in the driver configurations. I had to configure my home router to only use b/g bands for it to connect.

**UPDATE**: Debian Jessie has upgraded to the Linux kernel 3.13, enabling the use of the iwlwifi driver version 22.24.8.0, which doesn't need any of the changes mentioned and doesn't crash anymore.

### Conclusion

Not being able to compare to other previous Series X Thinkpad models, I cannot say if the X240 is an improvement or not. I've seen a lot of criticism to it, and I don't blame them. Some indicating LEDs would be nice to have, and why does a new computer model in 2014 doesn't have an HDMI port and has the old VGA port instead? There are weird hardware choices in this, but overall I'm enjoying the portability and speed of the computer. I'm hoping that my GNU/Linux compatibility issues (specially the WiFi card issues) get fixed over time.

Do you have some other configuration or fix tips for Debian on the X240? What to you think of this model? Share some ideas with me on the comments.

Categories
GNU/Linux Free Software & Open Source personal

Debian and the girlfriend

Ada with the laptop

We got a new computer for the girlfriend some months ago. Since her old laptop was running Debian Lenny and she loved it, but the software packages were quite outdated, I decided to install Kubuntu 10.10 on her new laptop. Assuming that it would be easier to use with all of Canonical’s and community customizations, handle and detect new hardware drivers better and will have more updated software.

Turns out that she barely used her new laptop, complaining a lot about it. First, she had to get used to the new KDE 4 environment, when she got so used to KDE 3.5 on Debian Lenny, but change is something we all have to face. But the real problems were that hardware was not working properly, the touchpad had no scrolling and since its a single button pad with virtual buttons, the right button click didn’t work. Also, the Dolphin file manager would sometimes not refresh the files on the folders, so she couldn’t see some files that were recently saved. When trying to shutdown it would freeze up or the KDE shutdown menu window would not draw any options. When finally shutting down, it sometimes hanged at the end of the process, thus not turning off the computer.

After about a month of complaints and frustrations, she demanded me to install Debian back. I explained to her my initial decision to go with Kubuntu and that a new version 11.04 was coming out in a few days and that might fix her problems. But her argument was strong: “I need stability, and I don’t like to be on the bleeding edge since I’m not technical, I can’t troubleshoot the issues. Its fine for me to stay with the same stack of software for two years until the next Debian stable release.”

Ada, ballet & GNU

So I went ahead and installed Debian Squeeze on her laptop, expecting a lot of time spent in forums to get her new hardware working, configuring files, compiling drivers, etc. To my great surprise, everything worked out of the box, with very minimum custom configurations. She immediately started installing all her favorite software and was very happy with her new system’s stability and fast responsiveness. Software was (to the time of this writing) decently recent, and very stable so now she has completely ditched her old computer, feeling perfectly comfortable. Although she still misses KDE 3.5, she’s getting used to KDE 4 and customizing it her way.

Oh, and she made it all pink.

Categories
GNU/Linux Free Software & Open Source

Happy 17th birthday Debian

debian logo

I just wanted to post a few lines about Debian today since its the 17th anniversary of the project.

I haven’t been a long time Debian user. I started using GNU/Linux as an experimental project back when RedHat was on version 5. Then one day, I purchased my first distribution. Yes, I paid for it even though I knew I could get it for free, I decided to support with some money by buying the discs at a store. The distribution was RedHat 7. Then I went on with Fedora …and so on.

The thing is that, I never totally stuck using GNU/Linux up until I tried a Debian based distribution: Ubuntu. I always got burned by the RPM hell, so when I switched to using debs and apt-get, I was in heaven. The system was stable, upgrades were easy and I didn’t have to shake and sweat when I hit the update/upgrade button (or command) like with RPM distros. Other people like Eric S. Raymond has also talked about this subject.

Then, when I finally switched to Debian thanks to several friend’s peer pressure (kidding…or not?), I liked it even more. My computer run faster than with Ubuntu, and I learned new tricks and things that I never noticed on Ubuntu.

Although I still don’t consider Debian to be as newbie-friendly distro as Ubuntu is, I still recommend it for new (and interested) people that switch to a GNU/Linux system. My girlfriend switched and she loves it, and she’s not very techie or geeky. Also, the lack of some “user friendlyness” is actually benefical since that forces the user to learn the system, and not think that computers are “magic”. Yes, lack of “magic” can be confused with “annoyance”, but most things are a few shell or aptitude commands away.

So if you’re not a Debian user, try it out! Leave the tricycle (ubuntu) and try a real bike (debian)! If you’re not a GNU/Linux user, try Debian and check out a real, solid, stable operating system…and learn a few tricks (commands, concepts) on the way.

Not most of the best and popular GNU/Linux distributions base their code on Debian for nothing. Check out why and get involved with the great nice and big Debian community.

Categories
GNU/Linux Free Software & Open Source Interesting random stuff Programming & Web Development

Random links from my bookmarks

I’d like to share my bookmarks from time to time. I think sometimes random browsing can be very fruitful and sometimes even productive.

This week on my delicious bookmaks, I’d like to share:

I hope you find these links interesting or usefull as they’ve been for me.

Categories
Emacs GNU/Linux Free Software & Open Source personal

Mac OS X from a GNU/Linux User

Snow Leopard
The Mac OS X slogan I’ve heard from several mac fanboys is “it just works”. Well, being a GNU/Linux user for quite some time and coming to OS X, that is not the case for me. There’s a lot of little things that “just don’t work” on my particular usage.

Recently I’ve been given a 17″ Macbook Pro for use at my job. My first impression was “wow, nice solid hardware” and that has turned to be very true. But after a while of fiddling with the operating system and doing actual work as I’m used to, lots of little things started to annoy me.

Developer tools

First, I’ve been told that OS X is the best platform for developers. Well, to begin with, basic development tools are not installed by default. You have to install all Xcode tools (about 3.1 GB) just to get gcc, make and related basic tools, off the CD plus a bunch of other unknown things. The installer doesn’t detail much on what its installing.

Getting and updating software

Then, there is no repositories support by default. You have to install Macports or Fink, or download each of your software packages by hand, so upgrading all your apps depends entirely on each provider, except for the Apple applications. So this tells me the software upgrade program is exclusively for Apple apps and no third party software can access this upgrading system. It would be a good idea if the software updater had an API or something that other software vendors can use it to notify upgrades.

A curious thing for me is the fact that lately when the software updater updates the Safari web browser and other trivial applications, it asks for a full system restart. I don’t know why OS X, a BSD Unix based system, needs a restart when you upgrade such a non-critical application like the browser, but that reminds me a lot of Windows asking to restart for every single piece of software installed.

PHP and extensions

At my job we use PHP 5.2.8 and a bunch of extensions. Although OS X comes with Apache and PHP already, there’s no easy way to install all the extensions we use, so we have to compile the damn thing and all its dependencies. It has taken us a whole day just setting this up, and some co-workers just quit trying and went through the option of developing on a virtual machine with GNU/Linux. Some even cried. I got it all good and running, but when I upgraded to Snow Leopard, all my settings were reverted so I had to start again.

GNU

Emacs

For most of my tasks I use Emacs, but there’s a bunch of choices and versions on how to install it, but none is very consistent. If you install emacs from Fink, you don’t get finder actions to open files on Emacs. If you don’t install from Fink, then when installing other packages, like Auctex, will need to download Emacs from Fink. Then you have redundancy. So the solution here is to install your elisp files manually on your elisp folder.

Ctrl, meta and alt keys are messed up. Important for any Emacs user and also for a command line power user.

Other software

Basic office apps, like the typical word processor, spreasheed and presentations programs are not available by default, which is something you have for granted on most GNU/Linux distributions.

No GPG, wget, latex and other basic tools you take for granted on any GNU/Linux or BSD system.

Finder annoyances

Hidden folders (those starting with a dot) are not easy to browse on the file navigator (Finder). To view hidden files in Finder, you need a hack. There’s no easy menu option for it.

You cannot overwrite by drag and dropping a hidden folder like ~/.emacs.d/ if it already exists. It first asks you for the administrator password, then it tells you it will not change an “invisible” folder. The only way I could get around it was by using the terminal.

Also Finder has no “one directory up” button, so to move one directory up, you must enable the navigation bar that appears at the bottom of every window. But this is not very intuitive to do. Also, if you are on a file chooser dialog, this bottom navigation does not appear, so there’s no way “up”.

Finder always puts a .DS_Store and a ._MacOSX file and folder on everything you browse, being an external hard drive or usb drive or anything and you can’t disable that behavior. So I typically end up with my thumbdrives and backup drives filled with this files. Also if you compress (zip) a directory using the Finder menu option, the resulting zip also contains these files.

Finder cannot be used as an FTP or SCP client like Konqueror or Nautilus via the location bar. Although you can use the “connect to server…” option.

Conclusions

Well… not much to conclude here. I guess I just have to get used to “the mac way” of things until I get back home to my nice Debian system.

Have you migrated from GNU/Linux to OS X? I’d like to know your experiences and recommendations.

Snow Leopard foto is Creative Commons by Captain Chickenpants
Wildbeet foto is Creative Commons by Arno & Louise
Categories
GNU/Linux Free Software & Open Source Programming & Web Development

How to install PHP PDO extensions on Debian Lenny

php

If you need to install PHP PDO extensions on Debian Lenny, its very
simple. This is what I did to get it done:

sudo aptitude install php5 php5-dev php5-cli libmysqlclient15-dev

Then use pecl to get PDO:

sudo pecl install pdo

Then, in case you want the PDO MySQL extension:

sudo pecl install pdo_mysql

update: I found out that PDO and mysqli drivers conflicted on my system and I ended up with none. To fix this, do pecl install mysql and then add extension=mysql.so on your php.ini like indicated below. This enables pdo and mysql driver, but I couldn’t get msyqli driver back on.

Then you have to edit /etc/php5/apache2/php.ini and add:

extension=pdo.so

Also add this line only if you installed pdo_mysql.

extension=pdo_mysql.so

Restart your web server with:

sudo invoke-rc.d apache2 restart

And that’s it. Enjoy your PDO extensions on Debian Lenny.