Clint Liang's

I share my successful stories and things I learned about life, coding, startup and entrepreneurship

How to Fix Blue Screen and Non Stop Reboot Problem After iOS 8.0.2 Update

I did an update from iOS 8.0.1 to iOS 8.0.2 on my iPhone 5s this morning. After installing the update, my iPhone started constantly rebooting and showing blue screen. It sucks, isn’t it? Luckily I made a backup before the update, so I was able to restore my phone in recovery mode. Here’s what I did to fix the problem.

  1. Hold both home and power buttons, let go of both buttons as soon as the phone turns off (screen goes black).
  2. On your computer, open iTunes. Make sure you have the latest version.
  3. Plug in your iPhone USB cable to your computer. Do NOT plug in your phone yet.
  4. Hold down home button and plug in your iPhone. Continue holding home button until you see the connect to iTunes logo on screen. iTunes on your computer will popup an alert message that an iPhone has been detected in recovery mode.
  5. Select restore and follow the instructions. Do not disconnect your phone until it’s fully restored and updated to iOS 8.0.2

P.S. iTunes complained that it could not find the phone after select restore in step 5. I had to repeat the above step1-5 and finally made it work.

VMWare NAT Problem Fix: How to Set Up Host-only Virtual Network on Ubuntu


I only have one IP address assigned to my server and I have multiple virtual machines hosted on the server. In order to make those virtual machines access the Internet, I set up the VMWare network to be NAT. However, once a while the vmware NAT process runs 100% CPU and crashed the whole syste that I have to restart the machine. Replacing NAT with host-only virtual network is a work-around solution I found.


  1. Virtual server configuration:
    1. Run /usr/bin/, select host-only network instead of NAT

      *note: if the Network Connections can not find any network interface (e.g. eth0), edit /etc/network/interfaces and comment out all except the following:

      auto lo

      iface lo inet loopback

    2. On vmware web interface, change network adapter to host-only.
    3. Turn on virtual server and config its ethernet adapter as following:

      Static IP:
      Primary DNS:
      Secondary DNS:

      *note: the subnetwork are different each time you run Make it to whatever static IP address for iptable NAT rules

  2. Iptables rules

    Chain INPUT (policy ACCEPT)

    target prot opt source destination

    ACCEPT tcp — anywhere anywhere tcp dpt:www

    ACCEPT tcp — anywhere anywhere tcp dpt:ssh

    ACCEPT tcp — anywhere anywhere tcp dpt:2222

    ACCEPT tcp — anywhere anywhere tcp dpt:https

    ACCEPT tcp — anywhere anywhere tcp dpt:8222

    ACCEPT tcp — anywhere anywhere tcp dpt:8333

    ACCEPT tcp — anywhere anywhere tcp dpt:902

    ACCEPT tcp — anywhere anywhere tcp dpt:smtp

    DROP all — anywhere anywhere

    Chain FORWARD (policy ACCEPT)

    target prot opt source destination

    Chain OUTPUT (policy ACCEPT)

    target prot opt source destination

  3. Modify /etc/fstab to the new base virtual adapter IP address.
  4. Modify /etc/samba/smb.conf to recoganize the new virtual adapter vmnet1
  5. To fix SSH login slow problem edit /etc/ssh/sshd_config and add a line “UseDNS no”

How to Set Up Your Own Private Git Server on Ubuntu

This tutorial assumes that you have openssh-server installed on your server so that you can ssh on to it. You should have a local repository on your development machine ready to go.

Set up your sever

1. Install git on your server

sudo apt-get install git-core

2. Create a git ssh user on your server (if you wish to use your own user, jump to step 4)

sudo adduser git

3. Create git ssh user home folder

sudo mkdir /home/git/.ssh
sudo chown -R git:git /home/git/.ssh

4. Add your ssh key

if you wish to use your ssh key, copy your public key {development_machine}:~/.ssh/ to {server}:/home/{GIT_SSH_USER}/.ssh/authorized_keys

5. Create an empty repository on server

mkdir {PATH_TO_REPO}/myrepo.git
cd {PATH_TO_REPO}/myrepo.git
git init –bare

Configure your development machine

cd {YOUR_LOCAL_REPO} git remote add {REPO_NAME} git@{SERVER_NAME_OR_IP}:{PATH_TO_REPO}/myrepo.git
git push {REPO_NAME} master

Add a default merge and remote:

git config branch.master.remote {repo_name} && git config branch.master.merge refs/heads/master


Yii Blog Markdown Syntax Code Block Fix

A couple of days ago, I decided to write something on my blog based on Yii. By using Markdown syntax I was able to format my tutorials. However, the code block in my tutorial could not be displayed properly. If you have the same problem as mine, here’s a solution I figured out.

  1. Make sure you have the latest Yii v1.1.7.
  2. Make sure you insert a new line before your code block.
  3. Instead of using widget with CMarkdown, use CMarkdownParser.

In protected/views/post/_view.php replace the code:

    $this->beginWidget('CMarkdown', array('purifyOutput'=>false));
    echo $data->content;


    $markdownParser = new CMarkdownParser;  
    echo $markdownParser->safeTransform($data->content);

Here’s an example html code block that works for me:


Hope that helps.

How to add weather indicator on Ubuntu 11.04 (Natty Narwhal)

Upgrading from Ubuntu 10.10 to 11.04, I enjoy the new unity launcher and other new features. However, I found one of the useful application indicator-weather is missing. After searching on the Internet, I found the solution and I am a happy Ubuntu user again:) Here’s how:

The weather indicator on Ubuntu 11.04 is not installed by default. You need to install it yourself. Open a terminal and type the following command: >

$ sudo apt-get install indicator-weather

After installing, you want to add it to startup application. Startup Applications>Add>Command: indicator-weather, fill the rest of fields and restart the x server. Enjoy:)

Set Up Trac On Ubuntu

1. Install dependencies:

$ sudo /etc/init.d/apache2 stop
$ sudo apt-get install libapache2-mod-python
$ sudo apt-get install apache2 libapache2-svn
$ sudo apt-get install python-setuptools
$ sudo apt-get install python-pgsql
$ sudo /etc/init.d/apache2 start

2. Create postgres user account “tracuser” and database “trac”

$ sudo su postgres
postgres@mapsys-dev-00: createuser -U postgres -E -P tracuser
postgres@mapsys-dev-00: createdb -U postgres -O tracuser -E UTF8 trac

3. Create trac environment directory (/var/www/trac_projects/mapsys_trac)

$ sudo mkdir /var/www/trac_projects
$ sudo chown -R www-data /var/www/trac_projects
$ sudo mkdir /var/www/trac_projects/mapsys_trac
$ sudo chown -R www-data /var/www/trac_projects/mapsys_trac

4. Install trac

$ sudo apt-get install trac

5. Initialize project with trac-admin

$ cd /var/www/trac_projects
/var/www/trac_projects$ sudo trac-admin mapsys_trac initenv

And then follow the instructions:

Project Name [My Project]> Mapsys
Database connection string [sqlite:db/trac.db]> postgres://tracuser:{password}@localhost/trac
Repository type [svn]>
Path to repository [/path/to/repos]> /repository

6. Change the owner and do a test run with the webuser.

$ sudo chown -R www-data /var/www/trac_projects/mapsys_trac
$ sudo -u www-data tracd –port 8000 /var/www/trac_projects/mapsys_trac

You can test it at: http://localhost:8000

7. Setup Trac to run with apache.

create trac.conf

$ sudo gedit /etc/apache2/sites-available/trac.conf

Configure the following in trac.conf

    <Location /trac> #set up Trac handling

        SetHandler mod_python

        PythonHandler trac.web.modpython_frontend

        PythonOption TracEnvParentDir /var/www/trac_projects

        PythonOption TracUriRoot /trac

        # Use the SVN password file.

        AuthType Basic

        AuthName "Subversion Repository"

        AuthUserFile /etc/apache2/dav_svn.passwd

        Require valid-user  


8. Setup svn password

$ sudo htpasswd -c /etc/apache2/dav_svn.passwd {first-svn-user}
$ sudo htpasswd /etc/apache2/dav_svn.passwd {more-user}
$ sudo /etc/init.d/apache2 restart

9. Install the python module and make the site available

$ sudo apt-get install libapache2-mod-python
$ cd /etc/apache2/sites-enabled
$ sudo ln -s ../sites-available/trac.conf 010-trac
$ sudo /etc/init.d/apache2 restart

10. Modify /etc/apache2/httpd.conf

$ sudo nano /etc/apache2/httpd.conf

Add the following to the end.

    Alias /trac "/var/www/trac_projects/mapsys_trac/htdocs"

    <Location "/cgi-bin/trac.cgi">

        SetEnv TRAC_ENV "/var/www/trac_projects/mapsys_trac"


And then restart apache service

$ sudo /etc/init.d/apache2 restart

Now you can test it at http://localhost/trac

*note the username and password is what you created in step 8


Welcome to My Blog

Welcome to my blog. My name is Clint Liang. I am entrepreneur, software architect and problem solver. This blog is my personal blog, I talk about everything I learned about entrepreneurship, startup, coding, technology and life.