Photography: Florals and Greens

3 Mar 2008 In: Photography, Random

I took a short trip across the causeway last weekend and managed to catch some peace away from the hassle that is Singapore. And at the same time capture some great memories and pictures to go with it.

Floral and Greens Image 1 Floral and Greens Image 2

Floral and Greens Image 3 Floral and Greens Image 4

Floral and Greens Image 5 Floral and Greens Image 6

PHP Primer

24 Feb 2008 In: PHP

Presenting version pre-alpha of PHP Primer.

Okay, it was made for Singapore PHP meetup group. To be used by programmers well verse in other languages, like Java, C++ and possibly .Net programmers. Python and Ruby programmers not included. Simply because most developers moved from PHP to Python or Ruby. Never the other way round.

Trained developers should find the primer useful to get up to speed

Feel free to download the file. Note that it a PDF file and if you do not want to fire up Adobe Reader in your browser, kindly right-click and save as.

Download PDF: PHP Primer

The Primer was co-created with Adrian and made using the wonderful Scribus. Comments are welcome to improve this Primer.

Creating subdomain(s) in any web development environment is essential. For example, I have 2 projects going on at the same time and developement is concurrent. And subdomains were not created. So we have this scenario:

  • http://localhost/alphaproject/
  • http://localhost/betaproject/
  • http://localhost/phpmyadmin/

As you can see, I am assuming a Apache/PHP/MySql developemnt stack. 3 localhost urls that will be frequently accessed. Imagine what will happen when you want to access beta project? You “control+t” a new browser tab, and type in “localhost” only to have the url bar showing its history of the above 3 urls. Then you press the down arrow key to access the required url.

Waste of keystroke I will say. Now we create subdomains and we have:

  • http://alphaproject.localhost/
  • http://betaproject.localhost/
  • http://phpmyadmin.localhost/

So now when we want to access beta project? Type in “beta” and simply selected the required “remembered” url. Save some keystrokes and it will save up a a sizable amount of effort over time.

So how to create subdomain in Ubuntu?

Simple, I will cover the basic steps here. (Windows users, sorry, not here my friends).

Edit /etc/host and add the following line

127.0.0.1 alphaproject.localhost

Create a new configuration file in /etc/apache2/sites-available/alphaproject using

gksudo gedit /etc/apache2/sites-available/alphaproject

In this configuration file, have the following:

<VirtualHost *>
    DocumentRoot /home/username/alphaproject/
    ServerName alphaproject.localhost
    <Directory /home/username/alphaproject/>
        Options Indexes FollowSymLinks MultiViews +Includes
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

Save the file, and run the following:

sudo a2ensite alphaproject

Finally restart the Apache Server. Which I assume you should be using Apache2.

sudo /etc/init.d/apache2 restart

And by going to http://alphaproject.localhost/ you should be able to access you newly created subdomain.

On a ending note, phpmyadmin does come installed as a package but default to http://localhost/pma which I do strongly encourage users to change it to http://pma.localhost/

Think of the key strokes you be saving. And yes, do name your subdomain smartly, try picking each subdomain to have a different starting character.

Ubuntu is a fantastic OS. Out of the box it is very usable and it is not even a pain to install in the first place to install for most modern machine.

But as in any end-user or consumer product or service, there is always be a last mile problem. Ubuntu by itself is beautiful but not flawless.

I encounter the issue of getting flash to work on my 64bit dual core machine. The Firefox install that comes by default and the gnasp flash plugin that comes with it fails to play decent Youtube clips. That is a obstacle that will turn some potentially new users off. But of course the more technically adventurous one will seek out ways to resolve it.

My solution can be found in the wonderfully informative Ubuntu Forums.

A kind soul going by the nick Kilz created a nspluginwrapper package and install Flash 9 for most 64bits machines. That includes most AMD6, Core2 Duo and Dual Core machines.

The installation includes downloading a tar file, closing all browsers, untar the file, run the script in terminal and fire off your browser to get everything working again. Pretty much painless.

To prevent any issue with this install, if you had (tried and failed to) install Flash for 64bits on your machines prior, kindly uninstall and remove all the other packages, eg Gnash as their presence might still affect the way Flash is played on your browser.

Also final issue might have to do with sound which I did not encounter. Looking forward, I guess I might have to play with my Flash install sometime soon as Firefox 3 official release is just around the corner.

PHP Meetup Singapore: January 2008

19 Jan 2008 In: Events, PHP

Microphone - Vintage

I presented at Singapore PHP meetup January 2008. A simple talk about Design Patterns.

Honestly was not too sure if it is a good topic to cover given that we were pretty unsure of the type of developers we had. But  still we went ahead. Find out the details and video here. As well as the notes.

At the same time, do check out the Live Blog as posted as Simply Jean.

From my personal feedback, the level of interest with the technical part of PHP is still weak. Guess an interesting but technical discussion on design patterns have to wait. But the positive light is that people are warming up to MVC which is a good start for many as usage of PHP Framework gain popularity. MVC can be a good starting point for those who are interested to understand more on design patterns.

Once a Wordpress blog is up, the first thing to do is to set up counter spam measures. Surely it is a hassle to start with but as the blog gets more popular, spammers with find their way to you. And there are plenty of anti spam Wordpress plugins out there and picking them up is pretty easy. Here are my choice of anti spam Wordpress plugins:

Akismet
This big fella is installed by default in Wordpress 2.3 and above. And has been working pretty wonderfully for me. Yes, users have to jump an extra hoop by registering an account at wordpress.com just to get the Akismet API key. But that is a small price to pay for instant protection (sort of).

But then, any decent blogs will still get spammed and Akismet will do a decent job of sorting out drugs related comments from your real fans common. And most blog owners will having this urge to check their Akismet spam list to see if any unfortunate comments are mislabelled as spam. And that is a real time drain. Enter the next anti spam Wordpress plugin:

Maths Comment Spam Protection

A very small plugin that separate real commenters from spam bots. Installation requires tweaking of the comment.php presentation file. There is a 5 step installation guide to this and it should not be really difficult for anyone to get this Wordpress plugin up and running.

Also the plugin is very clean and does not use any JavaScript.

Seems like we have covered all angles? Not true, spammers knew that comments anti spam plugins are popular and advanced spammers continue their trade via trackback spam. Something that was covered by the creator of Maths Comment Spam Protection Plugin. Hence we need the next anti spam Wordpress plugin to counter trackback spam:

Simple Trackback Validation

Plug and play. Just download, upload (am I making sense here?) and enable the plugin and wave trackback spam goodbye.

So here we have it. The essential Wordpress Plugins to combat spam. There are plenty of other plugins that does the same job, and these three plugins had did wonders for me. Use them.

A toast to sweet things to come!

3 Jan 2008 In: Random, Uncategorized

The sweet taste of yet another blog. This will be the only post for a couple of days while I get the spam, comments, trackback and other essential plugins to work.

Meanwhile,

echo (“Hello World”);

About this blog

ThinkingNectar talks about the interest of Chin Yong, a PHP/Python/Web developer residing in Singapore. Life, society, and codes should entails most of what goes between the ears of this coffee drinker.

What makes you think?


Sponsors