Clearing CakePHP Auth User cache
I am doing some updates to the table users by adding a new field.
However on my running server, calling $this->Auth->user('newfield') return a NULL value.
Solution
To fix this, you need to clear the user model cache file.
Go to app/tmp/ folder, and remove the file cake_model_default_users, which store the information of the user table.
wget to stop output file in cpanel
WGET could be the easiest way to run the cron job in CPanel. The command is as simple as wget http://digitalmemo.neobie.net/cron.php .
However, in my hosted server (hostgator), WGET command generates output files and the root folder: /home/username/ every time the cron job runs. The files' name are something like scriptname.1, scriptname.2 and with the number increasing. All the files need to be manually deleted.
To stop generating the output files, we need to add some parameters after wget: -O /dev/null
And the new command line would look like such:
wget -O /dev/null http://groupasave.com/daily_digests/send_summary
Solving: Failed to install .NET Framework 4.0 with Error Code HRESULT: 0xc8000222
I am having problem installing .NET Framework 4.0 in my new notebook. Without any descriptive error message (this is what Microsoft always does!), there is no choice but to find the solution come out by non-microsoft guys.
Here come the solution:
Before installing .NET Framework 4.0,
- open cmd
- type in command "net stop WuAuServ" (disable windows update)
- Go to Run (you can do this by pressing Win + R) and type in "%windir%" (this command let you go to your windows system folder)
- Find the folder "SoftwareDistribution" and rename it as "SDold"
- Then, go back your previous command prompt and run the command "net start WuAuServ"
- Now, try to install .NET Framework again
Accessing websites blocked by government
Malaysian! Some of you are awared that Malaysia government has recently blocked some of the P2P websites.
Those websites include:
- http://www.warez-bb.org
- http://thepiratebay.org
- http://www.movie2k.to
- http://www.megavideo.com
- http://www.putlocker.com
- http://www.depositfiles.com
- http://www.duckload.com
- http://www.fileserve.com
- http://www.filetube.com
- http://www.megaupload.com
If you have trouble visiting website that is blocked by your government, try to change your DNS service IP. As you know every website can be visited via its IP.
For example, the domain like "neobie.net" is just the better meaningful name for people to remember the URL. DNS's job is to translate neobie.net to IP 119.110.111.23 which is harder to be remembered and regonized by users.
By default, you will be using DNS provided by your Internet Service Provider (ISP), such as Telekom. For now I am introducing a better DNS: Google DNS, with IP of 8.8.8.8 and secondary 8.8.4.4.
To change DNS settings in your own PC (Windows 7),
GO to Control Panel > Network and Internet > Network and Sharing Center > Change adapter settings
Right click the connection you are using, and choose properties
Double click on TCP/IPv6
Configure your DNS as provided in Screenshot below
* Note that this method only works if the IP of the websites are not banned.
Incorrect .htaccess RewriteRule with double dots in filename
Previously my website is working fine with file naming scheme of more than a dot(.), such as sample.test.html
I was using .htaccess RewriteRule, for example: redirecting a URL of mydomain.com/sample/test to my html file sample.test.html
In my directory, I have:
- sample.test.html
RewriteRule ^sample/test?$ sample.test.html
Until today, some miserable thing happens. The URL was giving me Error 404: Page cannot be found.
After tinkering for some times, finally I found that was because of the file sample.test.html.
It seem like some changes was done by my Host Provider, and the server redirect /sample/test to sample.html, instead of sample.test.html I want. It seem like some configuration has been done on extension of the file but I'm not too sure which is it.
To solve this, sample.test.html is renamed to sample_test.html and in .htaccess:
RewriteRule ^sample/test?$ sample_test.html
Making your website load faster: CPanel Configuration
Follow up the previous post Making your website load faster: Compress PHP file easily, now there is another even better way to gzip your files. If you are a CPanel user, go to CPanel control panel, select "Optimze Website"
By default, the compression is Disabled. Now, choose "Compress the specified MIME types". The original settings would be:
text/html text/plain text/xml
The text/html would include all the PHP file which is loaded on your server. To optimize your website further, we choose to compress javascript and css files.
Now, append the following text to it:
text/css application/x-javascript application/javascript text/javascript
And of course, click "Update Settings" to save your changes. Now check your CSS and Javascript files which are automatically compressed as well!
If you wonder why should we put 3 kinds of javascript MIME Type above, that is because different browser interpret javascript Content/MIME Type differently. For safety, just put as many as content type which are known to you so that the files can be compressed on most of the modern browsers!
Another question is, why don't we choose to compress all contents?
I am afraid if we choose this option, all images are getting gzipped too which are totally unnecessary since no file size are reduced. Adding more unnecessary processes means it would bring down hosting CPU performance at the same time.
Google+
Google+ is launched today, and the web page layout is much alike facebook.
Despite the failure of Google Wave, can Google+ takes up some market shares from Facebook ?
Unfortunately, for those who wants to test Google+, the service is opened for small chunk of users currently. Right now, the only possible way to get the invitation is through their web form: https://services.google.com/fb/forms/googleplusenuk/. Simply enter your First Name and Email, then wait for the invitation
Circles, Sparks, Hurdles, Hangouts... Google has definitely give some good branding for its upcoming SNS.
Interactive demo can be seen here: http://www.google.com/intl/en_uk/+/demo/, you can play around (but not the real one) with Google+.
Wanna know more? Check out the Google+ Project playlist on Youtube!
PPLIVE 是流氓软件?
虽然本身不常看网络电视,即使有看也是看PPSTREAM,因为身在大马只有 PPSTREAM 能够给予最好的观看体验;其他的网络电视都不能给到很好的流程。
某然在360安全卫士:360流量监控发现上载的流量一直飙升,几乎占据了我所有的上载带宽。
现在我来列出 PPLIVE 的两大罪状:
1. PPAP.exe 吃掉了我的上载带宽:
即便是我将PPLIVE 关闭了几个小时,PPAP.exe 还是依旧运行,不明白为何PPlive 要这么做?是不是在收集用户的硬盘资料?
2. IE代理设置时发现使用自动配置脚本被篡改
看开始看到这个设置时,我简直傻了眼。我自问没随便安装软件,而且也用着我喜欢的360杀毒,中病毒木马的几率几乎是0。谷歌查询,才发现,原来这又是 pplive 干得好事!怪不得最近觉得 chrome 的浏览速度比 火狐慢了许多(chrome 使用 IE 的代理设置)
要彻底解决这个东西,只好卸装 PPLive Video Accelerator。
Making your website load faster: Compress PHP file easily
When internet getting popular, the web page content getting richer everyday. A web page with a few hundred kilobytes can be seen everywhere.
There are numerous of ways to increase the web page loading time by reducing the file size. One of the easiest way: compress php file by implementing a simple code, and the encoding method mentioned here: Gzip.
Many browsers are built with GZip capability, but it is not widely used website owner. By using Apache + PHP, you can compress your php file easily as much as 90%!
So how do we do that? Here is the magic code:
ob_start("ob_gzhandler");
By adding the code before any output of text in PHP file, the entire page that is passed to the end user's browser will be greatly compress!
It's easily to verify and prove whether the web page has been compressed. Here I will show how to do that using my favourite browser: Chrome.
The file to be tested can be simply grabbed from internet (the larger file size, the better). I rename the file to gzip.php. Its original file size is 456.15kB .
Now the chrome:
Navigate to gzip.php in Chrome. Open the developer tools by right clicking the web page > Inspect Element. From the tab, switch to "Network". Now, reload the page again. Rows of data come out. From the list, scroll to the top as the page information is always on top.
Now, notice the Size Transfer column. The original file size is 456.15KB, and the transfer file size is around that too (a bit bigger > <)
Then, I added the magic code to the very top of the document: ob_start("ob_gzhandler")
And I reload the page again. Read the Size Transfer column again.
The original file size is 456.15KB, but the transfer size is now down to 23.73KB only! Such compression ratio is around 95%!
This could save the web page loading time by probably a few seconds on slower connection, which will definitely give your audience a pleasure time staying on your site.




