Friday, September 28, 2012

How to avoid estimated bill from TNB


Kindly to inform you, TNB introduced a Self Meter Reading (SMR) Programme for consumer who getting estimated bills frequently.
Self Meter Reading is a way whereby customer is allowed to read his/her own electricity meter and customers who receive estimated electricity bills frequently or disagree with estimated meter readings. This option is open for domestic Ordinary Power Customers (OPC) to read the meter for three (3) consecutive months only andFor the consequent fourth month, the meter reading shall be conducted by TNB and this cycle continues.
Benefits:
1. For customers frequently not available in the house for meter reading by TNB.
2. Customers will get the actual reading every month.
3. Able to manage own monthly consumption.
How to apply:
Fill up the Application Form , which is also available at the nearest TNB Customer Service Centre; with a copy of Identification Card.
Submit the completed application to one of the following: 


  • Fax to OSEC at 1300-88-5454
  • Email to tnbsmr@tnb.com.my 
  • TNB Customer Service Centre (where your account is)
  • Notification for Meter Reading.
    TNB will notify the customers via SMS 15454 or email. Customers need to submit the reading within 3 days after notification from TNB.
    For more enquiries , can call 1300-88-5454.

    Monday, September 24, 2012

    Android busybox install



    $ wget http://www.busybox.net/downloads/binaries/latest/busybox-armv6l
    --2012-09-24 14:02:42--  http://www.busybox.net/downloads/binaries/latest/busybox-armv6l
    Resolving www.busybox.net (www.busybox.net)... 140.211.167.224
    Connecting to www.busybox.net (www.busybox.net)|140.211.167.224|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 1085140 (1.0M) [text/plain]
    Saving to: `busybox-armv6l'

    100%[=========================================================================================================================>] 1,085,140    447K/s   in 2.4s  

    2012-09-24 14:02:46 (447 KB/s) - `busybox-armv6l' saved [1085140/1085140]


    $ adb push busybox-armv6l /data/local/busybox
    7761 KB/s (1085140 bytes in 0.136s)
    $ adb shell
    $ su
    cd # cd /data/local/
    # chmod 755 busybox
    # ./busybox
    BusyBox v1.19.0 (2011-08-14 23:46:58 CDT) multi-call binary.
    Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko
    and others. Licensed under GPLv2.
    See source distribution for full notice.

    Usage: busybox [function] [arguments]...
       or: busybox --list[-full]
       or: function [arguments]...

    BusyBox is a multi-call binary that combines many common Unix
    utilities into a single executable.  Most people will create a
    link to busybox for each function they wish to use and BusyBox
    will act like whatever it was invoked as.

    Currently defined functions:
    [, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash,
    awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl,
    bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod,
    chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm,
    cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
    deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff,
    dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap,
    dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake,
    expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat,
    fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk,
    fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty,
    grep, groups, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid,
    hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave,
    ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip,
    ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel,
    kbd_mode, kill, killall, killall5, klogd, last, less, linux32, linux64,
    linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread,
    losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma,
    lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom,
    mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat,
    mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount,
    mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice,
    nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof,
    ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir,
    poweroff, powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx,
    raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath,
    reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir,
    rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv,
    runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch,
    setconsole, setfont, setkeycodes, setlogcons, setserial, setsid,
    setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep,
    smemcap, softlimit, sort, split, start-stop-daemon, stat, strings,
    stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync,
    sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test,
    tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6,
    true, tty, ttysize, tunctl, ubiattach, ubidetach, ubimkvol, ubirmvol,
    ubirsvol, ubiupdatevol, udhcpc, udhcpd, udpsvd, umount, uname,
    unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, users,
    usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch,
    watchdog, wc, wget, which, who, whoami, whois, xargs, xz, xzcat, yes,
    zcat, zcip

    # mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system
    # mkdir /system/xbin
    mkdir failed for /system/xbin, File exists
    # /data/local/busybox cp /data/local/busybox /system/xbin
    # /data/local/busybox cp /data/local/busybox /system/bin
    # cd /system/xbin
    # busybox --install .
    # mount -o ro,remount -t yaffs2 /dev/block/mtdblock4 /system
    # sync
    # reboot

    Downgrade Nexus S from 4.0 to 2.3

    Android 4.1 might too heavy for Nexus S hardware, below is howto downgrade the rom to ver 2.3.

    Please note that all data on the phone will erase....

    1. Download the image from google site.

    2. Extract the file....

    $cd /tmp/

    $ tar -zxvf soju-grk39f-factory-5ab09c98.tgz
    soju-grk39f/
    soju-grk39f/bootloader-crespo-i9020xxka3.img
    soju-grk39f/flash-base.sh
    soju-grk39f/image-soju-grk39f.zip
    soju-grk39f/radio-crespo-i9020xxkf1.img
    soju-grk39f/flash-all.sh

    3. Switch off  the phone, holding the vol up & power button at the same time until you see the bootloader screen.

    4. Assume you have android-sdk installed, if not please refer to http://developer.android.com/sdk/installing/index.html for installation.

    $cd soju-grk39f

    $ ./flash-all.sh 
    sending 'bootloader' (1536 KB)...
    OKAY [  0.226s]
    writing 'bootloader'...
    OKAY [  0.344s]
    finished. total time: 0.570s
    rebooting into bootloader...
    OKAY [  0.001s]
    finished. total time: 0.001s
    sending 'radio' (12288 KB)...
    OKAY [  1.803s]
    writing 'radio'...
    OKAY [  1.680s]
    finished. total time: 3.483s
    rebooting into bootloader...
    OKAY [  0.001s]
    finished. total time: 0.001s
    archive does not contain 'boot.sig'
    archive does not contain 'recovery.sig'
    archive does not contain 'system.sig'
    --------------------------------------------
    Bootloader Version...: I9020XXKA3
    Baseband Version.....: I9020XXKF1
    Serial Number........: 363003C175D100EC
    --------------------------------------------
    checking product...
    OKAY [  0.001s]
    checking version-bootloader...
    OKAY [  0.001s]
    checking version-baseband...
    OKAY [  0.001s]
    sending 'boot' (2936 KB)...
    OKAY [  0.417s]
    writing 'boot'...
    OKAY [  0.383s]
    sending 'recovery' (3176 KB)...
    OKAY [  0.459s]
    writing 'recovery'...
    OKAY [  0.411s]
    sending 'system' (188235 KB)...
    OKAY [ 27.062s]
    writing 'system'...
    OKAY [ 23.307s]
    erasing 'userdata'...
    OKAY [  0.203s]
    formatting 'userdata' partition...
    Erase successful, but not automatically formatting.
    Can't determine partition type.
    OKAY [  0.001s]
    erasing 'cache'...
    OKAY [  2.017s]
    formatting 'cache' partition...
    Erase successful, but not automatically formatting.
    Can't determine partition type.
    OKAY [  0.001s]
    rebooting...

    finished. total time: 54.268s



    DONE....

    Saturday, September 22, 2012

    Root Nexus S

    1. Switch off the phone.

    2. Holding the POWER & VOL UP button until you see the bootloader screen.

    3. Install USB driver, follow the instruction on 'Installing SDK'.

    4. Download files

    $ wget http://www.androidmi.com/uploadfile/2010/1217/20101217063436958.zip
    $ wget http://www.androidmi.com/uploadfile/2010/1217/20101217063339991.rar
    $ wget http://www.androidmi.com/uploadfile/2010/1217/20101217063614166.rar

    5. Unzip all downloaded files.


    drwxrwxr-x  5 user user    4096 Sep 22 17:13 ./
    drwxrwxrwt 22 root root    4096 Sep 22 16:59 ../
    drwxrwxr-x  2 user user    4096 Sep 22 17:05 app/
    drwxrwxr-x  2 user user    4096 Sep 22 17:05 bin/
    drwxrwxr-x  3 user user    4096 Sep 22 17:05 META-INF/
    -rw-rw-r--  1 user user 4087808 Sep 22 16:39 recovery-clockwork-herring.img
    -rw-rw-r--  1 user user 2949120 Dec 17  2010 rootboot.img


    6. $ fastboot flash recovery recovery-clockwork-herring.img
    sending 'recovery' (3992 KB)...
    OKAY [  0.590s]
    writing 'recovery'...
    OKAY [  0.507s]
    finished. total time: 1.098s


    7. Flash the rooted boot image.
    $ fastboot flash boot rootboot.img 
    sending 'boot' (2880 KB)...
    OKAY [  0.426s]
    writing 'boot'...
    OKAY [  0.377s]
    finished. total time: 0.802s

    8. Install su & SuperUser.apk

    $ adb remount
    remount succeeded
    $ adb push bin/su /system/bin/
    638 KB/s (26248 bytes in 0.040s)
    $ adb push app/Superuser.apk /system/app/
    678 KB/s (27688 bytes in 0.039s)
    $ adb shell chmod 6755 /system/bin/su
    $ adb reboot

    9. Enter recovery mode again,install the superroot.apk




    Update for TWRP recovery 



    Follow step 1~3 above.

    4. $fastboot flash recovery twrp-crespo-2.0.0RC0.img

    5. Reboot to recovery boot

    6. Mount sdcard, copy SuperUser.zip and unmount.

    7. Back to main menu, INSTALL > select SuperUser.zip and install, after install reboot the phone.








    Adding VHost to apache2 (Ubuntu 12.04)

    Following steps is not include installation of apache2.

    1. Create vhost dir.
    sudo mkdir /etc/var/www/example.com/public_html


    2. I use for development, so I map the localhost IP to example.com, if you using internet IP, go to next step.

    sudo nano /etc/hosts

    #add line
    127.0.0.1 example.com


    3. Grant permissions to 'www/example.com/public_html'

    sudo chown www-data:www-data /var/www/example.com/public_html -R

    sudo chmod 755 -R /var/www/example.com


    4. Creating Vhost file.

    cd /etc/apache2/sites-available
    cat default > example.com
    nano example.com


    #add line after ' ServerAdmin webmaster@localhost'
    ServerName    example.com
    DocumentRoot   /var/www/example.com/public_html

    #correct the <Directory> tag with correct attribute.
     <Directory /var/www/example.com/public_html/>


    5. Enable the site.

    a2ensite example.com
    services apache reload


    6. Test the site by browser the example.com.




    Thursday, September 20, 2012

    VPN on OpenWRT

    OpenWrt is Linux based router, where you can manage it through GUI / CLI, below I will show how to setup PPTP VPN server on OpenWrt with CLI.

    1. Login to router with putty (win) or ssh client, install pptpd :


    opkg update

    opkg install kmod-mppe
    opkg install pptpd


    2. Configure pptpd.



    vi /etc/pptpd.conf
    option /etc/ppp/options.pptpd 
    stimeout 10
    localip 10.0.0.1    #this is VPN IP
    remoteip 10.0.0.2-254 # this is client IP range


    vi /etc/ppp/options.pptpd


    logfile /tmp/pptp-server.log

    auth

    name "pptp-server"
    lcp-echo-failure 3
    lcp-echo-interval 60
    default-asyncmap
    mtu 1482
    mru 1482
    nobsdcomp
    nodeflate
    noproxyarp
    #nomppc
    mppe required,no40,no56,stateless
    require-mschap-v2
    refuse-chap
    refuse-mschap
    refuse-eap
    refuse-pap
    ms-dns 8.8.8.8 #google dns server 


    3. Add client to PPTP.



    vi /etc/ppp/chap-secrets
    #USERNAMNAME PROVIDER PASSWORD IPADDRESS
    username * password *


    4. Start pptpd , remember allow port 1723, 47 for pptp protocol.


    /etc/init.d/pptpd enable && /etc/init.d/pptpd restart



    5. Install & Configure PPTP client, demo below I using Ubuntu OS.


    apt-get install pptp-linux


    vi /etc/ppp/peer/pptpd




    pty "pptp pptp-domain.com --nolaunchpppd"
    name user
    remotename pptpd 
    require-mppe-128
    file /etc/ppp/options.pptp
    ipparam pptpd



    6. Adding account info.

    vi /etc/ppp/chap-secrets

    #USERNAMNAME PROVIDER PASSWORD IPADDRESS
    username * password *


    7. Config the routing path

    # nano /etc/ppp/ip-up.d/pptpd
    #!/bin/sh 
    if [ "${PPP_IPPARAM}" = "pptpd" ]; then
       /sbin/route add -net 192.168.10.0/24 dev ${IFNAME}
    fi


    8. Connection test


    pon pptpd 


    verify the connection with ifconfig, should able to view adapter ppp0.


    route add -net 192.168.1.0 netmask 255.255.255.0 dev ppp0




    Installing Ubuntu 12.04 to Toshiba Z930

    Just got my new Ultrabook from shop, Toshiba Z930 come with :


    • i5-3317U
    • 6GB DDR3 
    • 128 GB SSD
    • 13.3" LCD with IntelHD Graphic


    This laptop planed to use as working purpose, so will swipe off the window partition and replace with Ubuntu 12.04 LTS. I'm going to show how to backup the pre-load window and Install a fresh Ubuntu as below.

    Window license is not cheap, so we backup it in-case we need it in future time. To backup the hold partition by cmd below with Ubuntu livecd (usb).

        dd if=/dev/sda |gzip -9 | of=/media/usbdisk/sda.img.gz

    'media/usbdisk' is path for USB drive, next is launched the installer.


    .
    1. SELECT LANGUAGE


    2. LEAVE EVERYTHING UNCHECK & CONTINUE


    3. ERASE THE DISK AND INSTALL

    4. SELECT LOCATION


    5. LEAVE IT DEFAULT & CONTINUE


    6. ACCOUNT, IF YOU HAVE SENSITIVE DATA, CHECK THE 'ENCRYPT MY HOME FOLDER


    7. BOIL WATER & COFFEE 


    8. RESTART


    After installation, some tweaking need to done, follow the instructions from gaggl.com.

    What is not working :

    1. Touchpad on/off button
    2. Eco mode button
    3. Fingerprint sensor (did re-compile aes1610 driver with 1660 device id but not compatible, hopefully vendor add the driver for aes1660 soon)







    [img src] http://www.vxbus.com/software/linux/143-how-to-install-ubuntu-1204-from-usb-drive.html


    Tuesday, September 4, 2012

    Android NDK assert.h problems

    Usually program will crash due to SIGSEGV signal after assert() is called, by default NDEBUG is define, you may turn off by add the flag (LOCAL_CFLAGS += -UNDEBUG) during compilation but not work for my case.

    I found another solution is using __android_log_assert, simply define as below & replace assert() with assert3.

    #define assert3(e) ((e) ? (void)0 : __android_log_assert(0,TAGS,"%s(%s:%d) >> %s ",__func__ ,__FILE__, __LINE__, #e))