Posts

[Bitnami] mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock'

Got into this error while trying to run "mysql_upgrade" command bitnami@server:~$ mysql_upgrade --force -uroot -p Enter password: mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) while connecting to the MySQL server Upgrade process encountered error and will not continue. Solution: Just do a symbolic link for the mysql.sock file. bitnami@server:~$ ln -s /opt/bitnami/mysql/tmp/mysql.sock /tmp/mysql.sock Wahlah! Problem solved! bitnami@vulcan-clients:/tmp$ mysql_upgrade --force -uroot -p Enter password: Checking server version. Running queries to upgrade MySQL server. Checking system database. mysql.columns_priv OK mysql.db OK mysql.engine_cost OK mysql.event OK mysql.func OK mysql.general_log ...

Visual Composer (version 4.4.1) fixes for Wordpress 4.7

Updated to Wordpress 4.7.2 recently and existing theme with old Visual Composer was broken. Searched and tracked the error, and found the following scripts that solves the issues. 1. /wp-content/plugins/js_composer_theme/assets/js/backend/composer-view.js:99 2. /wp-content/plugins/js_composer_theme/assets/js/backend/composer-teaser.js:350

Test Pollen

Javascript for creating timeline

Image
#1 TimelineJS - http://timeline3.knightlab.com/ #2 InfostoryJS - https://github.com/athletics/infostory

Google does crawl and parse iFrame content

Image
I noticed that the number of 404s in my webmaster account starts to increase. I get "weird" links that I don't think should appear on my page, e.g. this: A quick check shows that Google crawler picked up the URL from one of the Guardian iFrame: I wonder whether any link juice is passed on to the URL, since its indexed by Google.

How to enable Facebook Comment reply function on Facebook Profile

Image
This is a guide on how to enable Facebook comment reply on your Facebook profile. Summary of steps: 1. Open Chrome 2. Enable emulate geolocation coordinate. 3. Set geolocation to New Zealand ("-41.211111", and "174.781111"). 4. Open touch.facebook.com 5. Select "Check in" 6. Open facebook.com 7. Comment reply should appear now!

Generate GoDaddy SSL Certificate (.crt) for Azure Websites (.pfx)

Image
Step 1: Getting GoDaddy SSL cert. Let's say you have a domain name of my_domain.com. You'll first need to generate the the .csr file for GoDaddy with the following command: openssl req -new -newkey rsa:2048 -nodes -keyout  my_domain.com .key -out  my_domain.com .csr This gives you 2 files: my_domain.com.key - This is the private key my_domain.com.csr - This is the Certificate Signing Request Copy the content of my_domain.com.csr file to the SSL signing authority (GoDaddy). Once approved, GoDaddy give you back a .zip file with the following 2 files: 18f1c77f369c0b59.crt - This is your cert gd_bundle-g2-g1.crt - This is the GoDaddy Certificate Chain Step 2: Convert a CERT/PEM certificate to a PFX certificate openssl pkcs12 -export -out  my_domain.com .pfx -inkey  my_domain.com .key -in 18f1c77f369c0b59.crt Step 3: Certificate to Upload to Azure. Step 4: Assign SSL Bindings. Step 5: Done! References : ...

Vulcan Poll

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 .

Convert Font Suitcase to TTF

Image
TLDR; Use Fondu to convert fonts to .ttf Sometimes clients send me fonts in Font Suitcase format, and  I'm suppose to include the fonts in their websites. To convert the fonts to TTF, I use Fondu . A set of programs to interconvert between mac font formats and pfb, ttf, otf and bdf files on unix. Fondu will read a series of mac files, check their resource forks and extract all font related items into seperate files. Install Fondu (OSX) Download Fondu Open terminal Change directory to the dir that you extracted fondu in terminal: ./configure terminal: make terminal: sudo make install Convert Fonts to TTF Change directory to the dir where your font is. terminal: fondu <font filename>   e.g. fondu Futura.dfont Done. Convert to Webfonts Upload the converted .ttf file to http://convertfonts.com/ Related: http://apple.stackexchange.com/questions/8455/how-do-i-convert-a-suitcase-font

Free Skype Premium For a year (€71,88 value)

Image
Steps to Redeem the Voucher Go to https://collaboration.skype.com/promotion/  and sign up. You’ll receive a voucher code in your email shortly after that. Go to http://skype.com/go/voucher , and enter your voucher coupon code.  Enjoy your Skype premium credits for free! Share it with your friends! ---------- Side note: There are lots of voucher/deal promotions spreading around this season. Do take note on the URL links before you click them. Do not fall into the trap of phishing sites. Make sure the links are indeed the original websites. In this case, it should be from skype.com, i.e.   https://collaboration. skype.com /promotion/. And the email that you'll be receiving should be something like this: And the links are indeed redirect to skype.com . Happy Holiday! :)

Instagram Accounts (Non-celebrities) with more than 1 Million Views

Image
I'm consolidating the list of Instagram accounts (non-celebrities) with more than 1 million followers. 1.  @ahlamalnajdi  (1,138,847 Followers) @ahlamalnajdi Comparison: @instagram  (53,262,825) @justinbieber (12,064,220) @arianagrande  (8,149,691) @taylorswift  (7,190,340) @starbucks  (1,825,637) Feel free to let me know on any non-celebrities accounts with 1 million views.

Gmail show wrong timezone for emails

This is just a self reminder. Gmail list out email timezone according to computer system clock. If the time displayed on your messages is wrong, your system clock may be set incorrectly. To check your system clock, do the following: Open your computer’s date and time settings. Verify that the appropriate month, day, and year are selected. Verify that your time zone is selected. If you changed your time zone, restart your browser. Source: https://support.google.com/mail/answer/7992?hl=en

[Apache AccessLog] %2f..%2f..%2f..%2fetc%2fhttpd%2flogs%2ferror.log

Image
Recently reviewed the Apache Accesslog for one of the sites I'm handling. Got a bunch of entries in my access log that looks like these 54.208.35.151 - - [27/Nov/2013:13:27:58 +0800] "GET /wp-content/plugins/theia-post-slider/js/balupton-history.js/history.js?ver=.. %2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fhttpd%2flogs%2ferror.log HTTP/1.1" 404 - "http:// [this-is-intentionally-masked] .com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; ScanToSecure)" or 54.208.35.151 - - [27/Nov/2013:13:30:11 +0800] "GET /wp-content/plugins/sociable/css/sociable.css?ver= ..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fvar%2flog%2fapache%2ferror.log HTTP/1.1" 200 5687 "http:// [this-is-intentionally-masked] .com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; ScanToSecure)" Notice that the second example is actually a HTTP 200 OK status request. Mea...