Monday, 28 December 2009

How to install soundfonts in Audacity

To install a soundfont in timidity++, add a line to timidity.cfg:

soundfont /path/to/soundfont.sf2

How to install a better soundfont in timidity

There are several soundfonts out in the wild. This HowTo will use the fluidr3 soundfont which is accessible via the AUR.
Note: It will be assumed that you know how to build packages from the AUR. This excerpt will be very short and barely explained. Too short if you're completely new to it.
As sfarkxtc, a decompressor for soundfonts, is a make dependency of fluidr3, we install it first:
# pacman -S sfarkxtc
After sfarkxtc has been installed, we will be able to build fluidr3 which may take some time.
# wget
# wget
# wget
# makepkg
# pacman -U fluidr3-122501-6.pkg.tar.gz
If fluidr3 has been installed properly, we have to add it's path to the timidity++ configuration file. Just add this line to /etc/timidity++/timidity.cfg:
soundfont /usr/share/soundfonts/fluidr3/FluidR3GM.SF2
Then timidity++ is ready for use.


Friday, 25 December 2009

LG's foray into the mobile space: An excellent media device

This is a Sponsored Post written by me on behalf of LG Chocolate Touch. All opinions are 100% mine.

In the past, most of us have bought at least one MP3 player of some description. And then when that one fills up, and is supersceded - another one. And then there's the phone. And for emails and internet, the laptop. And a still camera for candid shots, plus a video camera for grabbing a few clips here and there. It's really quite ineffecient to have so many different devices - they waste energy, you have to keep track of dozens of different power adapters & chargers, and synchronising data between devices is, at best, painful.

That's where an all-in-one device such as the LG Chocolate Touch comes in handy. The aim of a device like this is to combine all your traditional electronic devices into one box, which makes it easy to organise and share your data over an internet connection.

The LG Chocolate Touch has all your traditional phone functionality - voice, text, and multimedia messages. It's also got a 3.2MP camera / video recorder, plus a built-in image editor so you don't have to transfer photos to your computer for simple touching up and cropping. Of course, the device is internet enabled, with a "One-touch Social Network Message Key" for easy use of Mobile Blogging (Facebook, MySpace, Twitter, etc.)

But perhaps the biggest feature of this phone is it's multimedia capabilities - Dolby Mobile technology is built in for crystal clear sound quality. An adjustable EQ allows you to setup the best sound experience for your environment, and there's even a "Rythmical Beat" feature that vibrates the phone in time with your music! On the LG website you can hear the difference between EQ modes on the phone - it's quite amazing.

This little phone is certainly worth a look - it reminds me quite a bit of the MyTouch 3G, and in more than the name. This device however, has significantly better multimedia capabilities, which may put it ahead if that's what your looking for. All in all, a solid all-rounder phone, with an edge in the multimedia environment.

SocialSpark Disclosure Badge

Android: How to scale an image in ImageView

To scale an image in the provided ImageView control, use this basic code:

Matrix mtrx = new Matrix;
mtrx.postScale(scalefactorX, scalefactorY);
mtrx.postTranslate(offsetX, offsetY);

This will increase the image size by scalefactorX and scalefactorY, and move the image so that the top left corner is at the location specified by offsetX and offsetY.

Wednesday, 23 December 2009

Bidazzled - entertainment auctions (with a charitable background)

This is a Sponsored Post written by me on behalf of Bidazzled. All opinions are 100% mine.

Today I heard about yet another online marketplace, amongst the plethora already available online (the most popular being Ebay). But this marketplace is different - 70% of the profits go to charity.

Bidazzled was launched in early November, and has already gained quite a following. This site is classed as Penny Auction or Pay-per-bid, where bids are purchased in advance and then used to bid on merchandise. This is very different from Ebay, where bids are free and you only pay if you win the item. Every time somebody bids with some of their pre-bought credit, the price goes up by a few cents, and a few seconds are added to the countdown clock to allow other people to bid.

An interesting feature is that if you don't "win" the action, you still have the opportunity to buy the item, minus the investment you made in it. So basically, you can't lose! Most of the time, people will save 80% off the retail price of an item. In the early days of this site, some people were even buying Nintendo Wiis for only a few cents!

Bids cost $1 at Bidazzled, and can be bought in packs from $25. I have an exclusive offer though for readers of this blog - 15 bonus bids, if you redeem this offer before 15th January 2010. Just enter the following code when signing up - no obligation!


Bidazzled also has a pretty good referral program. If:
*A refers B. A receives 5 Bonus Bids
*B refers C. A receives 4 Bonus Bids
*C refers D. A receives 3 Bonus Bids
*D refers E. A receives 2 Bonus Bids
*E refers F. A receives 1 Bonus Bid.

I suggest you check out Bidazzled - it just might be the thing for you. It's certainly worth a look - and remember, the profits are used to fund a charity, so if you spend too much - it's all in a good cause! =)

SocialSpark Disclosure Badge

Lyrics: Our Lady of the Southern Cross

Lyrics to the hymn/song "Our Lady of the Southern Cross", a Marian motet composed by Rev. Geoffrey Abdallah. Used at World Youth Day 2008 in Sydney.

Verse 1:
You said your 'yes' to the an-gel's word,
the Sp-rit of God was with you.
You walked with Je-sus through-out his life,
with a mo-ther's care and trust;
You stood at last be-neath the cross.
A mo-del of cou-rage and strength.

Teach us to hope, to be-lieve and love like you,
Our La-dy of the Sou-thern Cross.
Shine u-pon us, guide us through life.
Show us the way to Christ your Son.
Shine u-pon us, guide us through life.
Mo-ther of Je-sus. Mo-ther of Christ.

Verse 2:
You sat and prayed with his clo-sest friends,
a-wai-ting the Spi-rit to come.
You saw them change, as they went trans-formed
to a world they hard-ly know.
Now stand with us, O Mo-ther of Light,
as we speak God's love and truth.

Teach us to hope, to be-lieve and love like you,
Our La-dy of the Sou-thern Cross.
Shine u-pon us, guide us through life.
Show us the way to Christ your Son.
Shine u-pon us, guide us through life.
Mo-ther of Je-sus. Mo-ther of Christ.

Verse 3:
In the an-cient lands of the South at night,
the Sou-thern Cross shines so bright.
This bea-con poin-ted the travel-lers of old
to a path se-cure and true.
So Ma-ry, a guide to pil-grims to day
shows us the Christ who is our Way.

Teach us to hope, to be-lieve and love like you,
Our La-dy of the Sou-thern Cross.
Shine u-pon us, guide us through life.
Show us the way to Christ your Son.
Shine u-pon us, guide us through life.
Mo-ther of Je-sus. Mo-ther of Christ.
Mo-ther of Je-sus. Mo-ther of Christ.

Tuesday, 22 December 2009

Hyundai moves toward "greener" cars

This is a Sponsored Post written by me on behalf of Hyundai. All opinions are 100% mine.

Hyundai have just won the Global Green Challenge for energy-effecient cars. Personally, I had heard of Hyundai before but had never associated them with green cars. However, their latest model the new Hyundai Santa Fe, has just done a test from Darwin to Adelaide and came out with some pretty impressive fuel efficiency stats.
According to their website:
The Challenge includes two demanding urban loops and covers a total distance of 3,147 kilometres from Darwin to Adelaide. At the finish line in Adelaide’s CBD, after seven days of intense competition, the new Santa Fe R diesel had consumed a total of just 160.46 litres of diesel fuel and achieved a low 137.67 grams of CO2 per kilometre.
Apparently this car can get up to 1,200km on a single tank. With all the climate change & global warming talks (such as those at Copenhagen recently), cars like this are really what people will be looking for in the upcoming months and years. We want something lean, grean, fuel effecient and with low CO2 emissions. And it looks like Hyundai have just become the global, or at least-Australia-wide leaders in this field.

The Santa Fe R Diesel also has a few other impressive-looking features:

  • GreenR - 27% more power and 7% less CO2 emissions*
    *ADR 81/02 static laboratory urban cycle test for manual
  • SmartR - with push button start and safe reverse technology
  • LongR - up to 1,200km on a single tank
  • SafeR - 5 star ANCAP safety with rollover sensors*
    *5 star ANCAP applies to all Santa Fe variants built from October 2009
  • StrongR - 27% more power and 10% less fuel consumption*
    *ADR 81/02 static laboratory urban cycle test for manual
As you can see, 'R' seems to be the keyword here, implying that this care is only the start, as they get 'bett-R'. If we keep seeing increases in the 10% range we're going to get very fast, very efficient cars very soon.

CarsGuide have a good overview of the Global Green Challenge on their website. Also checkout the Hyundai website for more info on their energy-effecient cars.

SocialSpark Disclosure Badge

Sunday, 20 December 2009

Suspend / Hibernate fails & doesn't work on HP dv7t-1000 CTO Pavilion Laptop running Ubuntu 9.10 Karmic

I recently bought a new HP Pavilion (dv7t-100 CTO) laptop, and installed Ubuntu Karmic 9.10 on it immediately. Everything seemed to work perfectly out of the box, including the function keys. Only problem is, Suspend and Hibernate definitely did not work. Any attempt to suspend or hibernate would basically corrupt the hard drive, and on the next boot (after a manual fsck), /home was wiped.

The solution was simple. No SMART hard drive tests (incidentally, a short SMART scan said the drives were OK). No drivers or kernel modules in Ubuntu. Simply a BIOS upgrade.

I simply had to download the BIOS update from the HP website, copy them to a USB drive, and boot into Windows to install the update. On next reboot, suspend and hibernate worked perfectly, and no more corrupted hard drives!

Saturday, 19 December 2009

"Spellcasting Soda" D&D Potions at your next BBQ?

This is a Sponsored Post written by me on behalf of Jones Soda. All opinions are 100% mine.

Many of you may be familiar with the classic board game Dungeons & Dragons. Perhaps you've even played one of the plethora of online or PC-based computer games based on this same game. Well, now you have the chance to buy D&D potions - thanks to Jones Soda.

The new Dungeons and Dragons Jones Soda comes in multiple flavours - "Potion of Healing", "Sneak Attack", "Illithid Brain Juice" and others. I'm extremely curious about how the Brain Juice might taste - haven't tried brains before myself!

At the moment, the Limited Edition Soda can be ordered online for $10.99 for a six-pack. There are 5 flavours advertised on the website, and you receive a variety in each pack. This could definitely be an attention-grabber for your next BBQ or party - "Hey, who wants a Dwarven Draught?" Just remember that there could be a two week for your order, wait as the hand-made bottles are in high demand.

I'd suggest you check out the website, and let me know if you get to taste any of these. Leave a comment here with your favourite flavour! I'd personally go for the Potion of Healing - sounds safest to me, but hey, if you're more adventurous and want to try a Sneak Attack or Bigby's Crushing Thirst Destroyer, let me know how it tastes. =)

SocialSpark Disclosure Badge

Friday, 18 December 2009

Installing Android Devloper Tools on Eclipse fails - Ubuntu Karmic 9.10

I followed these instructions to install the Eclipse Android Developer Plugins using Eclipse 3.5.1 and the default Ubuntu Karmic install. However I was presented with the following error message when clicking "Next":

Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 0.9.5.v200911191123-20404 ( 0.9.5.v200911191123-20404)
Missing requirement: Android Development Tools 0.9.5.v200911191123-20404 ( 0.9.5.v200911191123-20404) requires 'org.eclipse.wst.xml.ui 0.0.0' but it could not be found

For some reason ubuntu doesn't include the standard update repository for Eclipse by default. To fix this:
  • Go to "Help/Install New Software..."
  • Add to the update sites list (strange it's not installed by default on ubuntu)
  • From there, install WST (use the filter box to find the package)
  • Restart eclipse
  • Go back to "Help/Install New Software..." and install the Android ADT as explained on the android website.

Wednesday, 16 December 2009

PHP: How to (Code) to check if a Windows file / folder name is valid.

Two PHP functions to check a string to see if it is a valid windows filename. The first simply checks the string, the second function will replace all occurrences of the invalid characters with a blank.

* Checks to see if a filename is valid for Windows
* Invalid characters are: < > : " / \ | ? *
* Returns false if invalid characters found, else true
function isValidFilename($filename)
if(preg_match('/[<>:"\/\\\|?*]/i', $filename))
//Invalid characters found
setDebug("Filename '$filename' contained invalid characters.");
return false;
} else {
//No invalid characters, must be valid filename
setDebug("Filename '$filename' contained no invalid characters.");
return true;

* Removes all invalid characters from a Windows filename.
* Invalid characters are: < > : " / \ | ? *
* Returns the (possibly) modified string
function fixFilename($filename)
setDebug("Filename to fix: {$filename}");
$newFilename = preg_replace('/[<>:"\/\\\|?*]/i', "", $filename);
setDebug("Fixed filename: {$newFilename}");
return $newFilename;

Wednesday, 9 December 2009

Install Ubuntu from Alternate ISO Image and USB Drive (Karmic 9.10)

I downloaded the Ubuntu 9.10 (Karmic) alternate install CD. At first I thought there would be no way to run a clean install from this, but I discovered a simple way, which doesn't even involve burning to CD. This method is designed to be run from another linux system.
  • Download the alternate install cd image
  • Find a usb thumb drive with at least 1GB free (may need more, up to 2GB)
  • Download usb-creator, and run it (usb-creator-gtk or usb-creator-kde on Kubuntu)
  • In the top box, choose your alternate ISO image. Plug in your usb drive and it should appear in the lower section of the window. Choose the drive (for example, /dev/sdb1) and choose "Discarded on Shutdown".
  • Click "Make Startup Disk"
You should then be able to boot your computer from the usb drive, and run the text-based installer.


I spy Eye-Fi - Intelligent SD Cards spark a camera revolution

This is a Sponsored Post written by me on behalf of Eye-Fi. All opinions are 100% mine.

Photo management is currently my biggest time-waster on the computer. Yes, even worse than Facebook. Often I will be looking for a photo that I took months ago, only to find it's still on the camera. Then I have to find a USB cable, memory card reader, and download the photos, search for duplicates from previous downloads, before finally getting back to the photo I was looking for.

Then what happens if I want to access those photos and my camera isn't accessible, or I downloaded them to another computer? There's no easy way to access the photos without uploading them to a web photo sharing service, and all this takes time and effort. Photo management has rapidly become an time and effort-intensive operation.

All this is set to change with the new wireless-enable memory cards from Eye-Fi. These 4GB SD cards come with built-in WiFi capabilities, as well as the smarts to automatically upload your photos from the camera to a suitable computer or web service which you have preconfigured.

Basically this card looks and acts just like a normal SD card. Stick it in your camera and shoot as normal. You can configure up to 32 wireless networks, and whenever the camera (with the memory card inside) comes within range of one of these networks, it will upload the latest photos to your selected destination - which could be folders on your computer, or one of 25 different locations online.

I definitely want to get one of these cards - it could save me hours of photo transfer time, and at just $60USD for the geo-tagging version it's quite cheap for the features.

Here's a video explaining the service in more detail:

SocialSpark Disclosure Badge

How to create multiple recovery disks for HP Recovery Manager

I recently purchased a HP Pavilion dv7 laptop. Since HP no longer ships recovery disks, and instead uses a recovery partition, my first step was to start the Recovery Manager and create some disks in case I needed to do a system restore later. However, HP only allows you to make one set of disks (thanks to IP laws) - and a set of disks had already been created by somebody. So I was pretty stuck.

However, there is a way to trick the program and create two (or more) sets of disks. There is a file named HPCD.sys located in both C:\WINDOWS\SMINST and the root of your recovery partition (in my case, E:\). Simply rename or delete these files (I renamed to HPCD.sys.bak) and HP Recovery Manager will quite happily create another set for you.

NOTE: In order to rename these files, you will have to go to Windows Explorer, press Alt+T to bring up the tools menu, click "Options". Go to the View tab, and select "Show hidden files and folders" and uncheck "Hide extensions for known file types" and "Hide system files and folders". Otherwise you won't be able to see the file!
You may also have to run Windows Explorer as Administrator - bring up the Start menu, right click Windows Explorer and choose Run As Administrator.


Tuesday, 8 December 2009

How to Connect Asterisk to Siemens Hipath 3000 with HG1500 using a SIP Trunk

For outgoing calls.

Create a new SIP Trunk in Asterisk, with this PEER config:

type = peer
host = ip.of.hg.1500

Then add an outbound route. That's all. Calls using that outbound route should now pass through the Siemens Hipath.

Monday, 7 December 2009

FIX: PHP MSSQL odbc_num_rows() returns -1

Running MSSQL with PHP  on Windows sometimes returns -1 for the function odbc_num_rows() even when there are rows in the result. This function fixes the problem:

 function best_odbc_num_rows($result,$currentRow=0)  {
   $numRecords = 0;
  odbc_fetch_row($result, 0);
  while (odbc_fetch_row($result))
  odbc_fetch_row($result, $currentRow);
  return $numRecords;

Common TCP Port Numbers

Well-Known TCP Port Numbers

In TCP/IP and UDP networks, a port is an endpoint to a logical connection and the way a client program specifies a specific server program on a computer in a network. Some ports have numbers that are preassigned to them by the IANA, and these are known as well-known ports (specified in RFC 1700). Port numbers range from 0 to 65536, but only ports numbers 0 to 1024 are reserved for privileged services and designated as well-known ports. This list of well-known port numbers specifies the port used by the server process as its contact port.

Port Number Description
1TCP Port Service Multiplexer (TCPMUX)
5Remote Job Entry (RJE)
18Message Send Protocol (MSP)
20FTP -- Data
21FTP -- Control
22SSH Remote Login Protocol
25Simple Mail Transfer Protocol (SMTP)
42Host Name Server (Nameserv)
49Login Host Protocol (Login)
53Domain Name System (DNS)
69Trivial File Transfer Protocol (TFTP)
70Gopher Services
103X.400 Standard
108SNA Gateway Access Server
115Simple File Transfer Protocol (SFTP)
118SQL Services
119Newsgroup (NNTP)
137NetBIOS Name Service
139NetBIOS Datagram Service
143Interim Mail Access Protocol (IMAP)
150NetBIOS Session Service
156SQL Server
179Border Gateway Protocol (BGP)
190Gateway Access Control Protocol (GACP)
194Internet Relay Chat (IRC)
197Directory Location Service (DLS)
389Lightweight Directory Access Protocol (LDAP)
396Novell Netware over IP
444Simple Network Paging Protocol (SNPP)
458Apple QuickTime
546DHCP Client
547DHCP Server
For further information, see RFC 1700. 

Linux find which program is using a port

The linux fuser command has a special option for port conflicts.
Use fuser -n tcp for tcp ports to see which process is using the port.
For example to see which application is already using port 80 use:
$ fuser -n tcp 80
The netstat command can also be used to determine what process is using a port.
Use netstat -nlp and you should see PID and names of programs along with the port they are using (note you can only see the PID of process you own, unless running as root)

$ netstat --nlp