Archive for the ‘Linux’ Category.

Laptop Died

Today I came from work, lifted the lid of my Dell Latitude D820 expecting it to restore from suspend. Hum, after a few seconds the power light just went off. I thought the restore must have just failed, becoming slightly annoyed for having to wait for the OS to reboot and open all applications I had open. But I started getting worried when pressing the power button just caused the hard drive to spin for a few seconds, CD/DVD tray click and clack a few times, and then nothing but the power light on, nothing on display. I repeated the step a few times, but couldn’t get anything more promising.

Well, I figured maybe there is dust clogging places, so I dashed to buy some canned air, and thoroughly blasted everything I could reach without unscrewing anything. Plug the power on, power button… no change. I tried booting from an Ubuntu 8.04 LiveCD, but that didn’t work either (got nothing on display) which kind of leads me to suspect the CPU or motherboard being fried. But I have never really faced this situation before, so no ideas yet how to figure out what part is done for, or who could cheaply find out.

I then unscrewed the HD to compare it to the one I have in my work D830. Well, turns out they use different voltage, so I am not going to cross test. But I wonder if there was some way to read the data from the HD without using the D820 somehow.

Luckily my backups were just 5 days old, I have all my code in Subversion, and leave all my emails on the mail servers, so I didn’t lose much data. I use rsync for backup, so restoring on a different system was just a matter of copying files over. But I am actually getting a little ahead of myself.

I did some cleanup on my my Dell Inspiron 9300 and scraped enough space that I felt comfortable making small 15GB partition for Ubuntu 8.04 and a couple of gigabytes for swap, just to enable me to read email and manage my websites and maybe do a little bit of emergency coding. The 9300 feels much snappier under Ubuntu than it does with Windows XP, although having a slow disk and an old single core processor doesn’t really compare to the D820. After a couple of hours usage Ubuntu seems to be working fine except for sound, which is stuck at full volume and does not obey the controls. I haven’t spent any time troubleshooting or fine tuning the system, though.

If I can’t cheaply resurrect the system I guess I am in the market for a new laptop. The problem is I have become used to high resolution, fast disk, fast CPU and lots of RAM, meaning there are no cheap options for me. I have been using Dell computers for the past 8 years or so, and have been pretty happy, so taking a look there first… Bummer, the home systems seem to pretty universally have “weird” resolutions like 1440×900. I found 15 inch wide screen display and 1680×1050 resolution to be pretty optimal for me, but that does not seem to be available in the systems marketed for home users. The home systems also seem to come with glossy display which I have learned to hate. Price wise it seems like I might be able to get a system just under $1500 with reasonable configuration otherwise. On the small business side it seems like the Latitude D830 is available in the screen size and resolution I prefer, and surprisingly a decent combination comes out cheaper than in the home market. All in all a bit cheaper than I feared, but it is not fun due to the circumstances.

Upgraded D820 to Ubuntu 8.04

I had installed Ubuntu 8.04 LST (Hardy Heron) 64-bit on Dell Latitude D830 a while ago, but I was dragging my feet with my home laptop for a couple of reasons. My home system was running the 32 bit version of 7.10, and I was pretty happy with how it was working. It was basically rock solid, and I had everything I needed working correctly. But 8.10 is coming out soon, and I am actually interested in that version for my home system, although I haven’t yet decided if I’d want to do a clean install or an upgrade (what I just did with 8.04). I decided to keep things simple and my options open by upgrading to 8.04 now.

Basically the upgrade went smoother than I expected. I had a lot to download (over 1 GB), but nothing seemed to break on my system even though I have done some config changes to the system.

The upgrade process recommended uninstalling some software I had installed manually, like vmware-server, which I had converted to a deb with alien. I still need to reinstall vmware-server.

I’ve noticed a couple of annoying regressions regarding wireless support. The wireless light does not work at all, unless you install linux-backports-modules-hardy package, and even then the light is always on steadily while the wireless is on (regardless of if it is connected or not). But even more annoying is the really slow reconnection speed when coming from suspend; with 7.10 it was near instantaneous.

Ubuntu 8.04 LTS Experiences on D830

I finally wrote down a full matrix of how things are working with Ubuntu 8.04 LTS (Hardy Heron) 64bit on Dell Latitude D830. I had lots of problems originally when I installed from the beta, but the system works pretty smoothly now.

Once I get Java plugin working the computer will cover all the needs I have at work. Until then I am using the 32bit Java plugin in my home D820.

The final minor annoyances with the system are that the wireless is really slow to detect networks and connect to them. On my D820, coming from suspend, the system has reconnected to wireless before I have managed to type in my password. On the D830, I will have to wait a couple of minutes. The other remaining annoyance is that almost every time coming out of suspend or hibernation, the systems beeps to inform me something failed. However, I’ve never actually detected anything wrong (well, a couple of times when keyboard did not seem to be active, but closing the lid to suspend and opening again solved that problem).

Combine Two Files Line By Line on Command Line

Today I was faced with the task of combining two files which each had the same number of lines with matching order, but I needed a third file where each line should have each line from the other two files combined. So given file a.txt:

A
B
C

and file b.txt:

1
2
3

I needed a third file c.txt (the amount of whitespace on a line did not matter to me):

A 1
B 2
C 3

After a few false starts I stumbled onto the unlikely candidate ‘pr‘, whose description states it is used to convert text files for printing. However, it has just the right options to do the task I needed:

pr -tmJ a.txt b.txt > c.txt

Nice find for the series of simple command line utilities if I say so myself.

Update: After I learned about pr I also learned about other commands that can do this. For example paste is much more obvious choice than pr.

Eclipse 3.3 of 64-bit Ubuntu 8.04

I have been running 64-bit Ubuntu 8.04 for about two months now on a Dell Latitude D830. One of the broken pieces was Eclipse. There is a 3.2.x version in the repository, but I needed 3.3.x because Pydev requires 3.3. And besides, there always seem to be a lot of improvements in Eclipse even between minor versions.

Installing 3.3 on a 32-bit Ubuntu is trivial (you just download and unpack Eclipse in, say, $HOME/opt and create a little wrapper bash script in $HOME/bin to start eclipse). But trying this with 64-bit system just resulted in an Eclipse that died even if you looked at it wrong, or for no reason at all. I tried the sun-java6 in the repositories, the 32-bit version java in the repositories and even tried the 64-bit download from Sun. Nothing worked. It wasn’t until I stumbled onto a post where someone mentioned in a comment that they fixed this by installing IBM’s Java. I did not even know IBM has its own Java version.

So I installed IBM’s Java SE 6 64-bit AMD/Opteron/EM64T version, and changed my eclipse script to start with -vm argument that points to IBM’s Java, and now I finally have stable Eclipse.

Configuring PostgreSQL to Serve Hyperic on Ubuntu

I am thinking of basing my new work project on Hyperic which would use PostgreSQL as the database. I don’t have prior experience with either of these, though, so it is quite a steep learning curve. Hyperic offers several ways to get started, and I have already tried their VMWare appliance which worked without a hitch.

Next I wanted to try an actual install. Again, there are several options, some of which include everything you’ll need. I started by installing the postgresql Ubuntu package. I had already installed sun-java 1.6 to be able to run Eclipse, so I didn’t touch that although the Hyperic documentation says Java 1.4 or 1.5 is required. Then I downloaded and installed JBoss without any problems. Then I downloaded the Hyperic tarball without the extras. But the Hyperic installation instructions and the setup script weren’t really helpful in getting me past the errors…

The setup script failed to connect to PostgreSQL. Digging more deeply and doing some web searches it seems many people have problems with PostgreSQL on Debian-based systems. The first problem is authentication, and the Debian defaults which err on the side of safety while leaving new users unable to do anything. Read on how to get past FATAL: Ident authentication failed error. I added two lines for my Hyperic database user to be able to connect from localhost using TCP/IP and also using local sockets. After editing pg_hba.conf I needed to restart postgres, but sudo /etc/init.d/postgresql-8.3 restart failed because it could not read pg_dba.conf! This seems bizarre, and for now I just made the conf file world readable. A better way would be appreciated.

I was still kind of stumped, since I didn’t really know how to create databases or users, and I had no idea what the default password was. I got past that problem by finding the aptly named PostgreSQL on Ubuntu Linux - How To blog post, which informed me of the createdb command, and which SQL commands I need to run to create and edit users.

In retrospect I note that I should have read README.Debian.gz that came with the postgresql-8.3 package, as it would have saved me some headaches. It would have provided quick instructions on getting started if you followed it to the letter and created the database user with same name as your login name (which, frankly, I would probably never do).

The final piece that was hindering my Hyperic installation was that the setup script nor the instructions said anything about needing to create the database and the database user before running the setup script. I first created user “hq” and database “hq”, but it still didn’t work. Then I realized that the setup script error message said the database “HQ” did not exist. Creating all uppercase “HQ” database solved that problem.

Warning Hardy Early Adopters

I have been using 64-bit Ubuntu Hardy Heron pre-release on my new work laptop, a Dell Latitude D830. There have been a few glitches, and there are still a few bugs affecting the laptop, but it is usable. The two most annoying issues left are: CPU stuck on high speed coming from suspend, and wireless slow to reconnect after suspend (sometimes manual reconnect needed).

Today I noticed Firefox updates available, and decided to install. I’ve never had any dataloss issues with Firefox, and in fact the last time any Mozilla product lost my data was probably around Netscape 6 time. But now, after the installation of all the updates, and rebooting like it asked, my whole profile was gone. No bookmarks, no remembered passwords, no history, nothing. And of course I had not made backups, because I was thinking I will redo my setup once Hardy Heron is officially released. But after losing the complete profile I did realize I ended up losing some valuable bookmarks I may not be able to remember, even though I have just used the laptop a little while.

So, if you are using Hardy Heron and see a Firefox update, I recommend you back up your profile before proceeding.

64-bit Ubuntu 8.04 on Dell Latitude D830

It seems I will be writing about Ubuntu and laptops some more, but so be it.

My new work laptop, a nice Dell Latitude D830 arrived a few days ago, and I have been trying to cram the not-yet-officially-released version of Ubuntu 8.04 (Hardy Heron) into it. And mind you, the 64-bit version at that. It could be said a fair share of my problems seem to be due to using pre-release software, since after I got over the initial hurdles and upgraded, things are better. But let’s not get ahead of ourselves.

First I tried to use gparted 0.3 LiveCD to repartition the drive, but that did not work since 0.3 did not recognize the hard drive. I figured this was a good time to upgrade my gparted LiveCD so I burned the 0.3.6 version. Unfortunately that failed to grok the display on the laptop. I ended up using either 32-bit 8.04 beta or 32-bit 7.10 to resize the partitions. I divided the 160 GB, 7200 RPM drive as follows: 20 GB Windows XP (it shipped with it), 20 GB Ubuntu OS files mounted as /, the rest into extended partition which I divided into 6 GB swap and the rest mounted as /home. I chose ext3 for the OS and home partitions.

The 64-bit 8.04 failed in the installation mode because it could not grok the display. In LiveCD mode it eventually - after minutes of black screen - came up with a message saying it could not figure out a proper display. By manually configuring to Dell, 1600×1200 laptop and clicking the wide screen checkbox I thought I would be on my way. But the screen went black after that. After numerous tries I finally figured to try virtual consoles: Ctrl+Alt+F2 showed text login, 7 showed black screen, 8 showed dmesg and 9 surprisingly showed the LiveCD desktop! From there I was able to start the actual installation. The installation itself went smoothly until the 82% percent mark where it got stuck checking mirrors. Doing some searches it seemed like I might get lucky by waiting for 15 minutes, which is what I did, and the install eventually passed that and finished.

Rebooting after install still showed no splash screen, just blackness until login prompt. I decided to enable the nVidia drivers, which downgraded my effective screen resolution from 1920×1200 to something like 1600×1200. I got around that by installing nvidia-settings and using that to write a new xorg.conf. I also noticed that I was unable to connect to my home wireless, but after bringing all packages up to date that too started working. The splash screen also started working after all upgrades.

The remaining problems that I have become aware, compared to my D820, are that coming back from suspend I am greeted with white screen. Apparently this is an nVidia bug that happens with compiz. A workaround is to just blindly type your password, or hit Alt+S which will give a new login view. Occasionally after this the display is extremely slow: the workaround is to switch to another virtual console and back (Ctrl+Alt+F2, Ctrl+Alt+F7). Another minor problem is that the hardware wireless light is not working. The bluetooth light isn’t working, but it did not work in the D820 either. The synaptics tweak I explained on the D820 page was also needed for the touchpad.

The D830 also suffered from a serious problem that could trash the hard drive much sooner than expected. Turning on laptop mode and HD power management as described here solved the problem without needing to do the other hacks.

VMWare Server also proved to be problematic, since the new kernel in 8.04 is not compatible with VMWare. Luckily I found a fix for that too. First I installed xinetd, g++ and ia32-libs and then followed the instructions on the ubuntu forums.

I plan on writing a proper page listing all the hardware, and any tweaks needed, like I did with the D820.

Update: I finally wrote a full writeup.