Tag Archives: technology

Mobile tools for Webmasters

There are many different types of Webmasters (and Owners / Developers / Administrators / etc). One thing most of us love is to save money by opting for free services whenever it is possible. You do not always have to pay for high quality services. For example, Google Inc. is one of my favorite high quality free service providers. However, keep in mind that often these services are provided “as it is” without a warranty and for personal website Webmasters and small business owners.

Mobile Computing

This is not so much of a new tread but rather a continuation of the teach bubble. Many personal website owners and increase number of small business owners maintain their sites on the go. This is where smartphones and tablets can be very useful. But, I found keeping things up to date on a website can be a difficult thing to do. Looking out for those unwanted DOS attacks and server downtime can be time consuming. But it doesn’t have to be like that because there are tools to keep an eye on your site 24h/7d/year on your mobile device.

Introducing Pingdom

Pingdom is one of the most popular site among Webmasters. They offer wide range of technical tools for monitoring and managing your website. This includes the world famous, the Pingdom Speed Test. While there are two tears for their services (free as well as Pro paid version), for a novice Webmaster with a personal website, their free services are more than adequate. For example, if you want to keep an eye on your HTTP side of your server, you can create a free account and automate that process. This free account also comes with the access to a very well written Android and Apple apps.

The Pingdom mobile app provide critical server information such as outages, uptime and response time. Again, yes for FREE! I use it to keep track on this website. I would specially recommend anyone who is paying for their web hosting to use this wonderful free service. Because if you found that your site is not up 99.9% like some hosting companies claim, you can ask for your money back.

Android Mobile Pingdom App
Android Mobile Pingdom App

I should also thanks the Pingdom for coming up improved mobile support. Even while I am typing this article they released a new version of their app improving overall quality of presentation.

Google Google Analytics

I use a lot of Google free services. They include great services such as search engine, Google.com/cTLD, Custom Site Search, Google Adsense and other free Webmaster services offered by the company. While I do not have a favorite Google service, I can say Google Analytics is the best tool for monitoring web traffic.

Android Google Analytics App
Android Google Analytics App

Once you set up a site with with the Analytics tracking code, this mobile application will provide live traffic at your finger tips. Additionally, when used with Google Adsense, you can combine the visitor behaviors with your ad revenues or vice versa. This is a great tool for Webmasters with multiple sites too. You can combine data from several sites into a single app.

Android Terminal Emulator

As the title suggests, this is specifically for people with Android devices. But, this will also work on a Windows phone, tablet or a PC. The term “Terminal” is known as “Command Prompt” in Windows or simply “Terminal” in Linux/Unix.

So how can this be useful? Instead of using an application like Pingdom, you can use the Terminal Emulator to ping your site. Unless you write a script, you can have to manually ping your site(s) each time, one at a time. Therefore, this is a time consuming process for Webmasters with slow older devices. If you find that your phone “hangs” or crashes upon loading the Pingdom app, this is a good solution (although no means it is a prefect solution).

There are many other tools available in the market. I only introduced few of the most basic and generally bugs free items. I would not recommend using paid mobile tools unless you are running a large company. For most average Webmasters, these free applications can be as useful as Calculus to a an Engineer.

Rooting an Android

Some of you may have heard about the term “root” or “rooting” with regards to Android mobile Operating System. This term is not something new to computer and software geeks. Root is the most fundamental level in a UNIX or Linux based operating system. In order to install some apps and to tweak the behavior of a OS, you need the root access.

Due to various variables, every option listed here may not work for your particular phone.

Skip Jargon

Introduction to Android

I am not going to give long history on Android. From a technical perspective, you should know that it is an open sourced mobile Operating System currently supported and developed by Google. More than hand full of manufactures use this OS to streamline their devices. Android can be installed on mobile phones, tables, televisions, GPS units and any other electronic devices that support such architecture.


Rooting is granting access to most fundamental operations which otherwise will be blocked by system default. While not all applications of rooting may harm the device, due to the wide openness of what you can do with root access could brick your device (f*&^ked up beyond repair). This is why rooting an Android device will void your manufacture’s warranty. If you are not technically inclined, I would stay away from rooting. This article is written for tech guys who have limited experience in Android environment.

This also place a lot of responsibilities on the end user. After rooting a device, you will not have the “safety net” from malicious apps which otherwise will be in placed by default. It will be your sole responsibility to manage your root access permissions wisely.

How to Root an Android

Installing the Recovery

1) Download and install the drivers for your device from the manufactures. You may find them on their support website and/or the media that was provided to you by in the original packaging.

2) Download ODIN software. It will make it easier in flashing recovery and the rooted firmware. Please note that the ODIN will only works on Windows based computers.

3) Download the Odin flashable recovery (.TAR file) for your device then copy it to the same folder as Odin. There is an another option if you have a .img file. Please read further down for instructions.

4) Open ODIN by right click on Odin.exe –> “Run as administrator”. You should come up with a window similar to the following.

Ordin Program on Windows
Ordin Program on Windows

5) Turn off your phone and reboot into Download Mode. In order to go into the Download Mode, hold Volume Down + Home + Power while it shuts down. Continue to hold until the device is powered up and a text message appears on the top corner (very small sized texts). Once inside the Download Mode, press Volume Up to enter.

6) Connect the device to computer via USB/charger cable. It is recommended to use the original manufacture provided cable. If your phone do not support USB 3.0, please do not use USB 3.0 port on your system even if it is backward compatible. This is just to be safe.

7) The ODIN window should have a COM** port highlighted as shown here.

Comm USB port highlighted in ODIN.
Comm USB port highlighted in ODIN.

If ODIN is not highlighting the port, go back and make sure you have properly installed the right device drivers from your hardware manufactures.

8) Click on the PDA button on the right right pane of the ODIN. Refer to above image.

9) When prompted (once the PDA button is selected) go to the firmware location and select the firmware file (TAR file).

10) Warning! Make sure Auto-Reboot and F. Reset Time are the only options checked and that PDA is the only other thing checked on ODIN before starting the flash. CHECK again and again your settings and that you have selected the correct firmware for your model phone and are using the correct options. If you are using a laptop, make absolutely sure you are plugged in, or if on battery, that it is charged enough and will not go into sleep mode during flash.

11) Click Start to begin the flash. This will take a while, so be patient. Do not unplug or remove the battery during the installation. I highly recommend placing the device on a solid stable surface with the USB cable attached during this process. I would not move the device since some computers and devices have lose USB connections which could potentially disconnect your device. If the device gets disconnected, this may result in bricking your phone.

Flashing the ClockworkMod Recovery.
Flashing the ClockworkMod Recovery.

12) Once the installation is successfully completed, the ODIN will report PASS on the top left hand corner. The phone should have automatically rebooted at this time.

ODIN report back "PASS" in a green box after a successful install.
ODIN report back “PASS” in a green box after a successful install.
You may unplug the phone and close Odin if you wish.

13) Wait at least 5-10 minutes (or even as long as 30 min) for the system to boot the first time and then build its cache. Do not remove the battery or disconnect power during this time.

You may now flash a ROM file using the PDA button on the ODIN. You can also flash a ROM using either a custom recovery or the default system.

Another option for ROM Flash

1) Download the appropriate ROM zip file and save it on your phone (just like saving any other file).

2) To get into the recovery mode, hold Volume Up + Home + Power while it shuts down. Continue to hold until the device is powered up. An example of a recovery screen is shown below (CWM).

ClockworkMod Recovery screen.
ClockworkMod Recovery screen.

3) Choose “install zip” (or “install from zip”, “install ROM”, etc) and select the zip file you saved.

4) After few minutes you should get a success message. Now go back and reboot your phone.

Third option for ROM Flash

You may flash a ROM that comes in the image (.img) format. Do not feel overwhelmed by the coding. Just follow the instructions and it will be installed on your device in few seconds.

1) Download a recovery image of your choice. For example; ClockworkMod Recovery Images. Save the .img file in your device’s memory.

2) Rename the image file to recovery.img or anything of your choice. Note: If you decided to rename the file other than recovery.img, then please change the second line of code appropriately to reflect the file name (dd if=/sdcard/YOUR_FILE_NAME.img of=/dev/block/mmcblk0p18).

3) Download a terminal app, which will allow you to enter commands into your Android system.

4) Open the terminal app and follow these instructions.
– type and enter

$ su

– type and enter

# dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p18

– type and enter

# reboot recovery
Example of a terminal with recovery image named as "re.img".
Example of a terminal with recovery image named as “re.img”.

There are significant risks associated with this method. If you flash an incompatible ROM or if you enter the codes wrong, you could end up bricking your phone.

Common Errors

During the rooting and installation process of a custom ROM, you may come across errors. Do not panic because most of these errors are common and can be fixed.

Status 7 Error – installation aborted

Be warned that editing the code impropriety may result in bricking your device. Before edit the code in the ROM zip folder, make sure that you have the right ROM for your phone. By removing the code, we essentially removes the safety mechanism in which recoveries like ClockworkMod uses to block invalid zips from being installed.

Clear codes in updater-script file up to (NOT including) show_progress(0.500000, 0);. You should be able to locate this file at, META-INF –> com –> google –> android. The number of lines that should be deleted varies with each custom ROM. For example, the CynogenMod 10.2 will have the following check code at the very binging.

assert(getprop("ro.product.device") == "d2att" || getprop("ro.build.product") == "d2att");
assert(getprop("ro.bootloader") == "I747UCDLK3" ||
       getprop("ro.bootloader") == "I747MVLDLK4" ||
       getprop("ro.bootloader") == "I747MUMBLK3" ||
       getprop("ro.bootloader") == "I747MUMBLL1");
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
package_extract_file("system/bin/backuptool.sh", "/tmp/backuptool.sh");
package_extract_file("system/bin/backuptool.functions", "/tmp/backuptool.functions");
set_perm(0, 0, 0777, "/tmp/backuptool.sh");
set_perm(0, 0, 0644, "/tmp/backuptool.functions");
run_program("/tmp/backuptool.sh", "backup");

Initial boot stuck in a loop

Go back to recovery and clear (wipe) user data, System, Cache and Dalvik. Instructions for will soon be posted here. These options are in the recovery section under “advanced” menu.

GooglePlay Store is not installed

Most custom ROMs do not include GooglePlay files. You need them not only to download apps, but also for basic functions such as the Google Keyboard. You can flash this file into your device using the any compatible ZIP file available online with the GooglePlay Store.

1) After downloading the ZIP to your computer/phone, relocate the ZIP file to the root of your device storage main memory. This will make it easier to find during flashing.

2) Go to the Recovery Mode and select “install zip”.

ZIP folder installation choice.
ZIP folder installation choice.

3) Select the option for device storage memory.

Go to device storage memory.
Go to device storage memory.
If you have saved the ZIP file in the root of the device, it will probably be under a folder titled “0”.

4)Go back and clear memory before rebooting. Once the reboot is complete, you should see your GooglePlay app. If you end up with a connection error even when you have a wifi or mobile network connection, try the following for troubleshoot:
– Check if you have installed the latest compatible version of gapps for your mod.
– Check if the hosts configuration is correct using a file explorer app. Go to device root -> etc -> hosts (open as a text file).
– If both of the above failed, delete the GooglePlay app (from the settings), then re-download the ZIP and start this process over. Sometimes during download process, the file gets corrupted.

Too many choices; help me out

To a novice Androider, choosing what recovery and ROM to flash along could discourage rooting. I am all for choices, but sometimes even I need some guidance. You may choose any recovery and ROM that is compatible with your device. You may even use the stock ROM with the root access. It all depends on your choices. However, in case you need my opinion (personal choice), this is what I would recommended:

  • Compatible version of ClockworkMod Recovery (Touch or non-Touch)
  • Compatible version of CyanogenMod stable release
  • SuperuserSU app for controls
  • Compatible signed version of Google Apps zip

Happy rooting 🙂

Home electrical wiring basics

During home automation projects, you will probably replace the electrical fittings such as outlets for appliances and lighting fixtures. There are few basic things you should research before you begin. But first of all let me give you a warning; if you do not have experience working with electrical wring, please contact a professional for help. In this article, I will explain how to replace a traditional electrical switch to a Z-wave compatible switch.

Advice to all dummies

Electric shock alert

The following project involves working with ~ 110/240 volts alternating current (AC). Even with the power cut offed, there is always a risk of electric shock. Do not work on this project if; you are unfamiliar with electrical work, do not have proper equipments and/or regulations and laws in your area prohibit do-it-yourself (DIY) electrical modifications. I, Sanuja Senanayake or the site sanuja.com will not take any responsibility for any personal injury or property damage.



The following items are essential to this project. In addition, you may require other materials such as drywall patches for cosmetic work.

  • Suitable screw drivers and/or bits; electrically insulated drivers would be better
  • Wire cutters and strippers
  • Electrical tape
  • Electrical wire connector clips in few different sizes
  • Multimeter; a digital unit would be better/tester
  • Z-wave compatible switch

Optional items.

  • Extra electrical wires (short one would be enough)
  • Gang box
  • Wire staples and hammer

Let’s go…

After deciding which switch to replace, find the trip switch for the circuit on you central electrical box. If it is a light, I would turn it on to check if the power is still there. If you are installing a relay for a garage door, make sure the door is at closed position before you cut off the power. Prior to installing the Z-wave or wireless device read the manufacture’s guidelines for installation and usage. It is recommended to have at least 1/2 of the signal power from automation controller and the wireless LAN at the location. You may use a repeater for better signal strength. Please note, all Z-wave wired products (non-battery operated) are repeaters of the Z-wave signal.

After turning off the main power to the circuit, using your multimeter and/or tester, check if the power is out. Once you know that for sure, remove the two screws holding the switch. Gently, with some force, pull out the switch until you can access the left and right sides of the unit. Now, you should be able to remove the wires. But wait! Before you disconnect any wires from the old switch, I recommend taking a pictures of the setup. This can be very useful in places with three of more phases (and many other situations with lots of wires). It is important to have enough room in the gang box in order to accommodate the bulky back side of automated switches. If you find it is too tight to place all the new switches in the particular box, please replace the current gang box with a new unit with one extra slot. The extra slot can be closed up with a dummy plate as opposed to populating with an another switch.

You cannot install a dimmer switch in all locations due to wiring limitations. If you already have a traditional dimmer, you can install a automated dimmer at the same location. However, you may not have the dimming support on all gang boxes. The Z-wave switches often require a common wire. So, what is a common wire?

Electrical wire identification for a Z-wave dimmer.
Electrical wire identification for a Z-wave dimmer.

In the above image, the common wire is the white wire that is labeled C. All the common wires from switches attached to the same point. The wire B is the neutral wire (also white) that goes to the light. The green wire labeled G is the ground. Finally the Z-wave dimmer switch is labeled Z.

In this particular location, I can install two independent dimmers. But not all locations are wired to handle dimmers. If you do not currently have a dimming switch, it is possible that you cannot install one without extensive wiring. Unfortunately this is the case for most older houses. The cost of electrical home automation can be significantly increased with the age of the house.

When adding a new unit, always follow the instructions of the manufactures and the guidelines on electrical work in your area. Make sure the wattage rating of the automated unit does not exceed that of the load. For example, in my experience a unit that is rated for 500 W would be good for about 400 W load. After that between 400 – 500 W you are kind of experimenting. It may even handle 600 W but I recommend keeping units under load.

Make sure the wires are connected to each unit are securely held. Gently try to pull out the wires from all wire connector clips to ensure that all the wires are in place. Do not provide power to the circuit, without checking the integrity of your connections.

Once you have hooked up the wires, clear the area of any debris and keep the unit(s) out of the box. Please provide ample space between the electrical unit and the gang box to prevent electrical arcing. Now go to the main switch board and turn on the power. Check if the light(s) or appliance functions as expected. In case of a smoke or spark, immediately turn off the circuit.

Once you are done testing, turn off the circuit again. Now apply electrical tape to all exposed areas and wire connector clips. Put back the devices in the box and place the cover. Now you are ready to program the unit.

Cleaning things up

On the first image you can see I have applied electrical tape to cover all exposed connectors and wires. It is important to use the tapes to isolate these connectors to prevent shorting.

On the image bellow, the arrow in the above image is pointing to a staple which holds the wires in place. You can also see a Z-wave relay switch and the garage door opener switch. I have replaced the entire gang box with a new one. As you can see the metal box has been secured on both sides.

Garage door opener, Z-wave relay module and light switch.
Garage door opener, Z-wave relay module and light switch.

Programming an Z-wave switch

There are several companies manufacture Z-wave compatible switches. GE and Evolve and Leviton are few popular companies. Regardless of the manufacture, the process is simple. Press the add button on your Z-wave controller near the switch. Then press the switch at ON position several times until your Z-wave controller indicate successful addition. Each Z-wave controllers have their own set of instructions on how this works. Please follow the guidelines accordingly. For your information; I am very satisfied with the options and possibilities of VeraLite3 controller. However, I am cannot recommended anything since each controller comes with different advantages.

Other programing options

Electrical installation process is same for all units. The x10 and INSTEON controllers will have sightly different programming steps. At the end of the day, this article is all about basics of home electrical wiring. Refer to your manufacture’s user guide on how to add items to your specific programming standards.

Brains of Whole House Automation

I recently discussed possible centralized controllers for household fixtures such as lights, door locks and security systems. Once you have selected what type of standard(s) you will use, the next step is to choose a controller. If you are not planing to automate a large portion of your electrical and electronic equipments, you may skip this part all together.

Dependent and Independent

There are two main routes you can take. One is choosing a LAN controller. They are usually independent of any wireless standards like x10 or Z-wave. However, they can be expensive and/or less reliable and hard to setup. The other route is the centralized controllers. I will be explaining the later in detailed because that’s what most tech geeks would use.

Still on the independent units, IP cameras such as D-Link IP Cams and switches like Belkin wemo are great products. They allow average consumer to setup a smart home system without the need for expensive controllers. All IP Cameras from D-Link, TrendNET and other manufactures have very easy and simple setup. Just follow the instructions and you will be ready to go with your WLAN or Wifi based cam. Often these companies also provide DNS (Domain Name Server) services free of charge to their customers. These DNS services will allow you to access your unit(s) from anywhere in the world. I personally found the D-Link products to be the most intuitive to average consumers (plug-n-play). Note these units actually do not have a “brain” aka a main controller.

In addition there are, what I call “independent but dependent” units. They provide simple services such as sending an email if the smoke alarm goes off with almost no other control what so ever. If all you need is that, then check out the products from SkylinkHome.

Centralized Controllers


Some controllers can support all standards; INSTEON, Z-wave, UPB and X10. However, these units are often expensive. I found the Z-wave controller which also can handle INSTEON and X10 via a plug-in called VeraLite to be the best option for consumers. You don’t have to pay a lot since the unit sells for about $200 CAD. It is a stand along box. I would not recommended in-wall units like Evolve LCD Wall Mount for novice users.

Of course there are other options with multiple standards support. Homeseer Hometroller SE Pro supports ZWave, UPB, Insteon and X10. But the cost is about $750 CAD. If you have money to burn, I can safely say it is a very good unit. The software architecture of the unit is based on Windows XP. An added bonus for avid Windows-loving programmers.

MiCasa Vera3

This is the particular unit I use. They have two options; the Regular and the Lite. For home or small business use (even if you are a programmer), I would go with the Lite version. The only major differences I noticed between the two models is the number of devices they can control (200 units vs 50) and the built in stand along wifi system in the regular version. Personally I prefer independent wifi network. This will avoid fallout from a catastrophic network failures.

Planing a house-wide automation system

Once you have the necessary basic infrastructure listed on my first post on automation here, the next step is the planing. This is very important because depend on what equipments you choose and how you physically and electronically integrate them to one another will effect the reliability and future expandability of your system.

The following list of questions will help you decide what actions you should take. These are some of the exact questions I asked myself for my automation project.

  1. Am I (are we) going to live in this particular house for the next 5+ years?
    If yes, spend more time on extensive planing and go to question 3. If not go to question 2.
  2. Will this project add value to the resell of the house? Is this area is known for high end housing market?
  3. What is the budget over a month, a year and few years for maintenance and expansion?
  4. Which controller and components should I pick based on answers to above questions?
    If you are planing to live in this particular house for a long period, please pick the best or at least intermediate level system (or there is a market for automated houses in your area, if you are planing to sell the house). If you are doing this as a “fun” project and/or you are planing to sell the house with no added value due to automation, then go for a cheaper equipments.
  5. How many equipment am I (we are) planing to integrate into the controller and what standards (Z-wave, x10… more) will we be using?
    Some high end (expensive) controllers support multiple standards. However, I support independent controllers for each system. I will explain why soon (at the end of this article).
  6. How much flexibility do I (we) want? Do I need a controller that would accept custom scripts and firmware (geek alert!)?
    Some controllers may not comes with free control over the Internet. Some controllers will allow custom scripts (not recommended for novice non-tech people) for wide range of activities. Usually the controllers that allow custom scripts are expensive. If you are a home owner with limited knowledge in computing, I would recommended something simple like Micasa Vera controllers.
  7. Where should I place the “brains” of the system?
    I recommend using a centralized location in which you have access to both the network equipments and the automation equipments. I will be placing all the controllers for automation with my servers. At the main location, it is utmost important that you have flexibility in electrical outlets, number of LAN connections and other peripheral support infrastructure. Note that most systems are wireless so you can place them anywhere in the house with a mid to strong wifi signal.
  8. What components do I need and where would I place them?
    There are limitless possibilities thanks to standardizations like Z-wave. Multiple manufactures have come up with many different equipments from lighting receptacles to security systems. In order to go truly hose-wide, I would start organization the automation based on your house plan.
    Example of a basic house plan. Note the automated cameras and thermostat locations.
    Example of a basic house plan. Note the automated cameras and thermostat locations.

Addition to the centralized systems with a very powerful controllers, you could also go with general purpose consumer grade products like Belkin wemo devices. In fact, I think it is better to have multiple independent systems because this will increase the reliability. If the controller goes out in a advanced system, everything connected to it will be out of service as opposed to having independent systems.

I will be introducing you to the Belkin wemo products and Vera Smart Home Controller, Vera Lite in my next two post. Stay tuned!