Citrix on Ubuntu

Running Citrix from Ubuntu is getting progressively more difficult. This post is an attempt to document a few of the changes that we’ve had to make to keep it usable.

In my home folder, there’s a hidden folder named .ICAClient

To get rid of the extreme lagginess when Outlook or Lync show notifications we’ve edited appsrv.ini to include entries for ForceLVBMode and DeferredUpdateMode as follows:


;*****************************************************************;
; appsrv.ini
; Session configuration file for Citrix Receiver for Unix
;
; Copyright 1994-2002, 2006, 2009 Citrix Systems, Inc. All rights reserved.
;
;*****************************************************************
[WFClient]
Version = 2
ForceLVBMode = 1
DeferredUpdateMode = 1

[ApplicationServers]

and

To get rid of black boxes around the mouse pointer, I added an entry for DisableXRender in my wfclient.ini file. Like this:

;*****************************************************************;
; wfclient.ini
;
; User configuration for Citrix Receiver for Unix
;
; Copyright 1994-2006, 2009 Citrix Systems, Inc. All rights reserved.
;
;*****************************************************************
[WFClient]
Version = 2
DisableXRender=1

... more follows below

Chmod 20,000 files

I have a memory card in one of those slideshow picture frames with nearly 20,000 photos. I found that they were somehow read-only due to the file permissions.
I needed to chmod them but kept getting error until I did it like this:
[code]
find . -name ‘*.jpg’ -print0 | xargs -I{} -0 chmod 777 {}
[/code]

Linux bandwidth throttling

While doing a large file upload from my Ubuntu laptop, my internet connection was unusable from other machines at my house. I looked at the bandwith monitor on my router and saw that it was solidly uploading at 60KB/second – the upper limit of my home connection. I didn’t want to interrupt the upload already in progress so I installed an app called wondershaper.
[code]
sudo apt-get install wondershaper
[/code]

Now, on the Linux machine doing the upload I was able to limit the network interface upload speed to 20KB/second with the following command.
[code]
sudo wondershaper wlan0 1000 200
[/code]
Check the man pages for documentation, but just testing various combinations of numbers and calling the ‘clear’ command in between was good enough for me.

When it’s finished I can reset the connection speeds with:
[code]
sudo wondershaper wlan0 clear
[/code]

Replacing the domain name in a large file

I had a large text file (MySql database dump) with many instances of a domain name that I needed to change out for a website that’s being deployed under a new domain name. My first attempts to do a search & replace from a simple text editor failed and eventually crashed the editor. As well, it was not something I could repeat exactly the next time I had to migrate that same database again. The Linux utility ‘sed’ is a streaming editor that would easily handle large files and seemed like a simple solution. I ran it against the file twice, being careful to replace only the domain name as it appeared in URLs, and not where it appeared in any stored email addresses.

  • www.my-old-domain.com —> www.objectclarity.com/~newhome
  • ://my-old-domain.com —> ://objectclarity.com/~newhome

[code]sed -i.bak -e ‘s%www\.my-old-domain\.com%www.objectclarity.com/~newhome%g’ huge-mysql-dump.sql

sed -e ‘s%:\/\/my-old-domain\.com%://objectclarity.com/~newhome%g’ huge-mysql-dump.sql
[/code]

Here’s a breakdown of what the commands mean:

(-i.bak) creates a backup of the original file.
(-e) tells sed that a script follows
The part in single quotes is my search-and-replace expression in the following form:

‘s%regex%replacement%g’

(s) defines a search & replace expression
(%) is my delimiter. “/” is the default delimiter but as I’m working with URLs, I don’t have to escape each character and results in a simpler espression.
(g) tells sed to replace *all* instances of my regex with the replacement string.

Each command ran in about 1 second on a 40Mb file and it did the job perfectly.

Updating Thunderbird on an older Ubuntu installation

I’m running Ubuntu 10.04LTS on my desktop at home and while there’s a year left on updates, my Thunderbird was telling me that it’s about to stop receiving security updates. While I typically don’t care about installing all the latest and greatest (as is obvious by my 10.04!), I don’t want to be using ‘old’ software either. I thought I’d investigate what’s required to update to the latest Thunderbird mail client.
As it turns out, it’s pretty easy.

We simply have to add the Mozilla repositories and re-install it. Below are the commands required to update your Thunderbird. It took only a couple minutes!

[code]
sudo add-apt-repository ppa:mozillateam/thunderbird-stable
sudo apt-get update
sudo apt-get install thunderbird
[/code]

OpenShot Video Editor

Coming back from a recent vacation I have reams of images and several video clips that are in serious need of editing. I thought I’d try using PhotoStory as my kids use it at school and I haven’t heard the end of how great it is and easy to use blah, blah blah. Problem is it’s a Microsoft product. That in itself isn’t so much of a problem but Microsoft has the gall to question the authenticity of my Windows license just for the pleasure of downloading the latest (2005!) version of the app. After jumping through the required hoops and installing countless service packs and the obligatory reboot, I got the software installed.  After a quick look around I realize that it won’t import videos and has a limit of 300 images.   Ok, we’re done here.  I have over 500 images and several videos.  That was the whole point of looking for something that could make a nice clean video compilation.

Enter OpenShot for Linux.

OpenShot Video Editor is a free, open-source video editor for Linux. OpenShot can take your videos, photos, and music files and help you create the film you have always dreamed of. Easily add sub-titles, transitions, and effects, and then export your film to DVD, YouTube, Vimeo, Xbox 360, and many other common formats. Check out the full feature list, view screenshots, or watch videos of OpenShot in action!

Now I’ve tried other Linux video editors and spent my share of time with iMovie on our mac but I didn’t expect quite this much.  It’s fast, simple yet capable and super easy to use.  In an hour of fiddling I didn’t run into anything it couldn’t do for me and I didn’t get bogged down with features I didn’t need.  Overall I’m very impressed.  Grab the latest build and give it a shot.  You’ll be uploading home movies to YouTube before you know it.

Spamassassin

I’ve recently seen an influx of spam on several of the sites that I run. This led to a closer investigation of the default settings in Spamassassin.

You can automatically delete messages marked as spam. First set the number of hits required before mail is considered spam.

(Note: “5” is the default setting. The lower the number, the more conservative the setting.)

The description in CPanel isn’t as clear as it could be so I had to look further.

The numeric value is the measure at which Spam gets deleted.  Messages are assigned points based on how ‘spammy’ they appear.  Given that piece of info, the lower the number, the fewer messages get through.

Zend Framework Quickstart on Ubuntu 11.10

Running through the Zend Framework quickstart on Ubuntu 11.10, I ran into a few issues. Granted they’re not huge issues, but they slowed me down nonetheless.

1) Make sure that the php.ini for the cli is updated to include the zend framework. See the /etc/apache2/php.ini for the changes required.

2) When creating the /data and /scripts folders, they need to be in the root of your quickstart app, beside your “public” folder.

3) I didn’t have the Sqlite driver installed on my machine so that had to be installed before I could create the database.

AN ERROR HAS OCCURED: The sqlite driver is not currently installed

To fix this, I installed the “php-mdb2-driver-sqlite” package from Synaptic.

After fixing these 3 problems, the data loading script worked like a charm!

There was one more glitch getting the Quickstart app completed. Apparently in Ubuntu 11.10, Sqlite has been upgraded to Sqlite3 where Zend is still using the older version. Here’s a workaround to add the prior version to get through: https://bugs.launchpad.net/ubuntu/+source/php5/+bug/875262/comments/10

Dumping EXIF with exiftool and Nautilus

When sharing digital images online, I often find myself looking for an easy way to copy and paste the EXIF data. This little script when put into my ~/.gnome2/nautilus-scripts folder will create a text file of the most commonly used EXIF information.

[code]
#!/bin/bash
files=$#
count=1
message=`echo “Dumping EXIF from $files files”`

(while [ $# -gt 0 ]; do

# Strip off the file extension, including the “.”
upperExt=`echo $1 | sed ‘s/.*\(\..*\)/\1/’ | tr ‘[a-z]’ ‘[A-Z]’`

if [ -f “$1” ]
then
# Get the file name without the extension
# trimmed=`echo $1 | sed ‘s/\(.*\)\..*/\1/’`

if [ $upperExt = “.JPG” -o $upperExt = “.JPEG” -o $upperExt = “.PPM” -o $upperExt = “.CR2” -o $upperExt = “.NEF” -o $upperExt = “.OTHER_RAW_EXTENSION” ]
then
# Output EXIF data to a new text file named the same as the original image.
exiftool -canon -S “$1” > “$1.txt”
fi
fi
# Output the zenity progress bar
sav=`echo “(($count / $files) * 100)” | bc -l`
echo $sav
count=`expr $count + 1`
shift
done) | zenity –progress –auto-close –auto-kill –text “$message”

[/code]