Showing posts from 2016

Common Apache PHP .htaccess Security Header Updates as of 2016-11-08

These are common .htaccess security header that should be applied to almost all websites.

This is useful for Apache/PHP combination.

Add the following in your .htaccess file:

<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=3600; includeSubdomains;"
Header set X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"

        # You can modify the following to allow external (e.g. CDN) javascript
Header set X-Content-Security-Policy "allow 'self';"

        # You can replace "PHP" with "-" to completely hide your PHP version
Header set X-Powered-By "PHP"

Hope it helps someone.

Jay Abraham The Ultimate Entrepreneur Show 69 Drew Kaplan Part 1 - My take

17:00 - Think lateral: The formula:
Think 10 random words (music, phone, font, key etc...)Use the name of your productWrite a sentence that combine 1 word an your product name e.g.
My product: How to make money ebook My words list with product name combined: Music - Make money like playing world-class musicPhone - Make money just like taking a phone callKey - Secret key to success in make money onlineFlying - Make money as free as flying in the sky Look at side way - coming up with 6 - 8 ideas



How to fix "Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress"

- Check your cookie content in developer tool (Chrome) or Firebug (FF), see if your "cookie" is "httponly".

- If yes, somewhere in your Apache config set this:

Header set Set-Cookie HttpOnly;Secure

Comment this (Don't run this line) and restart your server.

Why it occurs?
I encountered the line below when I login to WP 4.5.3:

Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress
The problem:  your setcookie() statement in wp-login.php cannot produce a cookie WP needs, even if the function returns "true".  As below (Click to enlarge):

If your developer tool shows that, it means that your web server is securely don't allow cookie to be transferred with the web protocal, result in PHP not able to create the cookie WP wants.

Now if it is your situation, you just need to disable this function in your web server, and it should be fine (at least it works for me).

Or you can change it in .htaccess also.  I h…

How to fix fancy box/Easy Fancybox scroll not work in mobile


The Problem:
If you are working on EasyFancybox or just normal fancybox JS, and you have this problem:

In your iOS device when a popup is opened, if the page is too wide and your pop up cannot show all, when user taps and drag the screen, the background will be dragged instead of the pop-up content.

To fix, add this in your CSS:

-webkit-overflow-scrolling: touch !important;

So which element should you apply it to?
In Easy Fancybox, you will see these 2 lines:

<div id="fancybox-content"........>
        <iframe id="fancybox-frame" name...............

Apply to fancybox-content, not fancybox-frame

So in your CSS, it should be:

        overflow: scroll !important;
        -webkit-overflow-scrolling: touch !important;

It works for me, and I hope it helps someone also.

Mike Koenigs/Jordan Belfort Interview 16 Jun 2016


5 steps to create your own book:

Preparation: Interviewing other expert or become an expert.  Is there a market that you want to write?Does the audience has money?Did people passionate about the topic?Come up 10 key questions to ask yourself or other expertsPerform: Title, Subtitle, what is it about, what is the content gonna beAsk what is the most frequent questions you are getting asked about ____?Answer that question, record your response = chapter10 questions > 10 chapterspublishpromoteprofit

[Solved] jQuery: JSONP and JSON: Uncaught SyntaxError: Unexpected token :

This link is, by far, the clearest explanation on JSONP and JSON.

Hope it helps someone.

[Updated]How to save/download streaming asf/wmv file using VLC 2.2.1

If you have some old wmv/asf windows media player file, here is how:

I am using Windows 7 and VLC 2.2.1

1. Select "Open Network Stream

2. Paste the URL in "1", and in the drop down on the bottom, select "Stream".

3. You will see the screen below, by default you will see the source file you just paste, click "Next".

4. In the drop down list, select "File" (the first item), and then click "Add"

5. Enter the destination file path (including the file name) in "Filename"

6. Accept default setting, unless you want to convert it to another format.  If that is the case, select another profile from the drop down list.

7. Click "Stream all elementary streams", then click "Stream"

8. The streaming will then start, the player time line will be used as "Process".  Once it is done, you will see your file (in this case MP4) in the file path you specified.

9. Use your VLC player to play that new file and se…

[Solved] EventBuilder Theme google map api missing m1.png, m2.png error

If you are using ThemesDojo theme "Event Builder" and encounter the following error: - 404 Not found.

Here is the reason and solution, and below is my implementation to the theme "EventBuilder":

Upload the missing image files
First, download the from the link above.  Unzip and upload it to your theme.

In my case, I uploaded it to /wp-content/themes/EventBuilder/images/cluster/m1.png (and so on).

Modify the javascript
- Open /wp-content/themes/EventBuilder/partials/part-sliders.php
- Find this line:

var markerCluster = new MarkerClusterer(map, markers, { maxZoom: 9 });

Replace it to the following:

var mcClusterIconFolder = "/wp-content/themes/EventBuilder/images/cluster";
var mcOptions = {
maxZoom: 9,
styles: [
height: 53,
url: mcClusterIconFolder + "/m1.png",
width: 53
height: 56,
url: mcClusterIconFol…


先稍稍煎魚(毋須煎熟),再落水煲煲魚湯至白色,撈起魚(隔骨)切紅蘿蔔,薯仔,蕃茄落煲慢火將材料煲至冧(應該很快)煲好落鹽,先試味再調整 紫菜,大豆芽,瘦肉,落鹽調味



2人份量 蕃茄5個 (平均1人2-3個)不要頂,去核,開4邊,蕃茄切粒開鑊炒蕃茄至冧把蕃茄倒入煲再加一湯碗半水,加半飯碗蝦米再以中火煲其間處理豬肉碎:2匙豉油,少少油,1羹鷹栗粉/豆粉,1/3匙鹽,2匙糖拌勻此時蕃茄見開始冧就落生豬肉然後滾至豬肉熟落半湯羹魚露落小半羹雞粉一匙蝦醬再中慢火煲一會(滾一滾)即可


Ubuntu how to remove all docker images / containers

Two commands:

Remove all images:sudo docker rmi `sudo docker images -q`

Remove all containers:sudo docker rm `sudo docker ps -aq`


蒿本錢半麥冬二錢藕節三錢京子一錢生地四錢元參三錢甘草一錢桔梗二錢白芷二錢辛夷一錢菊花錢半菖蒲錢半枳殻二錢川芎二錢麝香一分**紅花錢半桃仁錢半香附三錢川蓮五分大王錢半珍末分半朱苓二錢澤瀉三錢黃柏錢半枝子二錢車前錢半木通二錢羚羊五分膠珠二錢柿蒂三錢桔紅錢半貝母錢半續斷三錢烏藥二錢杞子二錢杜仲三錢桂枝錢半細辛錢半川木瓜三錢牛七二錢碎補三錢陳皮一錢五加皮三錢法半夏錢半蒼耳子錢半瓜蔞仁三錢北芥子錢半枇杷葉三錢葶藶子二錢牛榜(膀)子二錢 全部藥材研成末混合(藥粉)用密封存器載好放陰涼處

The Mindset - Affiliate Marketing (And all the marketing actually...)

I suddenly got an inspiration after reading an email from Lee Milteer@GKIC.  She is going to resign on 24 Feb 2016.

This is not the words about her reflection that suddenly touched me, it is the last paragraph that inspired me.

Gem of the Week
Recommended ResourceIf you want your life to have more enjoyment, fun and prosperity Magic, Mystery & Ritual: A Vison Quest with Lee Milteer is the event for 2016 for you! Why is that?  It seems nothing special right.  A link go to a page which has a list of products she is promoting.
This is "Recommended Resource" that touched me.
A few months ago I know that, money is a medium, it is just a paper that, when you give something valuable out to another body, he thanks you by giving something called "Money".  And you use this "Medium" as a common exchange "Tool" to get what you want.
In other words, "Money" is not the objective, "Giving help to other people who need you" is the objectiv…

Check php.ini file for syntax errors in Linux/Windows

No matter which platform you are using (Linux/Windows), to test php.ini, you simply use

php -v

and it will use current PHP config and see if it can show the version.  If your php.ini has error, it will also display.

Hope it helps someone.

What is Host and guest virtual machine: Definitions


A virtual machine (VM), typically has two components : the host and the guest.

The host is the virtual machine host server; the underlying hardware that provides computing resources, such as processing power, memory, disk and network I/O, and so on.

The guest is a completely separate and independent instance of an operating system and application software.

Guests are the virtual workloads that reside on a host virtual machine and share in that server's computing resources.

Hope it helps someone.

Docker nodeJS node

My notes on using Git, NodeJS with official docker image:

When you use -v / --volume, the directory will be created if not existsBear in mind: NodeJS DID NOT have a server.  Unlike Apache.  So it is OK to use -v to mount a directory directly and run npm install and npm startTo start: git clone <url> <target_dir>run the docker-compose.yml by running: sudo docker-compose -f <path_to_my_docker-compose.yml> up.In the above command, you can add '-d' at the end to run it on background.In docker-compose, if you want to run multiple commands, run this: command: bash -c "your_command" (reference).If you prefer using native docker statement: sudo docker run -it -d --name nodejs --rm -v <your_host_directory>:<your_docker_container_directory> -p 80:80 node:latest bash -c "npm install && npm start"Still not sure how to connect to webpack-dev-server inside container which the docker host is also a VM.

Rules of 3 on Marketing

You want your visitors to be hit by at least 3 modalities/angles within a very short time.

The modalities include, but not limited to:

- online video (FB/Youtube)
- newspaper
- blog post
- social media (FB)