Aching Brain Just another WordPress weblog

24Apr/082

Running FMS 3 on Gentoo Linux

I've been trying to install Macromedia Adobe Flash Media Server 3 on my local development box and have run into some problems.

To help out anyone else trying to do the same thing, here's how I did it.

First you need to install nspr

  1. emerge -uDv dev-libs/nspr

Add a user/group for it to run under:

  1. groupadd fms
  2. useradd -g fms -d /dev/null -s /bin/bash fms

Then download and extract the media server as per usual. Before installing it, you need to fiddle the install script so that it will install on your "unsupported" platform. Open installFMS in your favourite text editor and find the line that reads

  1. DISTRO=`check_distro`

Change it to something appropriate like

  1. DISTRO=redhat-RHEL4-i686

Then start the installation script as normal. Tell it that you don't want it to run as a daemon (as it requires the Red Hat only chkconfig command) and that you don't want it to start the server when done.

After you've installed the server, you'll need to make the bundled libasneu.so.1 library available for use:

  1. ln -s /opt/fms/libasneu.so.1 /lib/libasneu.so.1

For some reason the install messed up the configuration files, adding things like the administrative user name twice. Check conf/fms.ini to make sure this hasn't happened to you.

The installer creates init scripts at /etc/init.d but in order to use them you first need to create a file called .autostart in the installation directory:

  1. touch .autostart

You should then be able to start and stop the server normally:

  1. /etc/init.d/fms start
  2. /etc/init.d/fms stop

And use rc-update to have the server start on boot:

  1. rc-update add fms default

Good luck.

Popularity: 98% [?]

Filed under: Technology 2 Comments
17Apr/083

Vista SP1 sales video

I really hope this is a spoof as it makes me want to stab myself in the eye with a fork.

Popularity: 92% [?]

Filed under: Life 3 Comments
15Apr/087

Prototype String.toQueryParams() weirdness

I just came across this while using Prototype:

  1. "section=blo%g&id=45".toQueryParams();

To save you the trouble of running it yourself, I'll tell you what happens - the unescaped percent symbol causes a URI malformed error to be thrown.

Very odd. The Prototype documentation for toQueryParams says:

Parses a URI-like query string and returns an object composed of parameter/value pairs.

Since it's a URI-like query string and not an actual query string (by which I mean one that's been through the browser address bar and as such subject to whatever text munging the browser does), my example above should be a legal use case.

After a little digging around in prototype.js, it seems that the problem is caused by the JavaScript function decodeURIComponent() not enjoying being given a string that contains an unescaped percent symbol. Usually percent symbols are used in conjunction with a number to represent a non-alphanumeric character in a URL - %20 for space, etc, but in the above it's a literal percent symbol.

My first attempt to fix it changed lines 98 and 100 of string.js in the Prototype source to use the built in escape function:

  1. var key = decodeURIComponent(pair.shift());
  2. ...
  3. if (value != undefined) value = decodeURIComponent(value);
  4.  
  5. to
  6.  
  7. var key = decodeURIComponent(escape(pair.shift()));
  8. ...
  9. if (value != undefined) value = decodeURIComponent(escape(value));

This worked for my use case but caused Prototype to fail a different unit test. Changing them to the following worked out okay:

  1. var key = unescape(decodeURIComponent(escape(pair.shift())));
  2. ...
  3. if (value != undefined) value = unescape(decodeURIComponent(escape(value)));

Granted the unescape(...(escape(...)) is a little clumsy, but it seems to get the job done.

Adding the following unit test to string.html allows to test for the above:

  1. this.assertHashEqual({'key1': 'va%lue1'}, 'key1=va%lue1'.toQueryParams(), 'rogue percent symbol test');

I've created some test pages which demonstrate the problem.

There is also a patch file available. Apply it to /src/string.js in your Prototype source tree.

Update

I've also filed a bug.

Popularity: 100% [?]

Filed under: Technology 7 Comments
11Apr/080

Code

I haven't posted here for a while, mainly due to the time sink that is Facebook, but I have been writing code in my spare time, honest.  I thought I'd have a little skim through what's on my machine and share a few choice nuggets.

Recently I've been trying to get into programming applications for Mac OS X - I use it on a day to day basis so thought it would be best to get involved.  I've put some new things on the Stuff page for your perusal.  They are:

Backgrounderer

A little app to download desktop wallpapers from veer.com. If you wish to build from source, you'll need to install RegexKit first.

Mail RSS Exporter

An application that exports your RSS feeds from Apple Mail and stores them in either OPML format or Safari Bookmarks.

TouchMe

A program to run AppleScripts on a computer on your local network from your iPhone or iPod Touch - I use this to control a Mac mini attached to a projector.  The projector is not always switched on so Front Row was insufficient.  It also allows you to force quit applications that have hung.

SimpleHTTPd

A Cocoa native web server packaged as a framework so you can use it in your own projects.  Based on Jurgen Schwiezer's SimpleHTTPServer.

All of the above require OS X 10.5 Leopard as coming from a Java/PHP background I have a strange fetish for garbage collectors and consequently find manual memory management tedious.

They are all BSD licensed and source is included with each program so go crazy.

I'll get round to posting about each one in more depth in the near future.

Popularity: 92% [?]

Filed under: Technology No Comments
   

Pages

Categories

Blogroll

Archive

Meta