Archive for the 'OSS' Category

Reducing T420s Power Consumption under KDE/Linux

Oct 6, 2011

If you own a Lenovo ThinkPad T420s (or any recent-generation notebook with a Sandy Bridge CPU) with Intel HD 3000 Graphics, this information may help you to reduce the power consumption under KDE/Linux:

  • Intel HD 3000 Power-Saving: Enable the following Kernel command-line options: i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1

  • Force ASPM: Enable the pcie_aspm=force Kernel command-line option

  • In KDE, go to “System Settings” “Desktop Effects” “Advanced” and set the “Scale method” to “Crisp”.

Overall, this brings my T420s’s power consumption down below 9 W. For best results, use a recent Linux 3.1-rc pre-release.

Current NVIDIA Drivers for Ubuntu Natty

Jul 31, 2011

If you are looking for current NVIDIA drivers for Ubuntu Natty (11.04), my new PPA may be of interest to you. It hosts an Ubuntu port of the current release version 275.21 of the NVIDIA Linux driver.

To install:

sudo apt-add-repository \
   ppa:thilo.ginkel/nvidia-graphics-drivers
sudo apt-get update
sudo apt-get upgrade

Caution: There are some reports on the nvnews.net forums that this driver version breaks Gnome / GTK applications under certain circumstances, which I can neither confirm nor deny as I am using KDE (but GTK apps work correctly for me). You have been warned, use at your own risk.

KDE: Location-based Screen Lock Activation

Jun 5, 2011

Some laptop users may know the following scenario: In situations where others may potentially gain unauthorized access to your machine, e.g., in public places or in the office, you may want to enable a screen lock shortly after the screensaver kicks in so that the time window during which your system is potentially vulnerable to malicious users stays short (of course, it is still recommended to manually lock the screen when you leave your laptop unattended). However, at home, the need to unlock the machine after some inactivity becomes a little annoying, which makes enabling the locking functionality by default a less desirable option.

Now, what if your laptop could automatically detect your working environment and disarm or re-arm the screen lock depending on its physical location? Well, it can: Turns out there are some nice hooks available to run scripts during various network state change events. The ones that will be of interest for us are if-up and if-down. Apart from that we make the assumption that it will be possible to detect the laptop’s “safe” home location by means of it being signed in to a given WiFi network (identified by its SSID).

Before proceeding, let’s make some further assumptions for the sake of simplicity:

  • You are running a recent KDE version (the author uses 4.6.x – older versions may also work, though).
  • The paths mentioned in this guide may be specific to Ubuntu/Debian. Your mileage for other distributions may vary.
  • You have configured a screensaver through the KDE System Settings to automatically kick in after some time of inactivity.

The portion we will be automating is enabling and disabling the automatic screen lock after disengaging the screensaver using KDE’s kwriteconfig command. To do so, create a new script /etc/network/if-up.d/screenlock and populate it with the following content:

#!/bin/bash
     
SSID=
USERNAME=

/sbin/iwconfig wlan0 | /bin/grep -q ${SSID}

if [ $? = 0 ]; then
    logger "Disarming screen lock"
    su -c "/usr/bin/kwriteconfig --file kscreensaverrc \
       --group ScreenSaver --key Lock false" ${USERNAME}
else
    logger "Re-arming screen lock"
    su -c "/usr/bin/kwriteconfig --file kscreensaverrc \
       --group ScreenSaver --key Lock true" ${USERNAME}
fi

exit 0

Make sure not to forget to configure your user and SSID placeholder at the top of the script.

Also, make the script executable:

sudo chmod +x /etc/network/if-up.d/screenlock

So far, the script is only invoked when establishing a network connection. To also invoke it upon disconnecting, we need to create an appropriate symbolic link:

cd /etc/network/if-down.d/ sudo ln -s ../if-up.d/screenlock .

You can test whether the screen lock is working by manually enabling the locking facility in the KDE System Settings -> “Display and Monitor” -> “Screen Saver” -> “Require password after …”. Test whether the lock is effective by letting the screensaver kick in. When dismissing the screensaver you should be prompted for a password. Now, connect to your WLAN. Retry the screensaver test cycle, which should no longer require the entry of a password. Last, disconnect from your WLAN again to observe the lock coming back.

That’s it. Have fun with your new location-aware screen lock configuration. Of course, further uses of the mechanism can be thought of, such as automatic file synchronization. More to follow in a future blog post.

Bug relief

Apr 26, 2011

Just in case you have also been bitten by KDE bug 261323 (chances are good if you are running KDE on a multi-core system with an nVidia graphics card and compositing enabled) and are using Kubuntu (Maverick): You can get updated KDE 4.6.2 packages, which include a fix for this issue by KDE developer Martin Gräßlin, from my PPA:

https://launchpad.net/~thilo.ginkel/+archive/kde-4.6.x

Minor Asterisk for FRITZ!Box Update

Feb 6, 2011

I am a little short on time, so I will keep this post short.

In brief: If you had trouble compiling Asterisk against the current Freetz development branch or an Asterisk version built against an older version was regularly crashing when establishing a new connection, this update is for you.

The updated version is available for download at http://github.com/ginkel/asterisk-freetz-build/tarball/v0.5. As usual, code contributions are welcome. The source code is available on GitHub.

Confused? ;-) This post tells you what this is all about.

Upgrading Cassandra 0.6.x to 0.7.0

Jan 14, 2011

Just a brief recap of what manual steps are needed to upgrade Cassandra from 0.6.x to 0.7.0 using Debian packages:

  • Convert /etc/cassandra/storage-config.xml to /etc/cassandra/cassandra.yaml using the config-converter script. This currently does not seem to be included in the 0.7.0 .debs, so just grab a binary distribution to get hold of the script.

  • chown -R cassandra.cassandra /var/lib/cassandra/

  • Start Cassandra (typically using /etc/init.d/cassandra start)

  • Fire up jconsole, connect to localhost:8080 (or whatever JMX port you chose instead) and execute org.apache.cassandra.db -> StorageService -> Operations -> loadSchemaFromYAML

Enjoy!

Hash It! 1.3.0: Master Key Caching, Private Key Support and Improved Usability

Dec 25, 2010

Many people seem to get a productivity boost during the holiday season - open source projects all over the world are pushing out new releases these days. Hash It! is not an exception, so I am proud to announce the availability of Hash It! 1.3.0 for Android, a major feature release.

Most new features introduced with this release improve Hash It!’s usability, such as (optionally) caching the entered master key for a configurable amount of time, so that you don’t have to type it again and again as you hash passwords for multiple web sites. Another usability improvement causes Hash It! to automatically return to your web browser once you have hashed the password without the need to manually hit the back button. Of course, this is also configurable.

While previous Hash It! releases covered the functionality of the original Password Hasher Firefox extension, the Password Hasher Plus extension for Google Chrome introduced a new feature to improve the password strength using a private key. Hash It! 1.3.0 puts in support for this feature and should now again be fully compatible with Password Hasher Plus.

Last, but not least a few bugs fell by the wayside. Sorry, guys… ;-)

Hash It! 1.3.0 is available via the Android Market. Details are also available at: http://android.ginkel.com/

Merry Christmas & have fun using Hash It!, your friendly password memorization brain extension! ;-)

SCM-SCL011-Treiber ("nPA-Basisleser") unter LGPL?

Nov 24, 2010

Vor kurzem hatte ich mir einen SCL011-RFID-Reader bestellt. Nicht, weil ich mir den neuen Personalausweis zugelegt hätte - bewahre. Ich wollte vielmehr schon immer mal mit RFID herumexperimentieren. Und da es diesen Reader aktuell zum Preis einer Pizza vom Italiener gibt, habe ich zugeschlagen - viel falsch machen kann man bei dem Preis ja nicht.

Heute lag der Reader in der Post und als ich gerade den Linux-Treiber installieren wollte, dachte ich mir, ich schaue mir diesen vorab mal im Detail an. Und was sehen meine müden Augen da? In einem Descriptor (scl011_2.06_linux_64bit/proprietary/SCL011.bundle/Contents/Info.plist), der dem Treiber-Binary beigepackt ist, steht zur Lizenz:

This driver is protected by terms of the GNU Lesser General Public License version 2.1, or (at your option) any later version.

Ich habe beim Hersteller jedenfalls mal den passenden Quellcode angefordert ;-) und werde über die Reaktion hier berichten.

Asterisk for FRITZ!Box 7270 Updated to Version 1.6.2.11

Sep 11, 2010

After I had updated my FRITZ!Box to the current “Labor” firmware along with Freetz trunk my existing Asterisk build suddenly stopped working. This was a good reason to bring my asterisk-freetz-build script in sync with the current Asterisk 1.6.2 version as well with Freetz trunk, which I have been using for the most recent firmware build.

The updated version is available for download at http://github.com/ginkel/asterisk-freetz-build/tarball/v0.4. As usual, code contributions are welcome. The source code is available on GitHub.

And if this is all Greek to you, feel free to read my original blog post, which is a little more verbose.

Kubuntu KDE 4.5.0 Glitches

Aug 12, 2010

When it comes to upgrading my Kubuntu environment I am typically an early adopter. This includes backported KDE releases. Naturally, this also means that I am regularly bitten by bugs (which are most common in .0 releases).

Unfortunately, this just happened with KDE 4.5.0 where the systray is completely unusable when hosting icons for non-KDE applications (such as Skype or Google Desktop). As it turned out, a Qt bug is responsible for the mess-up and a fix is already available in the Qt 4.7.x development branch.

To put things short, a fixed Qt version is now available in my PPA until the fix is integrated into the Kubuntu Backports PPA.

Bugs, bugs, bugs...

Jul 10, 2010

Well, it seems that some ugly bugs made it into version 1.2.0 of Hash It!. Unfortunately, it took five days to notice…

Anyway, a new version (1.2.1) is out now, which should hopefully solve these issues. If any force closes remain, please drop me a mail.

Asterisk for FRITZ!Box 7270 Updated to Version 1.6.2.9

Jul 5, 2010

It has been a while since I published my guide to cross-compile Asterisk for the FRITZ!Box 7270. This guide and build script was based on Asterisk 1.6.0.19.

Asterisk development has not stopped, though, so the current Asterisk branch - currently at revision 1.6.2.9 - got out of sync with the asterisk-freetz-build script.

Now, what is so great about community-based software is that it facilitates contributions by others: Recently, I received an e-mail from Thomas Rueter, who provided me with a set of patches to compile Asterisk 1.6.2.8 using asterisk-freetz-build. His patches served as a basis for a revamped asterisk-freetz-build v0.2 package, which is capable of cross-compiling Asterisk 1.6.2.9 and chan_capi 1.1.5 for Freetz 1.1.x.

If you just want the updated package, you can grab it here. In case you are interested into contributing to its development, a copy of it is now available on GitHub.

And if this executive summary does not make too much sense to you ;-), feel free to read my original blog post, which I also updated to reflect the version change.

Hash It! 1.2.0 Adds Site Tag History and FroYo Apps2SD Support

Jul 5, 2010

Today marks another important milestone for Hash It!, your friendly password memorization brain extension. ;-)

While you can conveniently use Hash It! from your preferred mobile web browser via its “Share” feature, some people prefer starting Hash It! from the launcher, which requires manual entry of the site tag. So far, Hash It! did not remember these manually entered site tags, which required repeated re-entry of the respective tag over time. To close this usability gap, Hash It! will remember the site tag in a history from this release on. Just type the first few characters of the desired tag and the history of matching tags will be shown. Users concerned with the privacy implications of this feature can easily disable it in the settings.

Furthermore, Hash It! did not support FroYo’s (Android 2.2) Apps2SD feature. While Hash It! is pretty small (< 100 kB) compared to other Android applications (so this feature is probably not vital), I would still like to leave this decision to the end-user, which is why starting with Hash It! 1.2.0 you can move it to your SD card (given that your phone is running Android 2.2).

Hash It! 1.2.0 is available via the Android Market. Details are also available at: http://android.ginkel.com/

Have fun!

Skype under Kubuntu Lucid Lynx

May 31, 2010

As Skype voice recording stopped working for me after upgrading from Karmic to Lucid, I thought I would document what I needed to do to fix it:

Apparently, PulseAudio had my microphone muted although KMixer did not show this. The mute could easily be removed using pavucontrol, though.

Hash It! 1.1.0 adds ccSLD support

Apr 30, 2010

A couple of days ago I visited the UK and also took my Android smartphone with me. After accessing some loal .co.uk web sites I quickly noticed that Hash It! would not figure out the right site tag for them when it was invoked from the Android web browser via the “Share” intent.

So, I just rolled an update, Hash It! 1.1.0, which adds support for the most common ccSLDs (country code second-level domains), such as .co.uk, .ac.uk or .com.sg.

Hash It! 1.1.0 is available via the Android Market. Details are also available at: http://android.ginkel.com/

Enjoy!

History of a GPL Source Code Request

Apr 26, 2010

Weeks have passed and still no update from HTC regarding the availability of the HTC Desire’s Linux kernel source code. Let’s take a look back at the history of the case: On April 3rd, I initially asked for the Desire’s Linux kernel source code in accordance with the GPLv2. A couple of mails and a few weeks later, HTC finally escalated the support ticket and eventually forwarded my request to R&D; on April 16th.

Hash It! Updated to Version 1.0.2

Apr 20, 2010

It has been a while since I last worked on Hash It!, but thanks to the bug report of an attentive user I just uploaded a new version (1.0.2) of Hash It! to the Android Market. Bottom line: Hash It! now works correctly on Android 1.5.

Hash It! is licensed under the GPLv3 and as such comes with full source code for your entertainment.

Further details on how to download it to your mobile phone as well as the changelog are available at: http://android.ginkel.com/

Get it while it is still hot! ;-)

HTC's GPL (non-)compliance

Apr 3, 2010

Well, Linux is not just free as in beer, but also free as in speech. As I wanted to dig a little deeper into HTC’s modifications applied to the Desire’s Linux kernel I did, what I am entitled to as per the GPLv2 the Desire’s Linux kernel is licensed under: I requested the source code via HTC’s support as the “HTC Developer Center” at http://developer.htc.com/, which usually hosts the Linux kernel source code drops for their Android phones, does not mention the Desire yet:

Dear HTC support,

I would hereby like to request the Linux Kernel source code for my HTC Desire phone according to section 3 of the GNU General Public License v2 under which the Linux kernel the Desire is based on is licensed. A download URL will be fine.

Thanks,
Thilo

The answer I received was somewhat unexpected, but I will leave the judgment up to the reader:

Dear Thilo-Alexander

Thank you for your enquiry about linux.

Sorry we don’t support Linux, even though linux and android have similarities they’re not made for eachother. But here is the link for our kernals http://developer.htc.com/, happy Easter!

Best regards,

xxxx x
HTC Tech Support
www.htc.com
Tel: +44 8458900xxx

Better luck next time… I replied through their ticketing system insisting on a source code copy (along with a short educational section about the true origins of the Android platform ;-) ). Let’s see what their next reply will look like…

Duplicity - Backup to the Cloud

Mar 7, 2010

Due to current events I started to think about options for a backup solution that would be able to cope with a complete disastrous loss of hardware. So, off-site storage was warranted.

What I came up with is a backup solution based on Duplicity and Amazon S3.

Storing personal data in the cloud may ring one or another alarm, but with Duplicity the data is safe from prying eyes as all backed up data is sent through GnuPG using public-key encryption before being transferred to Amazon’s data center. You should, however, make sure that one of the private keys used for encrypting the backup is locked away in a safe place, so you have it handy when it is time to perform a restore.

As far as storage costs are concerned, storing 50 GB of data in the AWS S3 cloud for a month costs around 6 EUR, which I personally consider quite competitive for redundant off-site data storage.

Naturally, one drawback remains: Bandwidth usage. It takes a while to load the first full backup into the cloud as the upstream of most DSL lines is rather limited. After that initial load has completed, however, Duplicity is capable of appending incremental backup sets to the existing backup data, so the incremental backups complete much faster.

P.S.: It may sound a little weird that I chose Amazon Web Services as a storage provider after my recent trouble with Amazon.de, but after some thorough market analysis AWS remained as the only feasible option.

Hash It! - Stop overloading your brain with passwords

Jan 5, 2010

As a happy long-term user of the Password Hasher extension for Mozilla Firefox I got used to being able to use different secure passwords per web site without having to take the burden of remembering them all.

When I recently bought an Android-based smartphone I was missing most of that convenience while surfing the Internet from my smartphone as Password Hasher was not available natively on that platform.

Hash It!, an application for the Android platform I developed, is there to bridge this gap: It eases using unique passwords per web site without overloading your brain by generating site-specific passwords derived from a secret master key. It maintains compatibility with the Password Hasher Firefox extension.

Hash It! is free (as in speech) open source software released under the GPLv3 with the source code being available on GitHub.

Further details on how to download it to your mobile phone are available at: http://android.ginkel.com/

Enjoy!

Transferring Text Messages (SMS) from Nokia to Android

Dec 25, 2009

Around a month ago I replaced my old Nokia 6300 cell phone with the Android-based Motorola Milestone (aka. Motorola Droid). While I could easily transfer all contacts by adding them to my GMail contacts list the text messages (aka. SMS) were stuck on the old phone without any official way to transfer them to the Milestone. Fortunately, there is a solution using Gammu, some Perl scripting and the Android SMS Backup & Restore application.

Running Asterisk on a FRITZ!Box 7270

Dec 20, 2009

Around a week ago I started experimenting with running Asterisk on my FRITZ!Box 7270 to replace my DECT phone, which has been getting a bit long in the tooth, with a SIP client running on my new Motorola Milestone HTC Desire cell phone so that when I am at home and my cell phone is signed in to my WLAN I can use it as a mobile handset for calls arriving on my landline.

As it turned out it is a little bit tricky to get Asterisk to compile for the FRITZ!Box, so this posting is supposed to summarize the steps I had to take and also comes with a neat helper script, which should automate most of the required preparation and compilation steps.

Ext4 Performance Improvements

Nov 24, 2009

In order to speed up the general performance of my personal computer I put an Intel X25-M SSD into it some time ago and made sure that most binaries that are needed to start up Linux are loaded from the SSD. I could not go without a conventional hard disk, though, because the storage capacity of typical SSDs (or the budget that I am willing to spend) is still too limited. While boot times already improved dramatically after adding the SSD, mounting the file systems located on my conventional hard disk was still limiting the overall speed of the boot process.

That was when I read about the performance improvements introduced by the ext4 file system.

Sparse File Support for rsync

Nov 24, 2009

From time to time one needs to migrate large amounts of data from one file system to another, such as when migrating to a new hard disk, setting up a RAID array or migrating a file system from ext3 to ext4. Each time this happens I find myself googling for the exact rsync command to do the sync operation and each time the command line parameters mentioned in most search results neglect the existence of sparse files. So, mostly as a note to myself, here is the rsync command line I tend to use when replicating data to a new file system (including sparse file support):

rsync -aqxPSH _source_ _destination_

Using Valgrind to Profile KDE Plasmoids

Nov 1, 2009

During the past days I prepared my KDE Weather Ion for wetter.com for inclusion in the KDE Trunk. Before entering the review phase, the KDE people are asking for a memory leak analysis of the new code using Valgrind. That’s easier said than done as I could not really find some documentation on how to run a Plasmoid (along with its data sources) through Valgrind…

After a little bit of googling I finally figured out how to do this and would like to use this post to document my findings.

Well, the key to the solution lies in a neat tool called plasmoidviewer, which can be used to run a Plasmoid as a standalone application. From that point on, things get easy: Just run Valgrind on plasmoidviewer along with the desired Plasmoid and you are done, such as in (this example will run the leak check on the Weather Plasmoid):

valgrind --tool=memcheck --leak-check=full plasmoidviewer weather

Answers

Oct 21, 2009

A picture is worth a thousand words ;-)

Google Reader Screenshot

More answers than I had expected…

Firefox 3.5 on Ubuntu

Jul 5, 2009

Being both a Firefox and (K)ubuntu user I was awaiting the Firefox 3.5 release last week only to find out that a branded Firefox 3.5 release will not be made available for Jaunty Jackalope (Ubuntu 9.04), but only for its successor release, Karmic Koala.

Instead, there are various “Shiretoko Browser” incarnations available for Jaunty, the artwork of which I do not consider very appealing.

Still, I wanted to use Firefox 3.5 due to the speed improvements it offers compared to its predecessor.

Well, Firefox is free open source software, so all I had to was to fetch its source code from the Ubuntu Mozilla Security Team PPA and change the branding. The result is available in yet another PPA I created. Detailed installation instructions are available on the PPA page.

The Answer Has Arrived: KDE 4.2 Has Been Released

Jan 29, 2009

The (at least by me) long-awaited KDE 4.2 release has hit the road! What can I say: It’s beautiful and now contains most of the features that one wanted from a modern desktop environment that were still missing in KDE 4.1. I think I will write a more-detailed article about KDE 4.2 in a couple of days and so will concentrate today on a feature that many people were missing in previous 4.x releases: Icons on the desktop. Yes, there were some workarounds in 4.1.x like placing a large folder view plasmoid on the desktop, but nobody really liked it. In 4.2 the whole desktop becomes a large folder view at the user’s command just as one is used to from KDE 3.5 or Windows. To activate it, just right click on the new shiny desktop and select Appearance Settings from the context menu. Select “Folder View” from the “Type” drop-down and you are done.