Nimal's Weblog

Nimal blogs here

Now Powered by WordPress

Welcome to WordPress. This is your first post.

- Not exactly, add another 127 and this would be my 128th.

I have moved, migrated this blog from Blogger to a hosted WordPress. Those who are following me through feeds might not have noticed this yet, so just click on your feed and check out whats new. I have been blogging since 2006, and completed 3 years this July. I enjoyed blogging over at Blogger, yet I always wanted to move to WordPress someday with my own domain. I’ve been actively blogging on my project blog last year, which was on WordPress. After buying this domain couple of months back, I decided I would move my blog here.

Lets see a ‘list’ related to this migration:

  • Domain – nimal.info, bought couple of months back, couldn’t wait more for .com or .net
  • Hosting – DreamHost, hosting with them for almost 2 years and happy with what I’ve been getting
  • WordPress – :)
  • Theme – Illacrimo Theme by Design Disease
  • Migration – Migration from Blogger to WordPress is pain, many thanks to Amit Agarwal at Digital Inspiration for this wonderful guide

I also made a decision to change the name of this blog from “The TalkOut Trojans!” to “Nimal’s Weblog”, which I think would be a more suitable name. Its most likely, I’d stick to the “TalkOut” avatar name on all other places, except to this domain.

The migration is so far smooth, and I’ll be tweaking around the theme and plug-ins for sometime. Let me know if you find any glitches on any pages, so I can fix them. I’ll also be WRITING more often than before (that’s the plan for now)…. :)

Quoting from my first post,

Now I’ve landed in blogger. We’ll see what happens in the future.

So, Now I’ve landed in WordPress, and the future, it’s yet to be seen…!

  • 3 Comments
  • Filed under: Writing
  • Text to Image in PHP with GD

    This is simple script to demonstrate the capabilities of PHP with the GD library, which provides a lot of image functions that can be useful in many applications. GD provides a rich set of functions. For a complete list of these functions, check the PHP manual.

    header('Content-Type: image/png');
    // Text to be converted to image
    $text = 'Hello World';
    // Font to use, give accessible path from script
    $font = './arial.ttf';
     
    // Convert HTML entities into ISO-8859-1
    $text = html_entity_decode($text,ENT_NOQUOTES, "ISO-8859-1");
     
    // Create the image
    $im = imagecreatetruecolor(160, 160);
    $white = imagecolorallocate($im, 255, 255, 255);
    $black = imagecolorallocate($im, 0, 0, 0);
     
    // Create some colors
    imagefilledrectangle($im, 0, 0, 160, 80, $white);
     
    // Add the text
    imagettftext($im, 12, 0, 20, 20, $black, $font, $out);
     
    imagepng($im);
    imagedestroy($im);
    exit;

    GD can also be used to create and manipulate image files in a variety of different image formats, including GIF, PNG, JPEG, WBMP, and XPM.

    Limitations:

    • Though GD supports Unicode text inputs, it doesn’t support complex text rendering
    • Complex Text Rendering is required for properly displaying many language texts, such as the Arabic alphabet and scripts of the Brahmic family, which includes Tamil and many other Indic scripts.

    There is a alternative for this using Pango and Cairo in PHP. I’ll post a detailed update on that in my next post.

  • 1 Comment
  • Filed under: Tech Notes
  • Activate Oracle on XAMPP for Windows

    With the default installation of XAMPP for Windows, we don’t get PHP Oracle connectivity enabled. This can be enabled easily when you need to connect to a Oracle Database from your PHP application/script. PHP has got the OCI8 extension, which provides Oracle connectivity to PHP application, and OCI8 uses Oracle Instant Client Package to get Oracle specific functions.

    I had the need to connect to a Oracle Database from a PHP script in one of my recent projects, the following is what I did to enable Oracle connectivity in XAMPP for Windows.

    1. In your XAMPP Start Page, go to phpinfo, look for string oci8. If string found it indicate that connection to oracle is available, otherwise to activate connection do the following steps:
    2. Open the currently used php.ini file by looking at the phpinfo, from the XAMPP folder.
    3. Find string ;extension=php_oci8.dll. Remove the semicolon (;) ahead of the string to activate the oracle extension.
    4. Save the php.ini file.
    5. Download the “Instant Client Package – Basic” for Windows from the OTN Instant Client page. Unzip it to c:\instantclient_11_1
    6. Edit the PATH environment setting and add c:\instantclient_11_1 before any other Oracle directories. For example, on Windows XP, follow Start -> Control Panel -> System -> Advanced -> Environment Variables and edit PATH in the System variables list.
    7. Set desired Oracle globalization language environment variables such as NLS_LANG. If nothing is set, a default local environment will be assumed. See An Overview on Globalizing Oracle PHP Applications for more details.
    8. Unset Oracle variables such as ORACLE_HOME and ORACLE_SID, which are unnecessary with Instant Client (if they are set previously).
    9. Restart XAMPP (or Start if its not already started).
    10. To make sure that connection to oracle database has successfully activated, go to phpinfo. Find string: oci8. If found, then XAMPP can now communicate with Oracle Database.

    The steps to do the same in a Linux box are almost similar, except there you will use the Linux versions of the packages and setting PATH variables would be different.

    You can ping me back with a comment if you run into any issues, I might be able to help you or I can learn from you.

    Reference:

  • 5 Comments
  • Filed under: Tech Notes
  • Happy Birthday Blogger

    On this day in 1999, Pyra Labs launched Blogger. Blogger was later bought by Google in 2003.

    I have been blogging with Blogger for the last 3 years in this blog, and also in my Tamil blog. It has been a wonderful experience for me with Blogger, (though I prefer WordPress these days).

    Congratulations to Google on 10 years for Blogger.

  • 2 Comments
  • Filed under: Tech News
  • So how did I get my Google Voice number from outside US… Yeah I live in Sri Lanka, and I have registered my Google Voice number and use it without any restrictions…!

    Google Voice is a wonderful service that functions like a virtual phone switchboard, and you can manage calls and route them to your various phones, voice mail, etc. It gives you a free phone number that can receive regular phone calls and route them to any other actual phones you have connected to your account.

    Unfortunately, currently its forwarding abilities are limited only to US phones. Also you are not allowed to access service registration when you are outside US. But I was able to do some workaround with the help of couple of online guides to create my own Google Voice number.

    How to signup to Google Voice?
    Currently its only by ‘invite mode’ but you can get an invitation within a week or so. During the signup process you will be required to verify your account via a US telephone number.

    How to access the Google Voice website for signup from outside US? (After you are signed-up you are allowed to access even from outside US)

    1. Get a friend of your’s in US to do this.
    2. Use a SOCKS Tunnel to access. (I won’t suggest this as its risky, also web based proxies won’t help)

    How to get a US number and verify it when you are outside US?

    1. Get a friend of your’s in US to add his home number and verify it for you.
    2. Buy a US number as a CallIn number on Gizmo, or any other similar providers, (priced around 10 – 20 $). (Callcentric, Voxalot)
    3. Get a free US number from IPKall (forwarded to Gizmo or any other VoIP service) that can be added to Google Voice signup.

    How to connect this with Gizmo?

    • Register for a free Gizmo account and get your Gizmo number (which is a SIP number, that can be used on any SIP client, on PC, on mobiles, on ATA devices)
    • Add your Gizmo number in your Google Voice settings page.
    • Add your Google Voice number in your My Gizmo page.

    What I have got now?

    • I have a Gizmo account I can add to any SIP enabled device.
    • I have a IPKall number which is also a US phone number forwarded to my Gizmo account, but I’m not going to use that at all.
    • I have a Google Voice number (thats what we wanted to have…!).
    • Any one can call my US number 540-IMN-IMAL (540-466-4625), and it will ring in my Gizmo phones, SIP applications or any other device. Its free for me.
    • I can call any US (& Canada?) numbers for free, (at least for 3 minutes).

    Thats how I got my nice Google Voice number. I’m ready to help you if you want to get your own Google Voice number, just leave a comment.

    Further Reading:

    1. Gizmo Voice – A mashup using Gizmo5 and Google Voice
    2. Adding a Gizmo number to Google Voice
    3. Taking calls from Gizmo
    4. Google Voice from Wikipedia
  • 3 Comments
  • Filed under: Tech Notes