Thứ Ba, 10 tháng 9, 2013

How to log MySQL slow queries

Since I upgraded mywebsite to VPS, I can analyse the slow queries by loggin them into a file without restarting mysql as follows:

# touch /var/log/slow
# chown mysql:mysql /var/log/slowqueries
# mysql -e 'SET GLOBAL slow_query_log=1;'
# mysql -e 'SET GLOBAL slow_query_log_file="/var/log/slowqueries";'
# mysql -e 'SET GLOBAL long_query_time=5;'

Or I can add these lines to my.cnf:
slow_query_log=1
slow_query_log_file=/var/log/slowqueries
long_query_time=2

To test if it is working correctly, try:
# mysql -e 'SELECT SLEEP(6);'

Chủ Nhật, 1 tháng 9, 2013

Romajidesu is back!

After three days upgrading, RomajiDesu Japanese dictionary is back on a new powerful VPS server. After one year, Romajidesu steady gain the trust from Japanese leaner community and the traffic reach approximately 3000 visits per days, or nearly 20000 page views per day. Another great upgrade of RomajiDesu before that is the website framework. The underline framework is also upgraded to a more powerful and extensible one, which cannot be seen from the surface.


Thứ Ba, 23 tháng 7, 2013

Audio pronuciation on RomajiDesu

If you are a frequent users of the RomajiDesu English - Japanese dictionary, you must have noticed the difference, there are a small speaker icons next to Kana definition of each dictionay entry. Click on that, and you will hear the audio pronunciation for the word. For example:
A sample search for "恋人" (Lover) using RomajiDesu dictionary
Have fun learning Japanese!

Thứ Năm, 28 tháng 2, 2013

Farewell Paypal, never see you ever again!

I opened my Paypal account in 2007 but haven't used it since then until recently we have a charity cause to help a friend who has a brain tumor. Our friends oversea offered help and I thought Paypal is a the best way for them to send money to help. I logged in to my Paypal account and got account verification. The verification itself was not comfortable because they seemed not to recognize the security number on my Visa debit card, so they charge $1.95 and I had to call my bank to get the verification code.

Just after the a second donation was made, I received two email said that my account was limited again because:


Feb 26, 2013: We need a bit more information about some money you recently received or withdrew.(Your case ID for this reason is PP-002-223-472-153.)
Feb 26, 2013: We've noticed some changes to your usual account activity. As a security precaution, we'll need a little more information about you and your account.
(Your case ID for this reason is PP-002-223-472-236.)

Well, it seems that I just need to log into the resolution center and choose the case ID and provide them answer or proof, right? There are nothing to choose there. There is a section to verify a credit card, but I need to add another card and verify again! WTF?

So I chose email contact and provided them information of the two above cases.  They did kindly answer an email said that give time 01 day for reviewing my account. Then, after 02 days, this is what I received:

For the safety and security of the PayPal network, we often review accounts for potential risks. After reviewing your account, we have decided to close it because of security issues. We are making every effort to minimize any disruption to your business. If your PayPal account balance is zero, and you have no unresolved buyercomplaints or chargebacks, your account will remain limited. 
-----------------------------------Disbursement options----------------------------------- 
Option 1. If you owe refunds to any of your buyers, you can use the money in your PayPal account to refund them.To refund your buyers:1. Log in to your PayPal account.2. Click "Contact Us" at the bottom of any page.3. Click "Contact Customer Service."4. Under "Choose a Topic," select "Sending/Receiving Money."5. Under "Choose a Subtopic," select "Refund/Cancel a Payment."6. Click "Continue" and follow the instructions to refund payments. 
Option 2. Money in your PayPal account will be held for 180 days. After 180days, we'll email you information on how to receive your funds.We regret any inconvenience this may cause.

It's so dissapointing, but of course I chose Option 1. However, again, there is no "Contact Customer Service"!!. I took me sometimes to figure out that should be "email us" section.

It can be understandable cares must be taken especially with countries which have many suspicious activities. But it is so disappointing since they just close a account with no clear reason. And  the process was also confusing and annoying. I've had the most horrible experience I've ever had.

Well, thank you and farewell Paypal.