Sunday, April 26, 2009

Setting up MySQL on DNS-323

It took me awhile to get round to this (more than a year apparently) but I finally managed to get it done over the weekend. The trigger was because I am going to get a SqueezeBox Boom and will be running the associated controller software called SqueezeCenter (which requires the MySQL database) off the DNS-323.

Compared to the last time I was looking at doing this, the installation and setup is now a breeze, all thanks to fonz for creating a funplug package for it:
  1. Download the package from fonz's website
    # wget http://www.inreto.de/dns323/fun-plug/0.5/packages/mysql-5.0.67-2.tgz
  2. Install the package
    # funpkg -i mysql-5.0.67-2.tgz
  3. Setup the MySQL config file using the small version of the included examples (remember that the DNS-323 has limited resources)
    # cp -a /ffp/etc/examples/mysql/my-small.cnf /ffp/etc/my.cnf
  4. Define a storage location for your database files in the config file. For me, I have it on my USB stick as my usage pattern is mostly reads and I want to my HDD to remain in spin down state longer. Add in my.cnf after [mysqld] : datadir = /ffp/var/mysql
  5. Initialize MySQL
    # mysql_install_db
  6. Now create a database and have fun!
    # mysql -u root -p
    Enter password: your_root_password

    mysql> create database testdb;
    mysql> grant all on testdbuser.* to testdb identified by 'your_password';
    mysql> flush privileges;
    mysql> quit

  7. In case of errors, look up the log found in /ffp/var/mysql/[replace with your hostname].err

Besides using it with SqueezeCenter, I intend to also use it for some web-app projects (e.g. Joomla!). Stay tuned!

Wednesday, April 22, 2009

Microsoft Dynamics pains...

My organization has been using Microsoft Dynamics CRM and AX for almost 2 years now and have gone through one cycle of upgrades for both in that short time. And the reason? well, sad to say, is because both products fall short of what we wanted (and promised by vendor) initially as well as even now. Below are just a few examples of our disappointment:

1) AX Multi-timezone issue - we adopted the solution as a regional platform supporting 12 countries spanning 5 different timezones. Amazingly, the so-called enterprise class AX (previous version 4.0) cannot do this OOTB and even our vendor's promised workaround posed serious limitation to the way we do things. Having said that, the latest version 2009 does solve this problem.

2) CRM performance issue - The client side component of CRM is _extremely_ heavy (lots of small file fragments to load for a page and heavy use of javascripts) causing poor performance over WAN connections, adding substantial traffic to our regional corporate network (To make matters worse, network infrastructure across AP is still relatively poor, patchy and insanely expensive), and lastly requires reasonably powerful client side PC for snappy processing. We resorted to using Citrix to mitigate these issues (moving the load and traffic back to the server side) and even then, we are starting to find this "workaround" getting really expensive (Client license, rapidly growing Citrix farm increased hosting and management costs) as we scale up and throws our ROI right out the window. To top it off, the bloated and leaky (memory-wise) Internet Explorer in Citrix is NOT a good combination!

So in conclusion, IMHO, Microsoft Dynamics (especially CRM) is probably more suitable for small local shops rather than regional platforms with large number of users spread over geographically diverse locations.

Saturday, April 18, 2009

How to send email from scripts running on DNS-323

In the full installation of ffp 0.5, two email related utilities are installed by default. They are
  1. mailx - a Mail User Agent which allows you to send and receive mail using command line parameters, and
  2. esmtp - a Mail Transfer Agent which transfer mail from one computer to another
Unfortunately, they are not setup properly out-of-the-box hence you won't be able to use them right away. There also isn't any mention of how to do this on the wiki nor the package readme files.

Well, as it turned out, it wasn't that hard to get it up and running anyway which might explain the lack of documentation. But for the uninitiated, all you need is to create a config file called esmtprc in your /ffp/etc folder and input your mail provider details there. To learn more about how to configure the esmtprc file, take a look at this sample.

Then to send mail, use the mailx command syntax like this

> cat /bs/some_file.txt mailx -s "the email subject line" -r sender@somewhere.com recepient@somewhere.com

which sends the content of the file "some_file.txt" as the body of the message, or to send it as an attachment, use this

>mailx -s "this is your subject line" -a /bs/some_file.txt -r sender@somewhere.com recepient@somewhere.com

To use gmail as your mail provider, you may want to check out this forum post.

Thursday, April 16, 2009

How much does it cost to run a HomePlugAV network?

This question popped into my head today when I was contemplating leaving my HomePlugs on 24/7 instead of having to run around the house turning them on/off as required. So here's what I figured out:
  • Power consumption of the Aztech HomePlugAV HL109E is 4.5W (based on paper specs)
  • Running it all month will give consume 3.285kWh (4.5W x 730hr /1000)
  • At the current electricity price of $0.1803/kWh, monthly electricity bill will increase by $0.59
  • Over the course of a year, I will need to spend $7 to maintain 1 point.
  • Assuming I have 6 points in my house, that will be $42 a year!
Not cheap but still quite affordable considering that we are talking about six devices that are always on.

However, compare this with a 8 port LAN switch such as the Netgear GS108 whose paper specs say a maximum power consumption of 4.92W which works out to be just $7.70 a year for eight devices!

Hmm.. Looks like I will still be insisting that a wired Ethernet network infrastructure be one of the key requirements in my next house!

Saturday, April 11, 2009

DIY Passport Photos using your digital camera and photo printer!

Every so often, I find myself having to submit passport photos of myself or my kids for various applications. And each time, I find myself needing to go down to the neighbourhood print shops to get those photos taken/printed.

I remember back in the good old days, the process can take days and require professional equipment and a competent photographer. Of course, you have to pay an appropriately high price for the job. Something like S$6 for 4-6 photos.

However, with the advancement of modern digital photography and printers, all it takes is half and an hour (or less) and a common digital camera hooked up to a common photo printer. What's more, the entire process can be operated by a single five year old (ok, maybe 10). You will think that given the simplicity of the process and the cheap equipment required, the prices must have come down accordingly. Well, unless you have been living on another planet, the prices have been creeping up slowly.

To date, I have largely ignored the fact that I'm being over-charged for four pieces of photos that are barely larger than the size of a stamp. However, the last straw came when just two weeks ago, I found myself at a neighbourhood print shop needing to get my passport photos taken.

My usual practice is to just tell the shop assistant at my regular print shop how many pieces of photos I require, get through the process and pay the price shown on the till. This time however, I decided to try out a different print shop hoping that I can perhaps get it done cheaper. And boy was I wrong... this particular shop at IMM quoted me not the usual market rate of $6 for 4 pieces, she quoted me a whooping $12 for 4 instead! In fact, she even told me that its "cheaper" to get 8 pieces since it cost "only" $18! My eyes popped and I let out a loud "WTF?!" and did an about turn immediately. And that was when I decided that perhaps its time I make better use of my investments in my Sonly Alpha DSLR and my recently acquired Canon MFC printer.

The photo taking process is painless enough; just find a bright sunny day, stand indoors in front of a white wall somewhere near the windows where the light is coming through (make sure the sun is not shining on you though), and get someone to snap a few shots of you.

Don't worry so much about your position in the photo, just make sure your head and shoulders are covering at least half of the image. Oh, and don't use flash as that will cast shadows off your facial features (specifically your nose!) and reflections off your glasses (if you are wearing them).

Now here comes the difficult part, adjusting the image such that it complies with the specifications (size of image, position of your eyes, chin and shoulders, etc). Luckily, there is an online service called ePassportPhoto.com that will not only guide you along, but also let you finish the task in under five minutes with just a few mouse clicks!

All you need to do is to take the photo, upload it to the website, follow the few simple instructions to adjust the image and viola, a nicely adjusted image (comprising of 7 passport sized photos and a small text advertisement) that you can easily print on a 4"x6" photo paper and then cut it into the individual pieces.

So what is the damage of this DIY project? All of 30 minutes and $0.35 cents for a 4R sized photo paper! And you get SEVEN (eight if you cut and paste the advertisement away) passport sized photos to boot!

So goodbye to the ridiculously overpriced print shop down at IMM, and thanks for motivating me to find a cheaper way to get this done!