Archive for the ‘Ubuntu’ Category.

Ledger and Building It From Source on Ubuntu 10.04

So I recently started looking around for finance software that would run on Ubuntu and quickly found reasons to dislike suggested options. Then I found Ledger. Wow, did it seem awesome by comparison. So, I added the Ubuntu PPA (see the “Platform binaries” section of this wiki page), installed it, created a data file for my finances, and ran the ledger CLI executable on it.

Then I ran into a problem that appeared to be a bug: in a transaction with multiple postings and only one with a null amount, I was receiving the error, “Error: Only one posting with null amount allowed per transaction.” Checking the Google Group didn’t reveal any other reports of the issue, nor did searching the Bugzilla database.

So, I hopped onto the #ledger IRC channel on Freenode, which is the network I tend to frequent anyway. Within minutes, I was able to have the lead developer on the project confirm that the issue appeared to be a bug and politely request that I file a bug report for it, which I did.

I was also able to consult the README-1ST file for instructions on how to do a custom build from source, which I intended to use to ensure that the bug hadn’t already been fixed in the git repository. The only thing that this file lacked was a list of dependencies, but I was able to locate those through trial and error with the build tool and thought I’d post them here for anyone else looking to build ledger from source on Ubuntu 10.04.

sudo apt-get install libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-iostreams-dev libboost-regex-dev libgmp3-dev libmpfr-dev texinfo

Once you’ve executed the command above from the shell, you should be able to run the command below from the README-1ST file to create your build. The executable will be created in the root of the source tree and named “ledger.”

./acprep update

To create a debug build, which I did to be able to submit debugging output related to my issue, issue this command following the one above.

./acprep debug make

Update: As it turns out, the issue was not a bug, just a small formatting issue with my data file. However, the lead developer of ledger still plans on looking into make the issue more obvious in ledger’s output.

Update #2: It seems the ledger build tool dependencies command supports Ubuntu, CentOS, and OS X. The way the statement was positioned in the README-1ST file, I assumed that support was limited to OS X. So, rather than going through the lengthy process I did to install dependencies on Ubuntu, you can just do this.

./acprep dependencies

Sharing Files with Windows from Ubuntu Karmic

We got a desktop running Windows 7 over the Christmas holidays. I hadn’t been faced with the prospect of sharing files with it up until I wanted to play an MP3 file located on my laptop — which is running Ubuntu — from the desktop, which is connected to a better speaker system. As it turns out, sharing files with Windows from Ubuntu has gotten a lot easier with Ubuntu 9.10 Karmic Koala.

Open Nautilus and navigate to the parent directory of the one you’d like to share. Right-click on that directory and select the option “Sharing Options.” In the window that appears, check “Share this folder.” If Samba is not already installed on your system, this will prompt you to install it. The nice thing is that it handles all the interaction with APT and configuration of user accounts and shares for you versus the manual approach that’s been required in the past.

Once the service is installed, if you’d like to share the directory with users without requiring them to enter user credentials, check the box “Guest access.” Finally, click the “Create Share” button. You’ll receive a prompt to restart your session so the setting changes can take effect; go ahead and do this.

When I tried to access the directory from the Windows 7 desktop at this point, I still got prompted for credentials. I tried manually rebooting my laptop and at that point was able to access the files anonymously without further issue. I don’t know if a manual restart is always required, but it did the trick for me.

Hope this helps someone!

Getting Google Calendars into Thunderbird on Ubuntu

As work-related events recently started piling up, we gained a need to keep them organized. So we got a Google Calendar, shared it between us, and all was dandy. I wanted to be able to pull that into my local e-mail client, though. I’m running Ubuntu Ibex and its Thunderbird package.

My friend and colleague Keith Casey pointed out to me that Thunderbird has a Provider for Google Calendar add-on that works with Lightning, which I already had installed. So I install the GCal add-on and restarted Thunderbird. No visible change. I checked the Add-ons area only to find that the entry for the GCal add-on was displaying the message "Requires additional items" with no way to see what said items were. A search prompted me to check the version of the Lightning add-on, which I found to be 0.8 because I’d already installed the Ubuntu package for it and that was the latest version available.

As it turns out, the Ubuntu wiki has instructions for what I figured out on my own the first time around: version 0.9 of the Lightning extension has to be downloaded and installed manually for 64bit builds. After that, the GCal add-on was right as rain. Adding a calendar was as simply as accessing Google Calendar via the web, going to Calendar Settings for an individual calendar, and using the XML link for that calendar when adding the calendar to Lightning using new new Google Calendar option added by the GCal add-on.

Updating PHP Syntax Highlighting for vim on Ubuntu

This is just a quick post, mostly a "note to self" so I don’t forget how to do this. If you were curious, it was the result of indirect inspiration from these Become a Bash Ninja slides.

If you’re running Ubuntu 8.10 as your desktop OS, have vim installed, and use it for PHP development, you may not be aware that the PHP syntax file that comes bundled with vim is a bit outdated. There’s a fairly simple way to update it, though. In fact, it’s doable with two simple commands from Terminal.

cd /usr/share/vim71;
wget -O - | sudo tar -zxv

Running Spaz on Ubuntu Ibex 64bit

It took some digging to find it, but I finally found a way to make Spaz work on the Ubuntu Ibex installation on my Sony Vaio VGN-NR298E (with an Intel C2D 64bit processor). Up until I figured this out, I had been getting nothing but a non-responsive black box when I tried to launch Spaz.

Most of this comes from this tutorial on getting Twhirl and other AIR-based apps running on Ubuntu 64bit.

  1. Start by creating a new directory and and making it the current working directory. I just called it “Software” in my case.
    mkdir Software
    cd Software
  2. Install the AIR 1.5 SDK for Linux.
    mkdir air_1.5_sdk
    cd air_1.5_sdk
    wget -c
    bunzip2 air_1.5_sdk.tbz2
    tar -xf air_1.5_sdk.tar
    rm -f air_1.5_sdk.tar
    cd ..
  3. Install Spaz.
    mkdir SpazAIR
    cd SpazAIR
    wget -c
    unzip SpazAIR.air
    cd ..
  4. If you’re running 64bit, install the getlibs installer so you can easily get 32bit versions of libraries that AIR needs. Otherwise, skip this step. I believe the KDE equivalent to the libgnome-keyring0 package is kdewallet. Both should be installed by default on 32bit systems.
    wget -c
    chmod +x ./getlibs
    ./getlibs \
  5. Launch Spaz from the directory created in the first step.
    air_1.5_sdk/bin/adl -runtime air_1.5_sdk/runtimes/air/linux \
        -nodebug SpazAIR/META-INF/AIR/application.xml SpazAIR
  6. I didn’t find the default font used in the main tweet area to be very appealing, so I added this line to the User Theme CSS area of Settings.
    div.status-text { font-family: Tahoma; }

The only issue I ran into was receiving this error whenever I try to post: “An ActionScript error has occurred: Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.” Oddly, it doesn’t prevent posts from going through, though it is rather annoying. I have brought it up in a Spaz Google Group thread and hope to work with the developer to troubleshoot the issue further at some point in the future.

More Kubuntu Developments

I finally figured out how to control the monitor brightness via this forum thread using the xbacklight command. I’m really happy for that, because it was a bit of a strain on my eyes and I couldn’t find a way to do it through the desktop manager. One other nice point about the forum thread is that it also walks you through how to execute this command automatically when battery power kicks in.

Kubuntu doesn’t install it by default, but if you search Adept for ndiswrapper, you should get an option to install Windows WiFi Drivers. This includes drivers for the Intel PRO/Wireless 4965 AG/AGN card, and once installed, it worked without requiring me to track down and install drivers manually.

I wanted to see if some of my games would work under Kubuntu. I tried Wine, but wasn’t able to get it to run Warcraft III without crashing immediately after selecting the play option from the splash screen. Apparently the supporting libraries for my particular graphics card (Intel 965 chipset) are fairly buggy when it comes to hardware acceleration.

I also attempted to install VMware in order to run the game in a virtual machine, but that was a dead end as well: the game won’t run with the display drivers provided by VMware tools and that it’s not possible to install the host machine’s drivers and have them work correctly. Incidentally, this forum thread provided some feedback about how to remove a partial installation so that aptitude will allow you to do a reinstallation. sudo dpkg –purge –force-remove-reinstreq vmware-server ended up doing the job.

So, as much as I hated the idea of having to go back to Windows, I set out to configure my system to dual-boot. Small problem: I have a SATA drive, which requires special drivers that Hitachi claims can only be installed via a floppy drive. My laptop doesn’t have one, and I’m not overly inclined to purchase an external one just to install XP.

My friend Jeff Jones pointed me to a forum thread detailing how to integrate the SATA drivers as well as Service Pack 2 into a custom XP CD. Since I didn’t have another existing XP installation, I had to use a VMware machine. It took some digging to find the Intel 82801HEM/HBM SATA AHCI Controller drivers and how to extract them for unattended installation. I used XP-ISO-Builder to create a custom ISO image and  DeepBurner Free to burn it to CD.

In attempting to boot with the CD, though, I got as far as being prompted to install the drivers before being presented with the error “The file iaStor.sys is corrupted.” Setup wouldn’t proceed any further, so I gave up on it for now. If you have any experience with a working solution rolling SATA drivers into a custom XP CD, I’d be interested to know. Feel free to leave a comment on this blog entry.