Tuesday, November 22, 2011

google email phone mobile verification contact requirement

Problem
If you want to create a new Google email. They will ask for your mobile phone number.
This is Google security feature to prevent bot

Reason
Once, I read a blog (cant remember URL) about the phone verification only appear because of username you put. They will search for number or any repetitive name. If have, they will ask for phone verification

Solution
Thus the solution you need is simply putting a unique name. This is difficult since most of any name you try might already been taken.

So the solution for the solution is, "Elf name generator". Yes, Elf name is less frequently use in gmail so you will have high chance to get register new email without phone number verification

Here is some list of website that generate Elf name for you (You can find many website by simply searching "elf name generator"). Good luck in creating your new email... legolas
  1. http://elf.namegeneratorfun.com/
  2. http://online-generator.com/name-generator/elf-name-generator.php
  3. http://chriswetherell.com/elf/index.php
I do not responsible for broken link, these link are search through google on Nov 2011

That is all, your sincerely
Eärendur Fëfalas

make a troll website

I was so boring and got nothing productive to do, and so I made some "art of trolling" stuffs.
Thus, I teach you how to make a trolling Google blogspot

Example?
You can see the example here, it is my testing website anyway http://legendarytesting.blogspot.com/

Usage
In blog you can post a comment. If you put a trolling comment, people will start to look into your detail such as your blog or and website URL you put. So this is how you use it!

How to create?
Simply create a new identity for 'trolling' purpose (recommended)
  1. Create a new Google email (If you having a difficulties creating a new Google email, please refer here)
  2. Create new blogspot from the Google email
  3. Make a new post and put the code below
<div style="position: fixed; z-index: 999; overflow: hidden; top: 0px; left: 0px; width: 100%; height: 100%; background-color: white;">
    <table style="width: 100%; height: 100%;" border="0">
        <tr>
            <td>
                <div align="center">
                    <img style="border: none; box-shadow: none" alt="" src="https://lh6.googleusercontent.com/-Wh8XavCkBFw/TsIzG2dQ4VI/AAAAAAAAAjY/vnuHaKPgaps/s800/trollface.jpg"/>
                </div>
                <div align="center">
                    <h2 style="letter-spacing: 3px; font-size: 20px; color: black; font-family: 'Times New Roman', Courier, Garamond, serif;">Problem?</h2>
                </div>
            </td>
        </tr>
    </table>
</div>

Thursday, October 27, 2011

Netbean chinese character problem

Probably happen in my pc (Window XP Home)
Create a new .php file, then when I paste the chinese character it show all right

Problem rises when the display (like export into PDF)
This is because the character encoding for the netbeans (NetBeans IDE 6.9.1) is not UTF-8

So simply fix this problem by changing the file type. As for me, I'm using notepad2 to change to file type into UTF-8. Below is the example


http://localhost/search/

Limit download speed Free download manager

If you live in a "shared internet" environment and you don't want to be selfish by hogging all the bandwidth for download you can always cap the bandwidth

If you are using Torrent, be default they allow you to do so

But if you want to use normal download, you have to use download manager
Here I would recommend FDM; Free Download Manager

Download link here : http://www.freedownloadmanager.org/

They have a feature for limit the bandwidth but you have to set the speed manually
Basically I set

  1. Light mode = 20kBps max
  2. Medium mode = 50 kBps max
  3. Heavy mode = No limit


In Malaysia (normally or at least in my case)
20kBps download speed means you can play online game without lag or delay
50kbps download speed means you will lag in game, while okay for surfing website

Monday, October 24, 2011

Get element style in string

You have an element. You want to get the style applied into it. Where the format is string

eg: <a id="hupla1" style="width: 300px;">HELLO</a>

So you want to get "width: 300px;"

I refer from here http://objjob.phrogz.net/css/object/243 maybe you can find better solution and any alternative.

But my solution is document.getElementById('hupla1').style.cssText

Wednesday, October 19, 2011

Using mogrify

Is a tool (using ubuntu) to manipulate image in a batch. For an example is resize the image

Frequent command that I always use
mogrify -resize 800x600 -format jpg * MYIMAGE/*/*/*

This is to resize a folder whith a subfolder (it has 2 subfolder)

Tuesday, September 6, 2011

cakephp check database configuration exist and connection alive valid

Keyword
Check cakephp database configuration exist
Check cakephp database can be connect

In cakephp you need to configure the connection
The configuration file was in app/config/database.php

Inside the file, you can see 2 variable which is 'default' and 'test'

By default is 'default' but if you want to use 'test' in the controller for example, you need to call it like this
$this->Mmodel->useDbConfig = 'test';
 

Problem arise is, can we connect to 'test' without problem?

So, here is the code I made. Been googling it and quite hard to found the solution, thus I'm putting this in my blog. lol...

This code will check
- Does the configuration 'test' exist
- If the configuration exist, does the database connection valid

If these 2 condition is pass, you can only have SQL Syntax Error like selecting table that does not exist

So here is the code (its free)
//Checking is done by connecting with the  database
if (class_exists('DATABASE_CONFIG')){
    $dbConfigName1 = 'test'; //<-- PUT YOUR DATABASE CONFIG VARIABLE NAME HERE

    $dbConfig1 = new DATABASE_CONFIG();
    //pr( $dbConfig1);                    

    if( isset( $dbConfig1->$dbConfigName1)){                       

        //Now check wether the database configuration, its alive!
        //pr( $dbConfig1->$dbConfigName1);
        $dbTemp1 =& ConnectionManager::getDataSource($dbConfigName1);

        if( $dbTemp1->isConnected() == true){

            //Means database exist and you can use it
            echo "DATABASE CONFIG '$dbConfigName1' EXIST AND MANAGE TO CONNECT";
        }
        else{

            //Database configuration exist, but cannot connect to the database
            echo "DATABASE CONFIG '$dbConfigName1' EXIST BUT FAILED TO CONNECT";
        }
    }
    else{

        //The database configuration does not exist
        echo "HAS NO DATABASE CONFIGURATION WITH NAME '$dbConfigName1'";
    }
}
else{

    //The database.php file not even exist. How can this be? IMPOSIBIEBERBEL!
    echo "CANNOT FIND THE 'database.php' CONFIGURATION FILE";
}

Reference
http://bakery.cakephp.org/articles/T0aD/2009/07/08/handle-database-connection-errors
http://debuggable.com/posts/handling-database-connection-errors-in-cakephp:480f4dd5-9570-421a-a04d-43cdcbdd56cb