David R. Heffelfinger

  Ensode Technology, LLC

 

Scrollbars in Linux Mint Cinnamon


I like Linux Mint, and I have been using it as my primary Linux distribution for a couple of years now, but one thing that bugged me was the lack of scrollbars for some applications.

I had Googled around, and found some solutions, unfortunately while the solutions worked for most applications, some of my most frequently used applications like the terminal, Nemo (the file manager), and gedit were still lacking scrollbars.

I finally found a solution, first, I had to install the scrollbar-overlay package:

sudo apt-get install overlay-scrollbar

Then, from a terminal window, run the following command:

gsettings set com.canonical.desktop.interface scrollbar-mode normal

I finally have a scrollbar in all of my applications. That really was harder to figure out than it should have been.


 
 
 
 

tar failing with error message "file changed as we read it"


Today I'm upgrading my laptop to the recently released Ubuntu 12.04 Precise Pangolin.

Even though I have my /home directory in it's own partition and the installer shouldn't wipe it out, I'm erring on the side of caution and backing up my home directory before beginning the installation.

I'm using the Linux tar command to compress and back up my home directory, but for some reason after waiting for several minutes the command kept failing with the following error message:

"file changed as we read it"

After googling for a bit I found the solution to the problem, using the --ignore-failed-read flag for tar took care of the issue.

tar --ignore-failed-read -ztvf backup.tar.gz /home/myhomedir

did the trick. 

 
 
 
 

Ubuntu Jaunty Jackalope on an HP dv6000 laptop


Ubuntu 9.04 (aka "Jaunty Jackalope) was released earlier this week.

Today I set away some time to install it on my laptop, an HP dv6810us, part of the Hewlett Packard dv6000 series.

Almost everything worked "out of the box", unfortunately the wireless still takes some work to set up.

In the past I had been using ndiswrapper
to get it to work. This time it wasn't necessary, but it still took
some effort to get it going. It would be nice if the wireless would
work out of the box.

In any case, lspci -v returns the following information for my wireless card:

03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)
    Subsystem: Hewlett-Packard Company Device 137a
    Flags: bus master, fast devsel, latency 0, IRQ 19
    Memory at f6000000 (64-bit, non-prefetchable) [size=64K]
    Capabilities: [40] Power Management version 2
    Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable-
    Capabilities: [60] Express Legacy Endpoint, MSI 00
    Capabilities: [90] MSI-X: Enable- Mask- TabSize=1
    Capabilities: [100] Advanced Error Reporting <?>
    Capabilities: [140] Virtual Channel <?>
    Kernel driver in use: ath5k
    Kernel modules: ath_pci, ath5k

I googled around to see if I could find a solution, and bumped into this thread in the Ubuntu forums. The thread is for Intrepid, but I thought I would adapt the solution to Jaunty and see if it worked.

apt-get install linux-backports-modules-jaunty

Rebooted and... nothing!

Since
the solution didn't work, I uninstalled the above package and, lo and
behold, like magic and for no apparent reason, the wireless started
working!

I suspect that one of the dependencies on that package
did the trick, I'm not sure which one (I can't even remember which
dependencies were automatically downloaded), but installing the above
package, then uninstalling it did the trick. Weird, but it worked.

Now wireless is working without ndiswrapper.

Other
than the wireless, the installation was very smooth. Ubuntu
automatically detected my Nvidia card on the first boot, and asked me
if I wanted to install the restricted drivers. I did, rebooted and the
driver "just worked".

Also, boot time is amazingly fast, which is very nice.

 
 
 
 

Excluding directories from zip files on Linux


I frequently have to turn in source code to one of my customers in zip files (not fancy nor sophisticated, but that's life).

Lately, I've been working on a project that uses good old plain ANT build files. I load this project into NetBeans as a free form project so that I can have a decent working environment. NetBeans of course creates its own folders and files so that it can open the project. I am also using Mercurial for version control, which creates an .hg folder that I don't want to distribute.

 I wanted to zip up the code, while excluding the directories and files that were not meant to be distributed (.hg and the NetBeans specific files and folders). I'm on Linux, therefore I usually use file roller, a graphical archive management tool for the GNOME desktop, to create my zip files. File roller is very easy to use, just right click the directory to be archived and select "create archive".

Unfortunately there is no way to easily exclude files or directories from the zip file, I thought I could zip up the whole thing, then delete the unwanted files and directories. This worked fine for files, but for directories it deleted the files in the directory, but left the directory in the zip file.

Obviously file roller wasn't meeting my needs here, it was time to go to the good old command line. Most Linux distributions come with a command line zip utility appropriately named "zip". I read the man page and found a way to tell zip to exclude files and directories from the created archive, all that needs to be done is use the -x switch and list the files and directories to be excluded, separated by spaces, for example:

zip -r filename.zip directoryname/* -x directoryname/.hg\* directoryrname/nbproject\* directoryname/catalog.xml

The above command will do exactly what I needed, which is to create a zip file without the Mercurial and NetBeans specific files and directories. Of course any file or directory name can be passed as a parameter to the -x switch.

 
 
 
 

Running Graphical Applications on a remote server


Like many, I host my web site on a remote server, it is a Virtual Private Server, running Linux (Cent OS 5).

I have full SSH access to my server, which provides me with full access to the bash shell to do anything my heart desires, well, almost anything, or so I thought.

One thing I couldn't do was to run graphical applications on the server, since it doesn't have an X server such as X.org. This didn't bother me too much, since there weren't too many graphical applications there I wanted to run remotely, with one exception, the GlassFish update tool.

I remember back in the good old days when Unix ruled, you could set the DISPLAY environment variable to run an application on one workstation or server while displaying it on another, I tried setting the DISPLAY variable to the display of my local Linux laptop, but it didn't work.

A few days ago while browsing Slashdot, I ran into a comment that explained how to achieve this:

ssh -YtC user@myserver.com /path/to/graphical_app

I tried the above with the correct credentials, server and path and lo and behold, I was able to run the GlassFish update tool on my server while displaying it on my laptop.

Thanks Doug!

 
 
 
 

Installing Ubuntu Intrepid Ibex in an old laptop


I have an old Averatec 3250H1 laptop that is still being used (2200+ 32 bit AMD processor, 60GB hard disk, 512MB RAM). This laptop was running Ubuntu 5.04 (Hoary Hedgehog).

I wanted to upgrade the version of Ubuntu to a more modern version. I downloaded the 32 bit version of the Intrepid Ibex install ISO, burned it into a CD and got to work.

Unfortunately the installer CD wasn't running properly, early into the install process it would just dump me into a command line and the install would abort.

I tried googling around but most information out there for this laptop is from around circa 2005, seems like nobody is trying to install a modern version of Linux on this specific laptop model.

After some messing around, I started to suspect that what was making the install abort was lack of drivers for the video card on this machine (S3 Unichrome Integrated Graphics with 64MB Shared Memory). I tried looking for an alternate way to install, the only way I could find was to download an alternate install ISO. So I downloaded this alternate install CD and proceeded to install Ibex on this "classic" laptop, unfortunately, the installer froze again at 25% of the "Select and Install Software" stage, in the "Preparing gnome-icon-theme" step. At this point I had to abort the installation, by forcibly turning off the laptop, which became unbootable after this mishap.

At this point I tried the Ubuntu alternate install CD once again, this time choosing the "command line system" (or something along those lines) option. I figured I could try and hack my way into installing X later, after all, it was running when the laptop had Hoary Hedgehog. This time, the install finished successfully, and I had a fully functional (albeit text only) system.

I booted up to my new install and upgraded all the software by running "apt-get update", followed by "apt-get upgrade" (thank goodness I am a Debian veteran and a few years of graphical only package management in Ubuntu didn't make me forget how to update software from the command line). At this point I had a fully updated, command line only system.

After some more googling around, it became obvious that I wasn't the only one having problems with the included Unichrome integrated video card included in the laptop. Thankfully, I was able to figure out that I needed the "openchrome" X driver, and I found a usable xorg.conf that I could just download and use.

After figuring out how to configure the video card, I was able to successfully run X, however saying that it was ugly doesn't even begin to describe it, all I had was a terminal window and a gray background, of course, GNOME wasn't yet installed.

I did an "apt-get install gnome", which resulted in approximately a million packages being downloaded and installed, after a very long wait I tried to boot to X again, this time running GNOME, but for some reason it seemed to be running a Debian theme, as opposed to the default Ubuntu "brown" theme.

At this point I have the laptop almost fully functional. The only thing that is not working yet is the wireless. I'm pretty sure I'll be able to get it to work, after all it was working in Hoary, however life got in the way and I had to stop setting it up. To be continued, I guess.

 
 
 
 

Installing Amazon MP3 Downloader under Ubuntu 64 bit


Being a child of the 80's, I love listening to music I grew up with. Unfortunately, it seems most of the 80's compilation CDs out there made a conscious effort to find the suckiest songs of the 80's and put them together in a CD. It seemed like the really good music from that era had just but disappeared.

Today while browsing Amazon I ran into some MP3 downloads for some songs I hadn't heard in about 20 years, the good stuff that I thought had dissappeared, I, of course, became very eager to add these songs to my collection.

When downloading individual songs in Amazon, no special software is needed, however, the Amazon MP3 downloader is needed to download complete albums.

They have a few Linux versions for Fedora, Debian, OpenSUSE and Ubuntu. The only version of Ubuntu they support is Gutsy Gibbon, which is two versions behind the latest, Intrepid Ibex.

Feeling brave, I tried to install the Ubuntu Gutsy Gibbon Amazon MP3 Downloader under Intrepid Ibex, unfortunately the installer failed, telling me that the architecture was wrong. The deb package available on Amazon is for i386, and I run the 64 bit version of Ubuntu Linux.

I googled around to see if there was a way to install 32 bit packages under 64 bit Ubuntu, I ran into getlibs.

getlibs is a script that downloads any missing libraries for any installed package.

In summary, what I had to do to install the Amazon MP3 Downloader under 64 bit Ubuntu was to get getlibs from http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb. Simply clicking on the link results in the package opening in GDebi, it should install without issues.

Once getlibs is installed, the Amazon MP3 Downloader needs to be installed, passing a parameter to ignore the architecture difference:

sudo dpkg -i --force-architecture amazonmp3.deb

This will install the package, it will be placed under /usr/bin/amazonmp3, however at this time it won't run properly because of missing libraries. In order to get the libraries, we need to run the getlibs script:

sudo getlibs /usr/bin/amazonmp3

At this point the application should be "good to go" and able to download MP3 albums from Amazon MP3 Downloads.

 
 
 
 

Synchronizing Contacts Between Two Blackberries Under Ubuntu Intrepid


I just upgraded my old Blackberry to a Blackberry Bold. I of course wanted to transfer all my old contacts to my new device. I transferred all my contacts to the sim card and installed the sim card in the new phone, however that is a less than ideal solution since the sim card splits the contacts, that is, if a contact has home, phone and work numbers, that one contact appears as three different contacts in the sim card. Also, email addresses are lost when using this technique.

It is no secret that I am a Linux user, however I do keep a spare Windows partition around for the rare cases that I need to use Windows. Today was one of those days.

Blackberries come bundled with Windows software to install applications, synchronize with outlook, perform backups, so on and so forth. I wanted to run the Blackberry software to transfer the address book from my old device to my new Bold.

I booted to Windows vista and ran the installer, while it was running a million security updates and popups were showing up, and windows kept asking me to reboot my laptop. I refused to reboot as I simply wanted to transfer my addressbook to my new bold. Once the Blackberry desktop installer completed, lo and behold, it asked me to reboot. I gave in and rebooted, only to have Windows Vista prevent me from logging in again once it came back up.

When I tried to log in, a Windows Activation dialog window showed up, complaining about the license store containing inconsistent data or something like that. The dialog box had a link to contact HP, my laptop's manufacturer. I clicked on it and I was able to chat with HP customer support. After a lot of back and forth what HP told me is that I would have to do a full system restore, which I refuse to do since it would wipe out my Ubuntu Intrepid Ibex installation.

I googled around for a solution to Windows vista preventing me from logging in to no avail. I tried to transfer the addressbook via bluetooth, but for some reason I don't get the option when I select the Bold from my old Blackberry (I do get the option when I select my bluetooth headset, go figure).

At this point I turned my attention to trying to transfer the addressbook using Linux. I had heard of a utility called Barry that may help me with my issue.

I found Ubuntu deb packages here, unfortunately the most recent version they support at this time is Hardy, I saw no packages for intrepid. I felt brave and installed the packages for Hardy under Intrepid, they installed with no obvious issues.

From the list of packages, barrybackup-gui looked promising. I installed it by simply clicking on the link from Firefox and opening the downloaded file directly in GDebi. There were some unresolved dependencies, which at the moment I can't remember exactly, but all the dependencies are listed in the same page. I simply installed the dependencies and tried again, until all dependencies were satisfied (I only had to install two or three dependencies).

At this point I plugged my old Blackberry to one of the USB ports in my laptop, and executed barrybackup, it detected the blackberry, asked me to identify it. At this point I configured barrybackup to backup only the address book by going to Edit | Config, then clicking the configure button.

I only wanted the addressbook, therefore I clicked "Deselect All", followed by activating the "Address Book" database. I OK'ed my way out of there and clicked on "Backup". After a couple of seconds, I had an addressbook backup in my Linux box.

At this point I unplugged my old blackberry from the USB port, plugged my new one and re-ran barrybackup, it recognized the new device and asked me to identify it. After doing so I clicked restore and it started copying my backups to the bold (word to the wise, it deletes all entries in the existing addressbook before restoring). Unfortunately there was a problem and it only restored a partial number of the entries in my addressbook.

It left out about 20 or so entries, luckily a lot of those I don't need anymore, therefore I ended up having to enter only a few by hand.

Although the Ubuntu/Barry combination wasn't perfect, it sure was a better solution to my problem than Windows vista with the official Blackberry desktop software

 
 
 
 

Installing and Configuring a New MySQL Installation on Ubuntu


I recently got involved in a project that uses MySQL as its RDBMS. I am not a DBA, nor I pretend to be, but I wanted to set up a local MySQL database on my Ubuntu 8.10 Intrepid Ibex laptop.

I ran into some issues that were primarily because of my lack of experience installing or administering MySQL, I assume others trying to do the same will run into the same issues, therefore I decided to write this entry recording what I had to do to get MySQL going for the benefits of others (and possibly some time in the future I might forget the solutions my issues, therefore I can refer to this entry myself if I ever need to setup MySQL again).

The first problem I ran into was that MySQL does not show up in the "Add/Remove Applications" GUI tool, sure there are MySQL clients, but the RDBMS itself is nowhere to be found.

I tried "sudo apt-get mysql" and it turned out there was no package mysql to be installed, at this point I started to suspect that the Desktop version of Ubuntu I have does not include MySQL, not even in the repositories.

Luckily I turned out to be wrong, after some research I found out that the correct package to install is mysql-server, a "sudo apt-get mysql-server" took care of installing MySQL.

Creating a new database worked without issue. I issued the following query to create the database:

CREATE DATABASE somedatabase;

It worked without issues.

The next thing I wanted to do was to create a regular, non administrator user to use MySQL. Following the instructions at the MySQL 5.0 Reference Manual created a user allright.

The following query:

CREATE USER someuser IDENTIFIED by 'password';

did the trick "someuser" is the new mysql login name for the new user "password" is the user's mysql password. Originally I forgot to enclose the password in single quotes, rookie mistake, I corrected the mistake and the query worked without a problem.

Next I wanted to grant the newly created user all privileges on my newly created database, in order to do so, I issued the following query:

GRANT ALL on 'somedatabase' to 'newuser';

At this point I thought I was "good to go", I attempted to log in to mysql by issuing the following command in the command line:

mysql -u newuser -p

At which point I was prompted for a password, I entered the correct password and was denied access.

After a lot of googling and hair pulling, I found out that my grant statement did not work for "localhost", I had to issue a different grant statement to be able to log in using my newly created user.

The following query did the trick:

GRANT ALL on somedatabase to newuser@localhost

It turns out I had to specify use the username@hostname syntax to be able to log in from the same server where mysql is running.

After doing this I was finally able to log in as my newly created user and create the tables I needed for the application I am working on.

 
 
 
 

Just Finished Installing Ubuntu Intrepid Ibex


I just finished installing Ubuntu Intrepid Ibex on my HP Pavilion dv6810us, which is part of the HP dv6000 series

Installation was fairly straightforward, the only hiccup I found was that wireless networking was not working out of the box, I had to install ndiswrapper, but thankfully this was pretty painless. All I had to do was install ndisgtk

sudo apt-get install ndisgtk

And the Windows XP drivers for its wireless card (identified as 03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01) by lspci According to this post in the Ubuntu forums, the correct drivers can be found here.

Once I installed ndisgtk and downloaded the windows drivers, all I had to do was point ndisgtk to the .inf file included with the driver, and wireless "just worked", no mucking around with blacklisting drivers or anything like I had to do with previous versions of Ubuntu

I also ran into an issue in which the system would stop booting unless a key (any key) was pressed repeatedly. This issue seems to be affecting several Hewlett Packard (HP) and Compaq laptops.

This issue was reported on launchpad, and I found a workaround there.

The file /boot/grub/menu.lst needs to be edited as root, I use vi as my editor, substitute the following command with your favorite editor:

vi /boot/grub/menu.list

Find the following line:

kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=c877e76e-7e7f-4b47-aec7-6ae28d1ab767 ro quiet splash

and append "acpi=noirq" to it. After doing this the line should look like this:

kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=c877e76e-7e7f-4b47-aec7-6ae28d1ab767 ro quiet splash acpi=noirq

After making the above modifications I was able to boot to Ubuntu Intrepid Ibex normally.

 
 
 
 

Linux Command Line Tricks


There are several "shells" that can be used in the command line for Linux and Unix systems.

The default shell for most Linux distributions such as Ubuntu and Fedora is called bash, which stands for "Bourne Again Shell", bash is an improved version of the Bourne Shell.

The first feature I would like to mention is tab completion.


  • Typing the first few letters of an executable command, then hitting tab completes the command.
  • After entering an executable command, hitting tab again shows a list of available arguments. Typing the first letter of the argument then hitting tab shows a list of arguments that start with that letter.
  • tab completion is especially useful to change directories, for example, to change directories to /home/david/Documents we could simply type "cd /ho<tab>/da<tab/Do<tab, saving us several keystrokes.

In addition to tab completion, the !$ character combination can be used for substitution, for example, if we were examining a file with the cat, more or less, then we realized we need to edit it, we don't need to type in the file the second time around:

less foo.txt
vi !$

The second line is equivalent to vi foo.txt, the !$ character combination is substituted for the last argument in the previous command.

The !! character combination executes the last command executed, preventing us from having to type it again.

We can view the history of the last several commands entered by using the history command, the output would look something like this:


476 ls
477 ls -larth
478 su
479 history |grep sudo
480 ls
481 ls f*
482 ls -ld fo*
483 cd
484 history

Of course, typical output is much longer, in any case, if we want to re-execute any command in the history, we simply need to enter it's number in the history preceded by an exclamation point, for example, if we wanted to re-execute command number 482, all we would need to enter is:

!482

We can also navigate through the history by simply using the up and down arrows, the up arrow shows the previous command in the history, the down arrow shows the next command in the history.

Knowing these bash shell scripts help us be very proficient with the Unix command line, which I miss dearly when I am using a Windows box (by the way Cygwin provides a bash shell for Unix systems).

Ubuntu Intrepid Ibex is coming, worth the upgrade?


Ubuntu 8.10, also known as Intrepid Ibex, is about to be released soon.

I downloaded the release candidate and installed it under VirtualBox, an open source virtual machine that allows operating systems to be installed inside other host operating systems, similar to VMWare.

My impression of Intrepid is that it is not much different from Hardy Heron, the main difference is that it has updated versions of all the included applications.

Having written three books using OpenOffice.org, my one wish list is an updated version of this free and open source office suite. Unfortunately I found out that Ubuntu Intrepid Ibex does not come with OpenOffice.org 3.0, which is the recently released latest version.

I'm sure OpenOffice.org will end up in the Ubuntu Backports repository, but it feels kind of "hackish" to have to install it that way. It would be nice if OpenOffice.org 3.0 was included by default.

I may end up upgrading anyway, just to get updated versions of other applications, however I don't have that "must update now!" feeling I've had when other versions of Ubuntu were released.

 
 
 
 

Solution for Firefox 3 Always Starting in Offline Mode Under Ubuntu


Ubuntu Hardy Heron is my primary operating system. Although in general I think it is a great operating system, there was one little annoyance that was bothering me. Firefox 3 always started in offline mode.

Every time I opened Firefox I had to go to the File menu, and uncheck the "Work Offline" checkbox, very annoying.

Well fortunately I found a solution. In order to avoid this from happening, we need to type "about:config", then set the toolkit.networkmanager.disable preference to true. Problem solved.

 
 
 
 

Evolution Send/Receive Icon Grayed Out


Evolution is a very popular GNOME email client for Linux. It's user interface is very similar to Microsoft Outlook, making it easy for users of Outlook to migrate.
Just like Outlook, Evolution has a Send/Receive icon in it's icon toolbar.

Sometimes, the Send/Receive icon is grayed out, perhaps because we started evolution before we had a network connection. This situation is somewhat common in laptops, when Evolution is fired before obtaining a WIFI connection.

It may not be intuitive how to enable the Send/Receive icon, well, fortunately it is very simple, all that is needed is to go to File->Work Online, and the Send/Receive icon will be enabled.

 
 
 
 
 

« June 2025
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today

 
© David R. Heffelfinger