Geek Stuffs

More shopping..

And again – I bought more stuffs from RS Online. This time around I got few things:

  • I/O expander that runs on I2C
  • I2C based LCD displays
  • 220 ohms resistors
  • 10 kiloohms resistors (to act as a pull up resistors)



Geek Stuffs

Finally. Managed to get working

I finally managed to get my sensor working! So happy. The JST connector – after a few tries again I managed to crimp it. Seriously even with a crimpler – I would probably struggle to do it. 

I managed to achieve two things:

  • Read the sensor values
  • Upload the sensor to the cloud

There are quite a few things which I wanted to do such as:

  • Hookup GPS sensor
  • Hookup 3G module
  • LED to show the status
  • LCD displays to show the readings

Definitely I won’t have enough ports thus I need to use a serial bus. That’s probably the next target. That also mean that I need to go buy more toys!! Hahaha

Anyway – here are the photos of my pm2.5 sensor. Basic read and upload. Not much. I suspect there’s a memory leak though. Hehe


Geek Stuffs

IoT Cloud – It Works!!!

Here’s the setup. Simple temperature sensor connected to the analog inputs.So it works. I managed to do a simple setup to read the temperature of my room and send it to the cloud for analysis 🙂

The data are then sent thru Intel iotkit-agent. Shown below is the log file of the agent.

At the output is as follows!


Not bad. Now i know how to send data to the cloud. Easily


Geek Stuffs

IoT ideas #2

Well. Now we get an indoor image. There are not much of things that we can do here. But basic stuffs would be:

  • Motion sensor to switch on and off the lights.
  • Door sensor for the electricity meter cabinets. Detect unauthorized opening. 

I guess that’s it that I can think of for this. Not much within this small space. 

Geek Stuffs


In the past 24 hours – I have been playing with Arduino. It’s a small little computer that is fully programmable. It’s quite fun. Given that I was not very good at electronics – this is a good experience to learn! Resistors, capacitors, modulators.. hmm.

I bought this kit recently from MyDuino – Arduino Starter Kit. It cost quite a bomb – but I must say I enjoyed the projects.


The kit consists of 15 projects – purely for beginners! And in the past  24 hours – I have completed almost half of it! Following is the list of the project:

01 GET TO KNOW YOUR TOOLS an introduction to the concepts you’ll need to use this kit
02 SPACESHIP INTERFACE design the control panel for your starship
03 LOVE-O-METER measure how hot-blooded you are
04 COLOR MIXING LAMP produce any color with a lamp that uses light as an input
05 MOOD CUE clue people in to how you’re doing
06 LIGHT THEREMIN create a musical instrument you play by waving your hands
07 KEYBOARD INSTRUMENT play music and make some noise with this keyboard
08 DIGITAL HOURGLASS a light-up hourglass that can stop you from working too much
09 MOTORIZED PINWHEEL a colored wheel that will make your head spin
10 ZOETROPE create a mechanical animation you can play forward or reverse
11 CRYSTAL BALL a mystical tour to answer all your tough questions
12 KNOCK LOCK tap out the secret code to open the door
13 TOUCHY-FEEL LAMP a lamp that responds to your touch
14 TWEAK THE ARDUINO LOGO control your personal computer from your Arduino
15 HACKING BUTTONS create a master control for all your devices!

Clearly in the next week I won’t have time as I would be busy working, but I shall continue the rest of it by next weekend.

As part of kit, see the video below for the a summary of the things that I’ve done so far:

Here are few pictures for the gallery!

Geek Stuffs

Onedrive – Unlimited

I had with one of my colleagues from Singapore, and we were talking about personal cloud storage. I’ve not look at it for a long time. In fact – at home I subscribed to Dropbox (and getting 1TB) and also Office 365 for the Microsoft Office subscription. What I didn’t realised is that with my Office 365 subscription – I get 1TB space. In fact – my colleague told me that Onedrive is rolling out unlimited storage for the subscribers (awesome). This is a good time for me to streamline my personal cloud storage.

So I did some research of myself to double confirm. First port of call is of course to check on my personal storage allocation:



OK – so I get only 1.02TB, though the line chart for the storage looks a bit confusing. Well doesn’t matter. I’ll find out more once I upload some of my files over. So now, I know that I am not part of the roll out. So I quickly went to search for information regarding the roll out. As of 27th October 2014, where they announced about no storage limit, it says that new subscribers will have unlimited. I guess people like me will need to wait a while more. Not an issue. I don’t think I have that much files that command me to have more than 1TB space. Even my photos are in the hundreds of gigs (surprisingly).



refer –


So I quickly when and try to put myself into the waitlist! Let’s see if I get it 🙂



Moving my files..

So now that I know that I have options to move my files, I quickly went and check how many files I have in my photo library!


Not many files indeed. Just 51k photos and over 609GB. That’s pretty awesome. Though, it will take me ages before I am able to transfer all my files over there!


This is when I wish I have 1GB fibre internet at home! It’s ok. Leave the computer on for 1 week or so, I should be able to clear off. In fact as of this morning (which is about 12 hours after, I am done with 24.8GB).

Fun Posts Geek Stuffs

Testing out my webcam?

Ada bagus?

Geek Stuffs

Defaulting My Icon on My Post using Custom Field

Custom fields in WordPress are great. It allows you to add your own user defined fields to your blog posting. I.e. putting in variables that you can use to further categorise your team.

I use custom field in my team to do two things:

  • To display the icon on the index page
  • To define images that will be put on my revolving slideshow on top left side

The theme which is use is done by somebody somewhere – and I have to further customise to suit my needs. The problem that i face, is that not all wordpress blogging tool support custom field. Therefore, some of my postings will have blank thumbnails on the index page. This is kinda annoying. Recently (or rather yesterday), I added a new plug-in called Twitter Tools. It allows me to put in Daily Digest of all my tweet as a blog posting on my site. The problem with this tool is that, it does not default the custom field. Thus posting by the tool will have missing image on my screen. Gosh…

So what can i do? Well, there’s few solution…

  • Write a script to default the thumbnail to be used – Too messy. I am not that good in PHP
  • Write a stored procedure or trigger on mysql to automatically add the custom field – Too messy and complicated
  • Put a simple if-statement in the theme (index.php) – Easy….

So i decided to put an if-statement – which is option 3. Here is the code..
<!—modification by fazli to implement default custom field –>
<?php if (strpos($post->post_title,"Twitter Updates") === false) { ?>
<?php if( get_post_meta($post->ID, "Image", true) !== "") { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Read the rest of <?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, "Image", true);?>" /></a>
<?php } ?>
<?php } else { ?>
<!–default to twitter thumbs–>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Read the rest of <?php the_title_attribute(); ?>"><img src="" /></a>
<?php } ?>

What it does really, is as shown in the diagram below…


So – it solves my problem of empty Image custom field, as well as defaulting my twitter updates to the twitter thumbnail. Fantastic!

Following are some of the information that will be helpful:

Hope this somewhat helps you in using thumbnails