[current path: main » linux]

Jan 08, 2009

Loving Linux: Reason #384

The 7 year old boot drive in my Linux box crapped out, so I decided to remove it and boot from the secondary (better) drive. If you're clever, you can reassign mounts in /etc/fstab, update /etc/lilo.conf, run lilo -r /dev/sdxxx, and boot without problems from the new drive.

I'm not that clever, so I have a Linux boot CD handy to patch things up. And of course, I had a problem getting lilo to work while the old drive was still in the machine, but it was easy to resolve after removing the dead drive, booting the CD, mounting the new drive, and doing the lilo routine again.

After booting the machine with the newly lilo'd drive, the OS loaded up as expected, and I was up and running as if nothing changed.

Except that the network no longer worked. Wha? I removed a hard drive. Why would the network stop working?

I have two network cards in the machine, a 1Gb card as eth1 that requires special drivers, and 100Mb backup card as eth0 that has drivers in the kernel. It turned out that udev detected a general hardware change when I removed the drive, and added a line in /etc/udev/rules.d/60-interface.rules that set eth0 to be eth1. And that caused the wrong drivers to load for the wrong card.

I love Linux.

post time: 02:08 | category: /linux | comments | Share/Save/Bookmark

Jun 21, 2008

Fixing Fonts in Opera on Ubuntu

Do your fonts in Opera 9.5 look "fuzzy" or "pixelly" on Ubuntu? Mine did, until I added a .fonts.conf file in my home directory. Just copy and paste the XML from this post on my.opera.com to your ~/.fonts.conf file to get corrected font rendering.

post time: 14:22 | category: /linux | comments | Share/Save/Bookmark

May 26, 2008

FuseSMB, Localhost, and You

FuseSMB is a handy network automounting tool for Linux. It basically works like the Network Neighborhood in Windows, allowing you to browse directories shared by other computers on the network. It uses the Samba (CIFS/SMB) protocol, so it picks up shares from Windows, Mac, or Linux machines… provided those machines are configured correctly.

I've been using FuseSMB to access shared directories on my Linux server. Those directories are shared via Samba, and I can usually access them fine from Windows or Mac computers, though every once in a while, they seem to "disappear" from the network. However, when accessing them from a Linux box using FuseSMB, I had more serious issues: every 2 out of 3 times I tried to access the shares, I would get a "connection timed out" error. I naturally blamed FuseSMB for this problem until I decided to take a peek at the network using smbtree, a Samba tool for listing all Samba network connections.

2 out of 3 times using smbtree, I saw an error that my server could not be found at address 127.0.0.1. Localhost? Why was Samba looking for my server on Localhost?

I logged into my server, looked at /etc/hosts, and saw the problem. Address 127.0.0.1 was pointing at three names:


127.0.0.1     localhost
127.0.0.1     myserver.mikeyp.com myserver

These settings were just below a very detailed comment in the /etc/hosts file:


 # By the way, Arnt Gulbrandsen <agulbra@nvg.unit.no> says that 127.0.0.1
 # should NEVER be named with the name of the machine.  It causes problems
 # for some (stupid) programs, irc and reputedly talk. :^)

Oh. I commented out the second 127.0.0.1 line, restarted the network, and my FuseSMB and Samba issues were gone.

By the way, here's something spooky about Samba. One day I fired up the VPN software on my Windows laptop to access my corporate network from home. While the laptop was connected to the VPN, I went over to my Linux box and started FuseSMB. Incredibly, on my Linux box, I could see all of the shared folders on the corporate network!

post time: 13:53 | category: /linux | comments | Share/Save/Bookmark

Apr 07, 2008

Linux on ThinkPad X40

Why Linux

As long as I don't run any major background apps such as Desktop Search or Anti-Virus, WinXP works pretty well on my circa 2004 ThinkPad X40. My company uses Exchange server with Outlook for all corporate communication and scheduling, and the Thinkpad + XP works as a fine client for this system.

However, on a laptop, responsiveness is key, and XP loves to "hang" when encountering issues with network connections. Since I'm fairly mobile with my laptop (the actual point of having one, no?), net connection "hangs" happen to me frequently. Compared to XP, Linux is quite adept at handling network issues. So in hopes of better performance, I installed Linux on my ThinkPad.

Installing and Configuring Linux

Linux laptop installations have come a long way in the past few years. I grabbed my favorite distro, ZenWalk 5.0, and partitioned the drive for dual-boot. Amazingly, ZenWalk installed without any major issues for me. Within 30 minutes, Linux with X was running fine. I had to make sure to install the optional Intel ipw2200 WiFi drivers to get wireless to work, but once installed, WiFi worked automatically. Impressive.

More effort was required to get the system to act like a laptop, however. This included getting the system to respond to the built-in ThinkPad hotkeys and managing battery life.

ACPI support in the latest 2.6 kernels is quite robust, and along with the included thinkpad_acpi kernel module, captures all of the ThinkPad button events. I just watched the ACPI logs as I pressed every button, closed the lid, and undocked from the docking station. I then added those events to /etc/acpi/events, and set them to launch appropriate standby/suspend/undock scripts. ZenWalk 5.0 includes a very nice standby/suspend script that worked perfectly once I figured out all of the power management issues (see below). I also installed a handy app called ThinkPad Buttons, aka tpb. tpb monitors the ThinkPad ACPI events, and draws overlayed volume graphics and screen brightness graphics in X, similar to what you would see in Windows.

Battery life and power management were a bit more tricky. The ThinkPad includes various power management features such as Intel SpeedStep, WiFi power adjustment, screen brightness control, and audio power saving. To take advantange of SpeedStep, I added the included acpi-cpufreq kernel module. I then added the following commands to /etc/rd.d/rc.local:


# power management tips from thinkwiki.org
echo 5 > /proc/sys/vm/laptop_mode
echo 0 > /proc/sys/kernel/nmi_watchdog
echo Y > /sys/module/snd_ac97_codec/parameters/power_save
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# disable wake-on-lan
ethtool -s eth0 wol d
# lower wifi power level ("BATTERY" level)
iwpriv eth1 set_power 7

# launch thinkpad buttons (for OSD)
# needs /dev/nvram to be writeable
chmod 666 /dev/nvram
/usr/local/bin/tpb -d

And added the following line to lilo.conf:


addappend = "hpet=force usbcore.autosuspend=1 acpi_sleep=s3_bios,s3_mode"

The very latest kernel (2.6.24, as of this writing) was required for best battery life. After my changes, I used the included XFCE CPU Frequency Monitor and Battery Monitor apps to unscientifically measure Linux battery performance to be within 10% of XP's battery life. Fine.

Software

My company requires the use of a Cisco VPN to log in remotely as well as log in to the local wireless network. The open source vpnc client app worked perfectly with our VPN server, requiring only two lines in the config file, and the addition of the included tun kernel module.

Using smbmount, I could map and log in to file shares on the corporate network.

The included web browser IceWeasel (FireFox) ran fine, but I replaced it with Opera. Opera is significantly faster than FireFox on the ThinkPad. Opera also includes a usable mail client, so used it instead of the slower IceDove (Thunderbird) mail client. Unfortunately, we use Windows Server-based Wikis on our corporate network, which require NTLM [WikiPedia] authentication. While the Windows version of Opera supports NTLM, the Linux version does not. Fortunately, FireFox does have Linux NTLM support.

MS Office is a superb application suite that I use frequently. I rarely use MS Word these days, but often use PowerPoint and Visio, and constantly use Excel. For me AbiWord is a fine enough replacement for MS Word, and Inkscape, Xara, and Scribus are all suitable (and maybe superior) alternatives to Visio. But without a VBA-compatible scripting environment (or even conditional formatting) Gnumeric is not a replacement for Excel. I never tried any alternatives to PowerPoint, nor did I try using the external monitor connection. I also didn't bother trying the latest version of OpenOffice.

And alas, there is not even a suitably close replacement for Outlook/Exchange on any platform, let alone Linux. Novell/Gnome Evolution is a cute visual imitation of Outlook, but isn't anywhere near the same level of performance and feature set, with very primitive (and often broken) Exchange support. Exchange Outlook Web Access is functional, but the 2003 version my company uses has a terrible UI, and as with most browser apps, poor/non-existent integration with host environment. I tried installing Outlook in CrossOver (WINE [WikiPedia]), and was shocked that it actually worked. But it was incredibly slow - far too slow to be usable.

I considered running XP in a virtual machine with VirtualBox, but abandoned the idea upon recollection of how slow a VM runs on older single-core CPUs.

Terminal, not Client

I realized that without MS Office and Outlook, Linux cannot operate as a suitable client on our corporate network. However, by using rdesktop, a Windows Terminal Services client, I could remotely access and control my corporate desktop machine from Linux. rdesktop is fast and stable, with the only noticeable downside being that it doesn't render fonts with anti-aliasing (at least that I could figure out). Linux + rdesktop allows the ThinkPad to be a solid terminal on the corporate network, which, at the end of the day, provided a solution for my XP network connectivity issues.

Conclusion

While Linux mostly works fine on the ThinkPad, it was a bit too much work to get it up and working. And although it works as a fine Terminal, I prefer to be able to work offline with local applications. So for now, I'm still running XP most of the time, and dual-booting over to Linux whenever XP starts to frustrate me.

But this laptop is near the end of its days. I'm anxious to see how things work on my next laptop [macbookair, macbookair, usingthemacbookair].

post time: 02:01 | category: /linux | comments | Share/Save/Bookmark

Jan 01, 2008

Replacing a Balky HP Scanner

Well, only a week after I "repaired" my old HP All-in-One, it started to make some impressive grinding noises that only stopped when I shut it off. Rather than spend more time on 5 year old hardware, I threw it out the window and bought a new faster and quieter HP Photosmart C5280.

I chose an HP brand All-in-One because of the excellent Linux support for HP printers and scanners. HP's Windows drivers are notoriously terrible, but the Linux drivers are simply a joy to use. In fact, if I wasn't using Linux, I would probably avoid HP due to the Windows driver issues, but hooked up to a Linux box, HP printers are the way to go.

Because I previously had an HP printer installed, setting up the new printer took all of 3 minutes. I just opened the CUPS configuration page (http://localhost:631), added the printer, gave it a network name, noticed that the model was autodetected by CUPS and the HP drivers (HPLIP), printed a test page, and exported the printer to Samba. I then went to the Windows machines, fired up the Add a Printer wizard, chose a Network printer, selected the new Photosmart in the list, and printed a test page. Done! Remote scanning works perfectly as well.

Initially, I noticed a lot of banding in the test pages, so I used the "Self-Test Report" and "Clean Print Cartridges" functions on the printer's Setup menu a couple of times. This fixed the banding issues, and now the quality is fine. For less than $150, I'm quite pleased with the Photosmart C5280.


post time: 18:53 | category: /linux | comments | Share/Save/Bookmark


MikeyP.com

About This Site
Main Page
About MikeyP
Subscribe to Feed