A Hu Qiang Blog

I am Qiang, I am strong.

Exploited Safari Reading List by Advertisers

Safari’s Reading List is really a nice feature and I have been frequently using it to quickly pin webpages and read across Apple devices.

It is so annoying when I find there is some links to webpages I would never be interested in my Reading List, e.g. links to stupid online flash games. I know it must be online advertisers by I really don’t know how they do so. I thought there would be some APIs to Reading List, but I could not find one. After carefully digging the code of the site that adds links to my Reading List, I finally found out the trick.

Xiaomi Singapore Is Facing Payment Issues (Updated)

At 1200pm Singapore time, March 27 2014, Xiaomi started a new round sell of its Redmi Phone. According to its statement, 5000 sets were sold out in 4 min 42 sec. Very soon after paying via PayPal, happy customers found xiaomi is still waiting for payment on their website.

PHP Apache MySQL Set-up Note

  • Apache is pre-installed in Mac OS X, and it can be started by running sudo apachectl start in terminal. After this,

    It works!

    is shown when visiting localhost in browser. Create a Sites folder in your home folder, then this folder is accessible through localhost/~yourusername.
  • Enable PHP by uncommenting LoadModule php5_module libexec/apache2/libphp5.so in /etc/apache2/httpd.conf. Then restart Apache via sudo apachectl restart. To verify if php works, creating a phpinfo.php in the Sites folder:
php phpinfo.php

Solve SMTP Offline on Mac OS X Mail

Recent days, I have problems sending out email in Mail App, on Mac OS X Mountain Lion. Little invistigation shows that the accounts information for SMTP server are messed, wrong accounts are used for different servers. The solution is simple and straightforward:

  1. In Mail, open Preferences;
  2. In Accounts tap, select the account whose Outgoing Mail Server(SMTP) is labeled as offline;
  3. Click the SMTP server, and select Edit SMTP Server List from the list;
  4. Then you need to fill in the correct username and password.

Mount Entire DD Image

This is a linux logoYesterday, my Raspberry Pi running Arch Linux was not able to boot with error: Kernel Panic, not syncing: no init found. I spent a night on it, but could not find a working solution. The last option is easy: reinstall the system. That is really the last resort, for I do not want to re-setup everything I have done: samba server, Time Machine server, Xunlei Offline Downloader…

Unable to mount the SD card

The system does not boot, so I need to find a way to get into the file system to identify what is wrong, or at least backup all the configuration files.

My Printer Friendly CSS(updated)

I do want my webpages printed out nicely, especially my Resume, which should not contain the unnecessary elements, e.g. site title, side bar, comments… According to w3schools.com, CSS Media Type can help me achieve the goal by providing different sets of CSS for various outputs. Below is the CSS I have written, you can copy and save it if you want.

Fix Invalid URL to Google Calendar in Mountain Lion

If you are much annoyed, I believe you are if you landed this page by Googling, by tenths or even hundreds error messages in Console of 28/5/13 10:25:41.004 PM CalendarAgent[169]: AOSKit ERROR: (-) RAF: Invalid url -- https:[email protected]/calendar/dav/USERNAME%40gmail.com/ you might take a minute to read this post.

The Cause: Apple is the one to blame

When we use System Preferences –> Mail, Contacts & Calendars to add our google accounts, and enable Calendar & Reminders Apple sets the CalDAV url to https:[email protected]/calendar/dav/USERNAME%40gmail.com/, but what Google API accepts is https:[email protected]/calendar/dav/USERNAME%40gmail.com/. That is the reason the Invalid URL error happens.

Octopress SEO: Site Keywords and Description

By default, the keywords and description generated by Octopress for site are those of the first post. However, what I want is to set more suitable keywords and description for my site.

First, we and keywords and descriptions for site in _config.yml:

description:   #put your site description
keywords:     #put the keywords

Life of Pi – Samba Server


Fix the issue of not having writing permission on the mounted exFAT disk: In /etc/fstab add:

/dev/sda1  /media/Media    exfat   rw,async,umask=0 0   0

And then mount the disk:

sudo mount -a

I have a 2T external hard disk that is partioned into:
* 1.5T of exFAT format to store media files
* 0.5T of HFS+ as TimeMachine

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2  2930667377  1465333688    7  HPFS/NTFS/exFAT
/dev/sda2   *  2930667379  3906967727   488150174+  af  HFS / HFS+

What I want to do is to mount the hard disk to my Raspberry Pi running Arch Linux ARM, then it can be used wirelessly as media hub and TimeMachine.

Mount the disk

In order to mount exFAT formatted disks, we have to install fuse-exfat and exfat-utils

sudo pacman -S fuse-exfat exfat-utils

Hello World

Hello erveyone, this is my first post, which is served as my assignment to Markdown.

This is a code snipet:

Discover if a number is primeSource Article
class Fixnum
  def prime?
    ('1' * self) !~ /^1?$|^(11+?)\1+$/

this is italic

Markdown syntax
*this is italic*