Hot Posts:

Feb 24

Apache caught SIGTERM, shutting down MAMP Yosemite


When I upgraded my macbook to Yosemite OS the apache webserver wouldn’t start. That started driving my crazy becauseย it wasn’t indicating any proper error. The log would only say this –

[notice] caught SIGTERM, shutting down

Environment: Yosemite + MAMP 2.1.3 + Apache 2.2

Finally I found the workaround –

1. Just rename your

/Applications/MAMP/Library/bin/envvars file to something else like “_envvars

2. You are done ๐Ÿ™‚

Courtesy:ย https://twitter.com/mamp_en/status/496668261619335169

 

Nov 24

Solved: /opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture


I was trying to install macports on my Mac Mavericks & while updating the older version using

sudo port upgrade outdated

it messed up my system & started giving the following error on the command line

/opt/local/lib/libintl.8.dylib: mach-o, but wrong architecture

. Finally I was able to fix it by running following step:

sudo port install libidl +universal

๐Ÿ™‚

Nov 13

MySQL Library not loaded: libmysqlclient.18.dylib


Although I had MySQL community edition installed on my Mac OSX , I recently had the following error while running some python installation script which uses mysql as a backend. The error was:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in
import _mysql
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so

Solution:
1. Locate your MySQL installation & create symlink in /usr/lib for that. That’s it ๐Ÿ™‚

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

Jun 14

MAMP with MySQLWorkbench on MAC OS X


If you try to run MySQLWorkbench with MAMP you might run into issues like start/stop control related issues. Follow this steps to resolve it:

1. Connection Method: localhost/pipe
2. Socket pipe path: /Applications/MAMP/tmp/mysql/mysql.sock
3. You are done ๐Ÿ™‚

Jun 13

Change SSH key passphrase


You don’t have to generate new key-value pair ๐Ÿ™‚

Follow this in your terminal:

$ ssh-keygen -p
$ Enter file in which the key is (/Users/you/.ssh/id_rsa): [Hit enter]
$ Enter new passphrase (empty for no passphrase): [YOUR_SECRET]
$ Enter same passphrase again: [YOUR_SECRET]

Mar 09

How to delete old iTunes backups on Mac


Though iTunes backups are convenient, they do occupy lots of space on the hard disk. In order to free up the space you have to do the following steps:

1. Go to iTunes –> Preferences
2. Devices –> Select & delete the backup
3. Ok, you are done. ๐Ÿ™‚ You will gain GB’s worth of free space.

Mar 09

Free Screen Recorder for Mac


If you are hunting for a free screen recorder for Mac then don’t panic.

1. Download/Open QuickTime
2. Go to File –> New Screen Recording
3. Choose recording window & you are all set ๐Ÿ™‚

Mar 28

Time to rock again!


Finally I can say I’m back from hiatus ;)…short story –> this happens when you get married!

Jan 02

ThreadLocal vs Synchronize & Example


Environment: Java 6

Recently I was looking into capabilities of theThreadLocal. And I decided to test everything against a SimpleDateFormat instance. Unfortunately the SDF is not a thread safe. So in a multi-threaded environment you can avoid concurrent modifications using “Synchronized”. I ran 100000 iterations over small set of 3 dates. Now it was time to implement same thing using ThreadLocal.
Read the rest of this entry »

Dec 12

Longest Common Subsequence Java Implementation


Recently I needed to implement LCS (Longest Common Subsequence) algorithm from dynamic programming for solving one of the problems. So I ended up writing quick implementation of LCS. For more details on LCS:
http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
Read the rest of this entry »