Archive for October, 2011

 

Multi language slogan or logo in Joomla!

When setting up a site in Joomla 1.5 for multiple languages JoomFish is the tool for you (Joomla 2.5 has native multi language support). But there are some things in Joomla that JoomFish can’t handle, like the slogan for example. This is one way of making a language dependent slogan.

  1. Create a file called en-GB.tpl_your_template_name_here.ini in language/en-GB (replace "your_template_name_here" with the actual name of your template).
  2. Insert a line like this in the file you just created:
    SLOGAN=Your slogan in english here
  3. Repeat the above steps for all languages you are supporting in your site, replacing en-GB in the directory and file name with the language codes for each language and the slogan in the corresponding language, for example sv-SE/sv-SE.tpl_your_template_name_here.ini for Swedish.
  4. Edit your template’s index.php file and find the line that outputs the slogan. It will look something like this:
    <?php echo $slogan;?>
    or
    <?php echo $this->params->get('siteSlogan'); ?>
  5. Replace the line with this:
    <?php echo JText::_('Slogan'); ?>

This will give you slogans displayed in different languages but to change the slogan, the above ini-files must be edited (the template slogan parameter will no longer have effect). 

The same method can be used if you want to have different logos displayed for different languages.

 

Share

Posted by on October 26th, 2011 No Comments

Asterisk streaming music-on-hold

In Asterisk it is possible to upload .wav or .mp3 files to be used as music-on-hold (MOH). Another option is to use streaming audio but using a stream from a Shoutcast server requires some hands on.

This is how I did the setup for AsteriskNow 1.7 with FreePBX 2.9.

First of all you will need mpg123 from www.mpg123.de to get the Shoutcast stream from the Shoutcast server.
If you already have gcc on your system you can skip the first step.

yum install gcc
wget http://downloads.sourceforge.net/project/mpg123/mpg123/1.13.4/mpg123-1.13.4.tar.bz2
bunzip2 mpg123-1.13.4.tar.bz2
tar xvf mpg123-1.13.4.tar
cd mpg123-1.13.4
./configure
make
make install

Login to admin of your AsteriskNow / FreePBX server and go to Setup -> Music On Hold. Click on Add Streaming Category. Enter the following: 

Category Name:   radio
Application:     /usr/local/bin/mpg123 -q -s -r 8000 -f 8192 -b 2048 --mono http://192.168.1.2:8000
Optional Format: 
mp3

Most Shoutcast streams are sampled at 44.100 kHz or 22.050 kHz in stereo. In order to use a stream for MOH in Asterisk it must be converted to 8 kHz mono, hence the parameters -r 8000 -f 8192 and –mono.

The IP-address 192.168.1.2 and port 8000 in the example should be replaced by the real ip-adress (or hostname) and the port number of the Shoutcast server you want to stream from.

In order to test the streaming music-on-hold, the easiest way is to set up a dummy extension (extension 446 in this example).
Edit extensions_custom.conf and add the lines below: 

nano -w /etc/asterisk/extensions_custom.conf

exten => 466,1,Answer
exten => 466,2,SetMusicOnHold(radio)
exten => 466,3,MusicOnHold()
exten => 466,4,Hangup

Save it by pressing CTRL-X and respond Y.

Now login to admin of your AsteriskNow / FreePBX server and go to Tools -> Custom Extensions. Click on Add Custom Extension. Enter the following: 

Custom Extension: 466
Description:      radio
Notes

And then click Submit Changes.

Don’t forget to click the orange Submit Configuration Changes in the top of the screen.

If all works as planned you will hear the streaming Shoutcast station when you dial extension 466.
 

Share

Posted by on October 9th, 2011 1 Comment

Ubuntu 9.10 package mysql-server-5.1 5.1.37-1ubuntu5.1 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

When trying to do an apt-get upgrade the MySQL package failed with the error message:

package mysql-server-5.1 5.1.37-1ubuntu5.1 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

The problem is that the start / stop script for MySQL fails to stop the running MySQL server before upgrade.

Solution:

apt-get update
ps ax | grep mysql

Now kill each process that has to do with MySQL.

apt-get upgrade

Voila – now it works and MySQL gets upgraded.

Share

Posted by on October 7th, 2011 No Comments