Posts

Showing posts from 2014

How to get Google Analytics View (Profile) ID

Image
To find the View ID in your Google Analytics account: 1. Sign in to your Analytics account. 2. Select the Admin tab. 3. Select an account from the dropdown in the ACCOUNT column. 4. Select a view from the dropdown in the VIEW column. 5. Under VIEW, click View Settings.

Backup MySQL to Azure Storage in 30 Seconds

Image
Step 1. Disable password prompt for "mysqldump command" mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect 1. Run " vi ~/.my.cnf " 2. Add the following lines [ mysqldump ] user = mysqluser password = secret 3. For Bitnami, you'll need to append the following line in " /opt/bitnami/mysql/my.cnf " !include ~/.my.cnf 4. Try running to see if the command works. mysqldump --all-databases > /home/bitnami/backups/db-backup.sql Step 2(a). Install Azure-CLI Prerequisites: Installing npm. sudo apt-get update sudo apt-get install nodejs sudo apt-get install npm Note: If you facing issue while installing nodejs/npm on Ubuntu 12.04, you can refer to his article for alternative way to install  https://rtcamp.com/tutorials/nodejs/node-js-npm-install-ubuntu/ , or this  http://stackoverflow.com/questions/16302436/install-nodejs-on-ubuntu-12-10#comment32

Bitnami Setup Cron to Backup MySQL

Step 1. Disable password prompt for "mysqldump command" mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect 1. Run " vi ~/.my.cnf " 2. Add the following lines [ mysqldump ] user = mysqluser password = secret 3. For Bitnami, you'll need to append the following line in " /opt/bitnami/mysql/my.cnf " !include ~/.my.cnf 4. Try running to see if the command works. mysqldump --all-databases > /home/bitnami/backups/db-backup.sql Step 2. Setup Cron to Backup to MySQL Lets setup cron to run at 00:00, every midnight. Option 1: For manual insert into crontab file via " crontab -e " command 0 0 * * * /opt/bitnami/mysql/bin/mysqldump --all-databases | gzip > /home/bitnami/backups/db-$(date +\%Y\%m\%d\%H\%M\%S).sql.gz Note that you'll need to escape the "%" characters, because cron will see it as end character and ignore

Wordpress "Stable Tag" not updating

Image
PROBLEM: Was updating one of my Wordpress plugin, and find it weird that the Wordpress Plugin Directory does not reflect the changes correctly although I've changed the " Stable tag " in readme.txt. According to Wordpress Plugin " Task 3: "Tagging" a new version " guide, you'll need to edit the trunk/readme.txt beforehand. SOLUTION: That is not enough! In the end, I found out that you will need to update BOTH: trunk/readme.txt trunk/{your-plugin-name}.php Hope this helps!

Facebook Sharer.php "The message could not be posted to this Wall." Error

Image
UPDATE: As of 2014-01-16 10:17 (GMT+8), this issue has been fixed. View the bug report . Facebook Sharer Error. Got this error message after updating Wordpress plugin for one of the site that I help maintain. Debugging When inspecting the network tab for the ajax request, I saw this error description in the response. for (;;);{"__ar":1,"error":1367001,"errorSummary":"Could not post to Wall","errorDescription":"The message could not be posted to this Wall.","payload":null,"bootloadable":{},"ixData":[]} After searching in Google, most people suggest that error 1367001 is due to incomplete URL format. But for my case, the URL is in complete form. So I did a comparison with the sharer on Techcrunch page. I noticed the difference is mainly on the attachment section. attachment[params][images][0] Conclusion Its Facebook sharer permission issue. Seems like Facebook s

Facebook hellocdn.html?v=1 browser popup. Not a virus.

Image
tl;dr Not a virus. Its popup from Facebook Messenger application to ping the CDN. ----- I noticed that from time to time, especially when my left comp is idle overnight, I'll have these blank pages opened in my browser window the next day. https://fbcdn-creative-a.akamaihd.net/hads-ak-prn1/hellocdn.html?v=1 My first thought was like... gosh, is there's malware on my comp? Then I started to inspect my comp. First Question. Is the CDN address valid? Did a search on the list of CDN addresses and found this stackoverflow page . Seems like its "fbcdn-creative-a.akamaihd.net" is one of the Facebook CDN. Furthermore, akamaihd.net is a reliable CDN provider. Next Question. If the CDN address is valid, could it be that Facebook CDN got compromised? So I inspect the page elements, and resources (js files). Seems like pretty OK, the URL that the script call is actually defined in the "result_endpoint " variable. // hardcode the return url var

2014 Fireworks around the World

Image
Singapore Fireworks. Image source:  highdefinitionwallpapers1080p . Compiled a list of the 2014 New Year Fireworks videos around the world. 1. Japan 2. Dubai 3. Australia 4. Brazil 5. UK 6. Paris (July 14th fireworks) 7. Singapore 8. Taipei 9. Hong Kong 10. Malaysia 11. Korea Leave a comment if you know videos for countries that is not listed above. Or a better quality video to replace any of the videos above. Updates: 20140101 - Replaced Singapore video. The original video was 2013 video. Thanks for Dann Khoo for pointing out. 20140103 - There's no fireworks for on new year. The video was  July 14th National Day fireworks . Thanks  Floris for pointing out. Bonus: Source:  Facebook .