Blog

  • How to Fix WARNING: Creating default object from empty value

    You may encounter this “warning” message when using PHP 5.4 or above

    E_WARNING: Creating default object from empty value

    Here is how to fix this 🙂
    (more…)

  • How to Change SSH Port with WHM & CSF

    If you are using WHM & CSF, under CentOS, you may follow this steps to change SSH port from 22 (default) to something else 🙂
    (more…)

  • How to Install ConfigServer Security & Firewall (CSF) in WHM

    To install ConfigServer Security & Firewall (CSF) in WHM, please run this commands in your SSH terminal one by one.

    wget https://download.configserver.com/csf.tgz
    tar -xzf csf.tgz
    cd csf
    sh install.sh

    After it completes, there is a new menu in WHM which is under “Plugins” category, named “ConfigServer Security & Firewall”. 🙂

  • How to Install Litespeed in WHM

    Here i will explain how to install Litespeed webserver in WHM.
    According to the Litespeed wiki :

    1. Open & login to your SSH terminal
    2. Execute this command to download the installer :
      wget http://www.litespeedtech.com/packages/cpanel/lsws_whm_autoinstaller.sh
    3. Next we will make the file executable :
      chmod a+x lsws_whm_autoinstaller.sh
    4. Last step we can execute this command :
      (please check the litespeed wiki for parameter explanation)

      ./lsws_whm_autoinstaller.sh TRIAL 2 1000 admin a1234567 root@localhost 1 0

      If you have litespeed license, replace “TRIAL” with your serial number.
      You can replace “admin” with another litespeed admin username.
      You can replace “a1234567 ” with another litespeed admin password.
      You can replace “root@localhost” with another litespeed admin e-mail.

    5. Wait until it completes.
    6. A new sub menu named “Litespeed Web Server” will appear on your WHM.
    7. You must activate litespeed from that sub menu.

    (more…)

  • Exporting MySQL Databases Command Line in Linux

    To export a mysql database by linux command line,
    for example your database name is my_database, your mysql username is my_username, and your mysql password is my_password, you can use this command :

    mysqldump --opt --single-transaction -umy_username -pmy_password my_database > /your/path/here/export.sql

    Note: after “-u” and “-p”, there is NO space. 🙂

  • CSS Media Query

    Here is a simple example of CSS media query 🙂

    http://pastebin.com/dkdfAvGF

  • Change WooCommerce Items Per Page

    To change displayed WooCommerce Items Per Page, add this code to any PHP file (end of “woocommerce.php” / your theme functions.php, etc)

    // Woo commerce 9 items per page
    add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 9;' ), 20 );
    
  • Transferring Scrapebox License

    I bought a new notebook few weeks ago. Now i have just remembered that i have to use scrapebox on my new notebook. So i went to google for a while and i found this link http://www.scrapebox.com/scrapebox-license-transfer.
    That page describes everything clearly. And it is free.
    All i have to do is redownload the scrapebox, i opened the scrapebox application, clicked “Activate”, i entered my license details there, and i waited for 10-15 minutes, and finally i got e-mail notification that my new license is ready. Thanks Scrapebox for making license transfer simple 🙂

  • Best Free iPad Games

    I will give review of best free iPad games. All are installed on my iPad.

    1. Angry Birds collection. Phenomenal games. You should try at least once 🙂
    2. Angry Gran. It is a scrolling game, you will control a grandma and you should hit pedestrians to get money. You can use your money to buy stats upgrade / new weapons.
    3. AoD HD. Scrolling game. Very fun game. You control a character that fight against darkness army. You can buy and upgrade your soldiers. There are lot of soldiers here including peasant, swordsman, spearman, archer, horseman, etc.
    4. 4. Creeps HD. Free, fun, and challenging tower defense game. There are lot of levels available. If i remember correctly there are more than 30 levels.
    5. Critter Quitter. Use your finger to crush insects. Fun initially, but could be boring later.
    6. Cut the Rope. Use your finger to slide the rope. A kind of puzzle game.
    7. Jetpack. Scrolling game. You control a man using jetpack on a corridor. Avoid laser and missiles. Touch the screen to move him up. You can buy jetpack upgrades with gold.
    8. Pet Shop. Addicting game. You can build pet shop, breeding your pet, combining 2 species (only available on some species), etc. Internet connection is required.
    9. Zombie. Another addicting game. Build your zombie army. I always play it regularly. Internet connection is required.
    10. Water? Free. Addicting game initially.

    (more…)

  • PHP HtmlEntities for UTF-8 Characters

    If you just use simple PHP htmlentities function with one argument, you will notice that when you pass string that contains UTF-8 characters, the result is incorrect leaving you with some incorrect characters on the result.

    To use it correctly, use this code 🙂

    htmlentities($your_string, ENT_COMPAT, 'UTF-8');