Writing

  • MySQL: “Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (38)”

    To fix it, try the following: 1. In the terminal, run ‘touch /tmp/mysql.sock’. 2. Restart mysql.

  • Reset MySQL Password on OS X Lion

    ,

    In case you forgot or didn’t set the password for “root,” do the following: 1. Create a file called mysql-init with the following entries (I placed mine in my home directory): UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’; FLUSH PRIVILEGES; 2. Make sure mysqld is not running (i.e. terminal > ps -ef | grep mysql) 3.…

  • Uninstall HomeBrew on OS X Lion

    In the terminal: cd `brew —-prefix` rm -rf Cellar brew prune rm -rf Library .git .gitignore bin/brew README.md share/man/man1/brew rm -rf ~/Library/Caches/Homebrew

  • Automatically update locate DB in OS X

    ,

    Pretty straightforward, simply add the following in your .bash_profile: alias locate=’if [ $((`date +%s`-`eval $(stat -s /var/db/locate.database); echo $st_mtime`)) -gt 3600 ]; then echo “locate: db is too old!”>/dev/stderr; sudo /usr/libexec/locate.updatedb; fi; locate -i’ Note: Run source ~/.bash_profile to reload.

  • Completely remove Python 2.7 on OS X Lion

    ,

    Simple. Here are the steps: 1. Remove the Python 2.7 framework sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7 2. Remove the Python 2.7 applications directory sudo rm -rf “/Applications/Python 2.7” 3. Remove the symbolic links in /usr/local/bin

  • Subclipse Error in Eclipse: “Failed to load JavaHL Library”

    ,

    Just in case you get the error above with Eclipse when accessing an SVN repository via Subclipse on OS X Lion, do the following: 1. Install MacPorts (make sure you have Xcode and the command line tools). 2. Run the following in terminal: sudo port install subversion-javahlbindings