After i reboot my OS X, i find that i couldn’t start the MySQL server and it throws the following error:
hatuey:5.6.19 yingkityuen$ mysql.server start
. ERROR! The server quit without updating PID file (/usr/local/var/mysql/hatuey.local.pid).
Go to the above folder and delete the mysql error log which is ended with .err. In my case, i executed the following command:
hatuey:5.6.19 yingkityuen$ rm /usr/local/var/mysql/hatuey.local.err
Where hatuey is my Mac machine name.
This should fix the problem.
Reference: Mahdi Yusuf – MySQL ‘The server quit without updating PID file’
So if you are using Mac, you need to quit the Chrome application. Then execute the following command in Terminal.
/usr/bin/open -a "/Applications/Google Chrome.app" --args --allow-file-access-from-files
Reference: Disable same origin policy in Chrome on Mac OSX
In Linux, i always do
For Mac OS X:
sudo lsof -i -P | grep -i "listen"
Reference: List open ports on your machine (Mac OS X)
It’s not easy to view the Git log in command line but most of the time is the most straight forward way or sometimes, the only way you could view the Git commit history.
Tig is a ncurses-based interface to view your Git repository.
Installation on OS X using Homebrew:
brew install tig
Installation on Ubuntu:
apt-get install tig
Continue reading Tig – Git interface on command line →
rbenv is an alternative to rvm for managing your Rubies. You can find some articles comparing the two. In general, rbenv is more lightweight without overriding the cd and gem command which rvm does and their similarities outweigh their differences. Here is a great article written by Jonathan Jackson about the two solutions.
For Mac users, you could install rbenv using Homebrew. Otherwise, you need to checkout the repository on GitHub.
Continue reading rbenv – Ruby version manager →
LibreOffice supports PDF conversion. What you need to do is to open the document in LibreOffice and click the Export as PDF… option under the file menu list. It’s good and simple to convert a single document but quite tedious if you have more files.
For batch conversion, we need to make use of the LibreOffice command in terminal.
1. Go to the directory which contains the source files.
2. Execute the following command to convert ALL files which ends with .odt into .pdf.
soffice --invisible --nologo --convert-to pdf *.odt
Continue reading LibreOffice – Batch convert files to PDF →
The Apache Commons Lang library could help you to determine the running OS type. Here is an simple example.
Continue reading Java – Determine if the running OS is Windows, Mac or Linux →
Finally i get the Windows 7 installed on the Mac Mini.
Then i tried to do the same for the MacBook but i couldn’t find the usb drive on the boot menu. After asking Google, it is found that for those Mac machines which are equipped with the super drive (dvd drive), they cannot be booted by external devices. I try to install the rEFIt boot manager but it still doesn’t work.
Finally i have to use the Boot Camp to install the Windows 7, but i have to find a DVD Windows 7 installer. Anyway, the Boot Camp is really cool and all drivers are automatically installed.
Recently i have tried to install Windows 7 in a Mac Mini and a MacBook. I have a Window 7 installer in a bootable usb. Just keep pressing the option key on startup and you could select the boot device in the boot menu. It works fine for the Mac Mini and the Windows 7 is installed without any problem.
But after the installation, i found that many drivers are missing. Finally i found a blog post written by Chris F Carroll. You can find all the details about getting the drivers from the Boot Camp package in that post so I am not going to repeat it here.
Mess up with the PHP dependencies in different environments? Composer is a PHP dependency manager where all the dependencies information are stored in the JSON file called composer.json. Similar to the pom.xml if you are using Maven in Java.
This example is done on a Windows machine. You could refer to Composer website if you are using Mac or Linux.
1. Download and install the Composer as stated in the Composer website.
Continue reading Composer – Manage your PHP dependencies →