Posts

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"
</IfModule>

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


雁王

http://baike.baidu.com/item/%E9%9B%81%E7%8E%8B/16481043

世界上有四種人,死人、失敗的人、愚蠢的人,以及……我。
--
(赤羽信之介:你們的目的?)
說了,游戲就失去趣味了。
(赤羽信之介:不考慮現出底牌,在此將我格殺?)
我不想傷及無辜。
--
最好的決定,往往也是意料中的決定。
萬無一失,往往是萬一有失。
失之東隅,收之桑榆。有失敗的開始,才有成功的一步。
--
一個人越想得到的時候,就會越怕失去。可悲的是,想得到的越急切,失去的可能就越大。這是人性的弱點。
--
我喜歡失敗的第一步,因為失敗,總是成功的墊腳石。
--
有一個人,他住的地方,有一個深坑,有一日,他想了解這個坑,到底有多深。他放索而探,而索短絀;他投了石,一去無聲。他很好奇,他太好奇了。你認為,該怎樣,才能滿足他的好奇?
(凰後:就縱身跳入深坑,用親身了解,這個坑,到底有多深。)
你落地了嗎?
--
光明總自以為速度最快。但事實呢?黑暗始終在前方,靜候著光明。
輸,算得上什麼?只怕世上,沒人讓我贏。
--
世上所有的衝突,皆源自於執著。
至今,無人可以完全放下。
--
別再侮辱智謀這兩個字了,如果你拙劣的手法,也能稱得上是算計,那愚蠢兩字在世上,就沒被使用的機會了。
靜!我正在思索,要如何用你聽得懂的言詞,向你解釋局勢。
--
噓,注意聽——
--
自以為投奔光明,卻墜入更大的黑暗。這是你們墨家十傑的通病,藥石罔效。
太膚淺了,為了讓自己的目標,有一個世俗的依據,甚至求得世俗的認同,所以想方設法將所有的行為,用意義包裝。這層虛偽,是世上最脆弱的糖衣。你問我意義,那我,也只能用這個虛偽的形式,給你一個答案——消滅意義,就是我的意義。
唯有黑暗,能吞噬黑暗。毀掉墨家的,是墨家本身。
善射者死於矢,善戰者死於兵,善泳者……溺於水。
--
一個人若要攀上高峰,就要吃苦,就要流汗。雖然艱難,但當他佇立在高峰之上,他會發現,這一切,都是值得。
(神蠱溫皇:反之,一個人若要向下沉淪,就相對容易多了。人啊,無論從哪裡往下跳都很容易,因為墮落時的快感,通常都會伴隨著罪惡的愉悅。)
如同過往的溫皇一般嗎?直到落地之後,才開始後悔。因為發現斷崖下,是一處陷人的泥沼,是一個無可復的深淵,甚至是,一座奪人性命的火坑。
--
你的信念,承擔不了一滴血液的重量,救世?可笑…

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

Image
TL;DR
- 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

Hi

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:

#fancybox-content{
        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

Notes:

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.

http://stackoverflow.com/questions/7936610/json-uncaught-syntaxerror-unexpected-token

Hope it helps someone.

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

Image
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:

http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png - 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 cluster.zip 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

Source: http://searchservervirtualization.techtarget.com/tip/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)
....