Systems

Installing Boxee on Ubuntu 9.10

First you will need to install the following packages that Boxee needs to run, launch a terminal and run the following command:

sudo apt-get install libcurl4-openssl-dev libglew1.5 libsdl-gfx1.2-4 python2.4 python-sqlite libfaad-dev libtre4 xsel libmysqlclient15off libxmlrpc-c3 libsdl-gfx1.2-4 libcurl4-openssl-dev

To install Boxee on Ubuntu 9.10 first download Boxee from here (32-bit) or here (64-bit).

MySQL, PHP, Apache, and UTF-8 Issues

UTF-8 is hell. I have run into problems with UTF-8 before (see Migrating MySQL to UTF-8 encoding).

I moved a site that was displaying fine from an old Apache server to a new Apache2 server and quickly identified that the Apache2 server was displaying odd characters.

The site is running a PHP application with a MySQL backend. The MySQL database is using latin1_swedish_ci character encoding. The old site was displaying correctly. Both the new and old site are using the same database.

So what was going on?

Configure Exim to use Gmail as the SMTP Server

Configuring Exim to use Gmail as the outgoing SMTP server is simple. This HOWTO will walk you through installing, configuring and routing email thru Gmail for exim.

The first step is to install exim4. Launch terminal and:

sudo apt-get install exim4

Run the following command to configure exim4:

sudo dpkg-reconfigure exim4-config

Set the following:

General type of mail configuration: mail sent by smarthost; no local mail 
System mail name: (default)

Sierra Wireless USB 598 (Telus), Ubuntu 9.04, and Dell Inspiron Mini 10

The Sierra Wireless USB 598 currently offered through Telus *almost* works on Ubuntu 9.04 out of the box. A Windows or Mac box is needed to install the "Watcher" program that allows for the automatic online configuration of the Sierra Wireless USB 598. Aside from the requirement of Windows/Mac the card was immediately picked up and ready to go.

'No space left on device' Issue With vserver

I was running into an issue with a vserver where the disk space usage was at 23% but I was getting a 'No space left on device' error message. I run vserver with 12 virtual servers and none of the other servers exhibited the same behavior.

module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy

I ran into an problem with sound on a Dell Inspiron 518 workstation running Ubuntu 8.04. I had paused Amarok and then viewed a Flash video on youtube. When I went to play Amarok again Amarok stalled and hung there. I had to kill the amarok process to shut it down. The syslog gave up:

pulseaudio[29142]: module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy

MySQL Error: Specified key was too long; max key length is 1000 bytes

When updating a MySQL database table to use UTF-8 I came across an error:

ERROR 1071 (42000) at line 1: Specified key was too long; max key length is 1000 bytes

Initial research indicates that the maximum key size in MySQL is 1000 bytes. Given that latin1 uses one (1) byte per character and UTF-8 uses three (3) bytes per character some indexes will exceed the 1000 byte limit. This accounts for the generated error when converting tables with large or compound indexes from latin1 to UTF8 encoding.

According to the MySQL bug tracker this issue has yet to be resolved. Currently the only solution is to limit indexing on UTF-8 encoded tables or use latin1 instead. Not the best of choices to say the least.

Migrating MySQL to UTF-8 encoding

While developing a content management system (CMS) using default MySQL settings an issue came to light in regards to UTF-8 encoding. Clients were sending in documents in Microsoft Word format that were encoded with UTF-8. When the data was copied from the document and pasted into the CMS WYSIWYG editor strange characters would be displayed after saving the document.

A second issue was identified where exported MySQL tables that contained UTF-8 encoded characters were being not being read correctly by Debian. Note that I am using an old installation of Debian (fully updated of course) that was rolled out before widespread adoption of UTF-8. Newer installations may already have UTF-8 enabled by default.

The goals of this HOWTO are as follows:

  1. set newly created tables in MySQL to use UTF-8 encoding
  2. convert existing MySQL tables to UTF-8
  3. set default environment (command line) encoding to use UTF-8

Eclipse OutOfMemoryError

I was getting OutOfMemoryErrors when running Eclipse with multiple projects open. To solve the problem I added the following arguments to my quicklaunch:

eclipse -vmargs -Xms512m -Xmx1024m -Xss2m -XX:MaxPermSize=256m

Reference

-Xms

Specify the initial size, in bytes, of the memory allocation pool. This value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is chosen at runtime based on system configuration.

-Xmx

Automated MySQL Backups

The HOWTO will show how to automate the backup of your local MySQL server on a daily basis. The backup process uses a bash script and the local logrotate functionality to achieve an automated systems. The backup is processed daily via cron (see /etc/cron.daily/logrotate).

While this HOWTO is written for a local development environment it could easily by modified for remote multi-server environments.

Step1: Create the backup script

Create a file at /usr/local/sbin/backup_mysql.sh using your favorite text editor. I use joe:

Syndicate content