… As A Service – SAAS, PAAS, IAAS

Thanks to nkhumpreys I was introduced to the three “.. as a service” concepts from cloud computing.  Even though I have been using the cloud I had never heard the terms before but they classified the tools I had been using. Here’s my overview.

SASS – Software As A Service

The top of the stack where the user interacts with an application which handles the processing and storage of data. Like a desktop application you access through a web browser.  The user is not usually developing code.

Examples: Google Docs, Dropbox, SalesForce.com

Typical Billing: on a monthly subscription

PAAS – Platform As A Service

A software platform is provided which abstracts away some of the elements of the cloud – normally the scalability elements. This allows a developer to write a piece of code that processes a job (e.g. output a page of a website) and not worry about how many concurrent instances there are. This is great for services that might have unpredictable demand or where there are bursts of activity – such as algorithm that runs for 5 minutes every hour.

Generally the platform makes restrictions on the type of languages of the software and the code must be written in a way so it can execute in parallel – think problems that would work under Map Reduce.

Examples: Google App Engine, PiCloud

Typical Billing: based on resource usage at a granular level – e.g. amount of bandwidth or number of CPU cycles used.

IAAS – Infrastructure As A Service

The renting of a piece of infrastructure for a short period (e.g. a server) in small increments (often hourly).   This reduces the need to keep spare servers to deal with load fluctuation – new servers can be rented on an hourly basis when required.  This provides full access of the instance server including shell access and installed libraries.

Examples: Amazon EC2Rackspace Cloud

Typical Billing: per instance per hour

Undefined subroutine &Scalar::Util::weaken

Ever had the problem in Perl:
Undefined subroutine &Scalar::Util::weaken called at
This is caused by a version of Scalar::Util that is perl only and doesn’t implement the weaken function (ref).  To install the XS version of Scalar::Util use cpan and run:
force install Scalar::Util

Adobe Flash in Fedora 16 x86_64

I always had problems getting Flash to work in both Firefox and Chrome when running Fedora Linux.  This became more of a problem since I started using the x86_64 kernel.  But here are the steps I took that worked under Fedora 16.  Thanks to the_nins on the chrome support pages.

Install the flash rpm from http://get.adobe.com/flashplayer/

Install the other required packages

yum install flash-plugin nspluginwrapper.x86_64 nspluginwrapper.i686 alsa-plugins-pulseaudio.i686 libcurl.i686

Create the wrapped up plugins for x86_64

mozilla-plugin-config -i -g -v

Create a symlink to the wrapped file:

cd /usr/lib64/mozilla/plugins
ln -s /usr/lib64/mozilla/plugins-wrapped/nswrapper_32_64.libflashplayer.so

Restart the browser and it should pickup the flash plugin.  I would also highly recommend using Flashblock for Firefox to load flash animations on demand.

Perl “Perl_Gthr_key_ptr” problems

I just upgraded by laptop to Fedora 16 and started to get problems with Perl libraries that were installed via yum.  Errors along the lines of:
perl: symbol lookup error: /usr/local/lib64/perl5/auto/Crypt/Rijndael/Rijndael.so: undefined symbol: Perl_Gthr_key_ptr
Some research suggest this is caused by the shared library being built against a different version of perl.  This is mainly a problem because Fedora provides a number of prebuild perl libraries through yum.  The fix for this is to use cpan to rebuild the libraries. So as root start cpan:
cpan
Then reinstall the libraries causing problems.  In the above example I did:
force install Crypt::Rijndael
This will recreate the .so file against the correct perl version.

CPAN error with vxs.so

There may be problems with cpan failing due to:
perl: symbol lookup error: /usr/local/lib64/perl5/auto/version/vxs/vxs.so: undefined symbol: PerlGthrkey_ptr
I managed to fix this by just deleting the whole folder:
 /usr/local/lib64/perl5/auto/version/

Apache and selinux

If you are calling perl scripts from apache there might be further problems like:
failed to map segment from shared object: Permission denied at /usr/lib64/perl5/DynaLoader.pm
This is an SE linux issue and can be fixed with chcon:
find /usr/local/lib64/perl5/auto -name "*.so" | xargs -n 1 chcon unconfined_u:object_r:lib_t:s0