Compiz on KDE4.8 – a few details

Just to follow up on my last post, apparently compiz on KDE 4.8 runs as long as you don’t use the KDE/QT Event Loop plugin, but do select the text plugin (CCSM, under image loading).

I don’t know the source of the instability, but if the KDE/QT plugin is selected, the following error is presented:

glibmm-ERROR **: 
unhandled exception (type std::exception) in signal handler:
what: call to empty boost::function

Trace/breakpoint trap (core dumped)

Also worth noting, I had trouble using the default window manager. But, if you place:

/usr/bin/kde4-window-decorator --replace

as the window manager (Compiz Settings Manager -> Window Decoration Plugin -> General Tab -> Command), it seems to work.

I’ll have to explore more, but it does seem to be working, for now.

Compiz works with KDE 4.8!

After waiting what felt like forever, compiz now works again for me with KDE 4.8. (That is to say, it works on Kubuntu 12.04 pangolin current build.)  At least, one of the major bugs (this is the one I filed, after complaining about it here) is fixed, which makes the compiz/KDE combination usable again.  I haven’t tested if some of the panels still do bizarre things like become permanent overlays on the screen, but I’ll get to those later.

In any case, I’m happy enough to be able to use KDE and compiz together again.  You know, I think I’m starting to like Pangolin… and it’s still on the first alpha!

Civilization V on Kubuntu 11.10

Just in case I forget, I managed to get Civilization V to run in Kubuntu 11.10 this evening.  It required the following:

sudo apt-get install wine
winetricks d3dx9 vcrun6 vcrun6sp6 vcrun2003 vcrun2005 vcrun2008 vcrun2010
winetricks corefonts flash
winetricks vcrun2008

Setting wine to work as Windows 2008, and then selecting direct x 9 (not direct x 11) did the trick.

I have some odd audio problem with it conking out after a few minutes, but otherwise, it ran reasonably well. Time to test it out for a few more minutes, while I get the puppy acclimatized to her kennel. (-:

Random OpenOffice 3.2 tip

Just in case I ever come across this problem again.

If OpenOffice 3.2 repeatedly crashes on dialog boxes for open/save/insert image/etc, the fix is to install a single package that seems to import the proper dialog box tool kit: openoffice.org-gtk

This is probably something that only happens to Kubuntu users, as openoffice.org-gtk doesn’t sound like a package you’d need on kde.

Anyhow, if you’re using kubuntu, the fix is as simple as:

sudo apt-get install openoffice.org-gtk

And instantaneously, everything works again.

A few notes on Ubuntu 11.04

Right off the bat, I have to say that I’ve been using 11.04 on one of my computers since one of the earliest alpha releases, so I’ve had the opportunity to watch it mature.  It’s something I often do – pick one computer, and use it to test out the new versions of ubuntu, upgrading the packages daily to follow along with the progress of the development. It’s usually a rewarding process, and I enjoy fixing bugs and learning how the operating system components fit together.

This was one of the few times that it was a disappointment for me.

Normally, I’ll start the process a month after the newest release, spending about two months using highly unstable versions, which then improve over time so that nearly all of the bugs are gone about a month before the official release.  This time, the release has come and gone, and my computer still doesn’t feel particularly useful.

Unlike the majority of Ubuntu users, I’m not using the default Ubuntu with Gnome window manager (or is it unity, now?), but rather KDE + Compiz.  Unfortunately, while the KDE version of Ubuntu (Kubuntu) doesn’t appear to get nearly as much attentention from the devs, it usually does march in lockstep, giving reasonable releases that come together at the last minute.  Unusually, compiz just never did come back together for me.  Perhaps it has to do with the upgrades to the xorg packages, but something is just not right when using compiz.

The symptoms are frequent restarts and crashes of the windowing system, in which the CPU usage of compiz soars to 100% and fails to respond to anything short of a the “killl -9” command.  Unfortunately, that makes compiz totally unuseable.  Ironically, it seems to happen only when closing windows, which seems like a strange place for a bug.

The workaround, if it’s actually a work around, is to completely disable compiz, which means switching back to the default KDE window manager.  Fortunately, it’s stable, so at least I can use the computer.  Unfortunately, I find Compiz to be a significant boost to my productivity, with the rotating cube desktop, the scale plugin, etc.  All of those things really make the experience on the computer, so turning all of them off it just unapealing.

In any case, for now, I’ll be staying with 10.10 on my laptops and production computers until compiz is fixed, with the possibility of jumpping straight to 11.10 as soon as that begins if I see compiz gets a bit more of the attention it deserves.

Your milage may vary, but 11.04 isn’t likely to make an appearance on my main computers anytime soon.

Celebrations

Some days you celebrate the little victories, other days, you celebrate the big ones.

Today, I get to celebrate a pretty significant victory, in my humble opinion: I managed to get the ensembl java API to compile and generate a fully operational battle station jar file that works with my Java code.

I know, it doesn’t sound like such a big deal, but that means I worked out all of it’s dependencies, managed to get all of it to compile without errors and THEN managed to fix a bug.  Not bad for a project I thought would take months.  In fact, I’ve even made some significant upgrades, for instance, it now creates a java 1.6 jar file, which should run a bit faster than the original java 1.4.  I’ve also gone through and upgraded some of the code – making it a bit more readable and in the java 1.6 format with “enhanced loops”.  All in all, I’m pretty pleased with this particular piece of work.  Considering I started on friday, and I’ve managed to make headway on my thesis project in the meantime, I’d say I’m doing pretty well.

So, as I said, I get to celebrate a nice little victory…. and then I’ll have to immediately get back to some more thesis writing.

—–

For posterity’s sake, here are the steps required to complete this project:

  1. Get the full package from the Ensembl people. (They have a version that includes the build file and the licence for the software.  The one I downloaded from the web was incomplete.)
  2. Get all of the dependencies.  They are available on the web, but most of them are out of date and new ones can be used.
  3. Figure out that java2html.jar needs to be in ~/.ant/lib/, not in the usual ./lib path
  4. Fix the problem of new data types in AssemblyMapperAdaptorImpl.java. (It’s a 2 line fix, btw.)
  5. Modify the build.properties file to use the latest version of the mysql API, and then copy that to the appropriate ./lib path.
  6. Modify the build.properties file to reflect that you’re generating a custom jar file.
  7. Modify the build.xml to use java 1.6 instead of 1.4
  8. Figure out how to use the ant code.  Turns out both “ant build” and “ant jar” both work.
  9. Note, the project uses a bootstrap manifest file which isn’t available in the source package on the web. If you use that code, you have to modify the build.xml file to generate a custom manifest file, which is actually pretty easy to do.  This isn’t required, however, if you have the full source code.

When you write it out that way, it doesn’t sound like such a big project does it?  I’m debating putting the modified version somewhere like sourceforge, if there’s any interest from the java/bioinformatics community.  Let me know if you think it might be useful.

Fixing the screen/LCD brightness keys on a macbook pro, Ubuntu 10.10.

If you’ve been following my posts, you’ll know I have a macbook pro running Ubuntu Linux, and you’ll also know I love tweaking things. I’m not obsessive about tweaking, but if something could work better, I’d like it to work better. So after a month of having 4 dead keys on my laptop, I figured I had to do something about it.

They keys are:

  • keyboard back light brightness up
  • keyboard back light brightness down
  • monitor brightness up
  • monitor brightness down

They’re hardly the most important buttons on a keyboard, but I figured I’d let them sit idle long enough.

Getting them to work turns out to be a relatively simple.  Initially, I’d just followed the instructions here to get the keyboard LED brightness working, and that did a decent job…. but not perfect.  It didn’t actually let you get the brightness all the way to zero or to 255, the max brightness.   Thus, I modified the script:

(You can download it here)

#!/bin/bash
# Francisco Diéguez Souto (frandieguez@ubuntu.com)
# This script is licensed under MIT License.
# Modified by Anthony Fejes (apfejes@gmail.com)
#
# This program just modifies the value of backlight keyboard for Apple Laptops
# You must run it as root user or via sudo.
# As a shortcut you could allow to admin users to run via sudo without password
# prompt. To do this you must add sudoers file the next contents:
#
#   ALL = (ALL) NOPASSWD: /usr/sbin/keyboard-backlight
#
# You must then install the script in the path given above, eg, /usr/sbin/
# If you chose another path, then the location in the sudoers file must reflect 
# that path.
#
# After this you can use this script as follows:
#
#     Increase backlight keyboard:
#           $ sudo keyboard-backlight up
#     Decrease backlight keyboard:
#           $ sudo keyboard-backlight down
#
# You can customize the amount of backlight by step by changing the INCREMENT
# variable as you want it.

BACKLIGHT=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
INCREMENT=10

if [ $UID -ne 0 ]; then
    echo "Please run this program as superuser"
    exit 1
fi                                                                                                     
                                                                                                       
SET_VALUE=0                                                                                            
                                                                                                       
case $1 in                                                                                             
                                                                                                       
    up)                                                                                                
        TOTAL=`expr $BACKLIGHT + $INCREMENT`
        if [ $BACKLIGHT -eq "255" ]; then
                exit 1
        fi
        if [ $TOTAL -gt "255" ]; then
            TOTAL="255"
        fi
        echo $TOTAL > /sys/class/leds/smc::kbd_backlight/brightness
        ;;
    down)
        TOTAL=`expr $BACKLIGHT - $INCREMENT`
        if [ $BACKLIGHT -eq "0" ]; then
                exit 1
        fi
        if [ $TOTAL -lt "0" ]; then
            TOTAL="0"
        fi
        echo $TOTAL > /sys/class/leds/smc::kbd_backlight/brightness
        ;;
    *)
        echo "Use: keyboard-light up|down"
        ;;
esac

Following the instructions in the header to add this into the sudoers file, you can then go to your windowing environment and associate the keys with the command. In my case, I went to the Settings menu in the KDE launcher, clicked on the System Settings toolbox and went into the Gestures and Shortcuts menu. I created a new group brightness controls in the custom input action settings, then used the menu to create new global shortcuts and picked the “command/URL” type. At this point, all you need to do is move to the “Trigger” tab, click on the key you want to associate with each command, then enter the commands into the action tab. (The commands are:

sudo /usr/sbin/keyboard-backlight up

and

sudo /usr/sbin/keyboard-backlight down

Getting the screen brightness to work wasn’t that much harder. The script looks like:

(You can download it here)

#!/bin/bash                                                                                            
                                                                                                       
# Anthony Fejes (apfejes@gmail.com)                                                                    
# Template taken from post by Fran Diéguez at                                                          
# http://www.mabishu.com/blog/2010/06/24/macbook-pro-keyboard-backlight-keys-on-ubuntu-gnulinux/       
#                                                                                                      
# This program just modifies the value of video brightness for Apple Laptops                           
# You must run it as root user or via sudo.
# As a shortcut you could allow to admin users to run via sudo without password
# prompt. To do this you must add sudoers file the next contents:
#
#   ALL = NOPASSWD: /usr/sbin/mbp_backlight

# After this you can use this script as follows:
#
#     Increase backlight keyboard:
#           $ sudo mbp_backlight up
#     Decrease backlight keyboard:
#           $ sudo mbp_backlight down
#

BACKLIGHT=$(cat /sys/devices/virtual/backlight/mbp_backlight/brightness)
MAX=$(cat /sys/devices/virtual/backlight/mbp_backlight/max_brightness)
MIN=4
INCREMENT=1

if [ $UID -ne 0 ]; then
    echo "Please run this program as superuser"
    exit 1
fi

case $1 in

    up)
        TOTAL=`expr $BACKLIGHT + $INCREMENT`
        if [ $BACKLIGHT -eq $MAX ]; then
                exit 1
        fi
        if [ $TOTAL -gt $MAX ]; then
            let TOTAL=MAX
        fi
        echo $TOTAL > /sys/devices/virtual/backlight/mbp_backlight/brightness
        ;;
    down)
        TOTAL=`expr $BACKLIGHT - $INCREMENT`
        if [ $BACKLIGHT -eq $MIN ]; then
                exit 1
        fi
        if [ $TOTAL -lt $MIN ]; then
            let TOTAL=MIN
        fi
        echo $TOTAL > /sys/devices/virtual/backlight/mbp_backlight/brightness
        ;;
    *)
        echo "Use: mbp_backlight up|down"
        ;;
esac

And method is identical to that above, associating the appropriate keys to the command:

sudo /usr/sbin/mbp_brightness up

and

sudo /usr/sbin/mbp_brightness down

And I’m now happily able to use all of the keys on my keyboard!

Kubuntu 10.04 on a Macbook pro

After spending a few hours setting up a macbook pro with kubuntu 10.10 (Maverick), I figured there were a few things that would be useful to jot down.

First of all, I found this page very helpful: https://help.ubuntu.com/community/MacBookPro6-2/Maverick – instructions on setting up a macbook pro 6,2 with Kubunu Maverick provided by the community.

Unfortunately, not all of their advice was spot on, so there are a few things I figured I’d need to point out:

  1. run sudo apt-get update; sudo apt-get dist-upgrade once you’ve got things set up – that will upgrade and solve a few problems right off the bat
  2. you will need to install mbp-nvidia-bl to get the screen brightness controls working (more on that later) and you’ll want macfanctld to control the fans. I’m not sure what btusb-dkms does, but it wasn’t a problem down the road, so you can install all three at once with: sudo apt-get install mbp-nvidia-bl-dkms macfanctld btusb-dkms
  3. Mac Keys:The equivalent instruction on the community page suggests installing pommed – Do not install pommed! It’s unnecessary, it constantly takes up about 4% cpu and doesn’t work well. You can configure all of the buttons elsewhere. (eg, I used compiz to set up the desktop widget and scale applications)
  4. You’ll want to have mbp-nvidia-dkms running at boot, so you’ll add the word “mbp-nvidia-bl” to the end of the /etc/modules file. (I also have coretemp in the file, having followed the instructions for sensors on the community page.)
  5. At some point, I installed “nvidia-bl-dkms”, which was causing the mbp-nvidia-bl-dkms to not be loaded (aka, blacklisted), so I had to remove it – if you haven’t added it, you won’t have that problem.)
  6. I used the command “alsamixer” to unmute the speakers, as suggested on the community page, but then also had to make a few changes to the sound control widget. First, I had to change the master control from the High Def sound controller to the onboard sound controller, and then un-mute that. That enabled sound on my system AND made the sound buttons on the keyboard work.
  7. I found (and still find) the touchpad to be extremely annoying – so I tried touchfreeze. Unfortunately, touchfreeze takes a constant 4% of cpu as well, so I killed that. The next best solution I had was to use the command “syndaemon -d -i 1” on the command line. This runs syndaemon in the background, and prevents the touchpad from doing anything one second after you’ve typed anything. It’s not perfect, but WAY better than nothing. You can put it into systems -> Startup and Shutdown -> Autostart, so that it will turn on every time you log in.
  8. Screen brightness is somewhat of a pain. Once you have mbp-nvidia-bl running as a module, you can use the screen brightness slider on the power control (battery) applet to control the screen brightness. Unfortunately, I haven’t gotten the buttons working yet – though, I’ve read that you can add “acpi_backlight=vendor” to your /etc/default/grub file to the end of the GRUB_CMDLINE_LINUX_DEFAULT parameter. I haven’t tried this yet. EDIT: Tried it – didn’t work. EDIT 2: There appears to be a KDE bug report for this problem, which is fixed in a patch in Nov 2010 – which means it’s unlikely that there’s a trivial fix for it – and furthermore, that it will be fixed in Kubuntu 11.04. (see this)

Everything else seems to have worked as advertised on the community page.

Credit for everything here should go to the people who posted them in forums – I didn’t invent any of this myself, and, unfortunately, I didn’t write down the sources for what I did use – I’ve googled using too many other computers on the way to getting things set up.

Further Notes by means of EDIT:

  • To enable the speakers on the macbook pro, you do need to install the gnome-alsamixer package, which will then give you the option of un-muting the speakers. I couldn’t track down this option using any of the other interfaces (sound applet, control panel or the alsamixer for the command line.)
  • The best way to set up the touch pad is to use the control panel to disable the single tap (set it to none), but allow tapping to be on otherwise. That fixes most (if not all) of the weird track pad behaviors.

Happy Kubuntu-ing.

A salute to IDEs.

Not that this will mean much to anyone but coders, but it was a startling revelation to me. After mainly doing code development in Java using the eclipse IDE (Integrated development environment, for the non-coders) for a couple of years, I’ve become pretty “soft” as a programmer.. When your IDE prompts you for function names, does imports and stuff, you can code pretty quickly, and the quality of your code is going to be relatively high. After all, you can focus on the algorithms and not worry about leaving silly typos in your code. (Bugs yes, typos not so much.)

However, since this weekend, I’ve been hacking around with data visualization using javascript/HTML5 – which, as far as I know, doesn’t have a Linux IDE for development. Hence, I’m writing code in the nano editor. (If you used email in the early nineties, nano looks just like the pine email client.) Unlike my “cushy” java IDE where function names come up automatically, working in nano means I need to memorize the name of every function I want to use.

Even worse, nano doesn’t display the code with proper formatting – it just assumes the whole thing is html and thus messes around with colours (making everything a dark, unreadable blue) every time I use a less-than (“<") symbol. Anyhow, even with the total lack of a decent IDE, I've still managed to write a couple hundred lines of code and have some neat but pre-mature animations. But... Unfortunately, I'm spending equal amounts of time looking up functions, testing code, and trying to debug typos. Coding this way is just like developing in pascal in 1992, except back then I had only a help file with no search function, whereas google is now my best friend. At any rate, I would like to take this opportunity to say thank you to the people who write IDEs. Like human rights and basic freedoms, you never appreciate your tools fully until you have to live without them.

Microsoft Fanboi Thread

Ok, I know you’ve been waiting for this.  Here’s a place for the Microsoft Fanboys to rant about how stupid I am.

When I left Nature Blogs, I spent time outlining why I hate Microsoft. Yes, that’s right, I do not like Microsoft or want to have anything to do with them.  They’re a monopoly, repeatedly convicted of abusing that monopoly to the detriment of the consumers around them.

It’s not a speculation, it’s a fact, held up in courts around the world.

In response to “Joe Hammock” – a coward who signed up with a “fastmail.fm” account just to write  a terribly rude comment on my Nature Blog post –  let me reply to get things started:

“You are quitely [sic] frankly the biggest fricken [sic] idiot I’ve ever seen in my entire life”

You lead a sheltered life.

“If you had a clue, you’d know that Microsoft is more altruistic than all the other tech companies combine. Hell, Bill Gates has pleged [sic] half of his wealth to charity. Jesus Christ, do some research before you run off a bunch of lies.”

Oh, I’m well aware that Bill Gates gives up a lot of his wealth to good causes.  I still consider much of it ill-gotten.   Microsoft made most of it’s money on its flag ship products of Windows and Office, both of which have been the focal points of lawsuits for the way that Microsoft has harmed their competitors. (The OS/2 Fiasco as well as WordPerfect come to mind as great examples of how Microsoft lied and cheated on their contracts to gain dominance.)  That Gates now feels he needs to give away 1/2 of his money to make him feel better about how he got it, after retiring from Microsoft, doesn’t make me feel any better about Microsoft as a corporation.

“As for the list of awful things Microsoft has done, would you like for me to reel off the massive list of things that Apple and Google have done?”

Actually, Yes!  I would.  I have never heard of Google abusing it’s monopoly, destroying competitors because it felt like it or engaging in otherwise unethical practices.  I know the standard lines about Google getting in Microsoft’s way, but that’s hardly a crime.  As for Apple, I don’t like their business decisions, but I’m not aware of any that were illegal.

So yes, please do list them! But hold the insults – they’re unnecessary.

“You are clueless and beyond idiotic.”

Thanks!  From you, that’s actually a compliment.

“It’s quite evident that you are nothing more than another pathetic Apple sycophant whose decided to hate Microsoft because of your love of Apple’s overrated products.”

Frankly, your shot is wide of the mark.  I rarely use Apple products, and I find them, for the most part, to be just as poor as Microsoft’s.  I don’t like the lack of interoperability or transparency.  If I’m a fan of anything, it’s GNU/Linux.   So, would you like to tell me why Linux is unethical?

“Did you know that hackers proved at a hacker’s convention that OS X is even less secure than Windows? No, because you’re an idiot.”

Wow.. that’s the best you can do for propaganda?  Common Microsoft Fanboys… man up and at least tell me which convention.  Anyhow, did I mention that I’m not emotionally attached to Apple?  Even if you had evidence, proving that Microsoft is no worse than Apple is hardly going to upset me.  Now, if you can show me how many critical flaws are found in the Microsoft Kernel versus the Linux Kernel, you might be on the right track.  Unfortunately, if you’re following the FUD trail left by Microsoft, their stats compare the Microsoft Windows kernel with the whole Linux ecosystem – hardly a fair comparison.

“God you are pathetic.”‘

I’m an atheist – suck on that.

Ok, have at it, Fanboy, this thread is all yours.