Switch between python 2.7 and python 3.5 on Mac OS X

I generally use Python 2.7 but recently installed Python 3.5 using Miniconda on Mac OS X. Different libraries have been installed for these two versions of python. Now, the entering either of the keywords ‘python’ or ‘python3’ in terminal invokes python 3.5, and ‘python2’ returns ‘-bash: python2: command not found’. How can I now invoke … Read more

cp –parents option on mac

On Linux, I have a –parents option available for the cp command so I can do cp –parents test/withintest/go.rb test2 http://www.gnu.org/software/coreutils/manual/html_node/cp-invocation.html On Mac, I do not have this option available. Is there a way to do this on Mac? Why is this option not available? PS. The purpose of –parents is the following: ‘–parents’ Form … Read more

Mac OS: /usr/bin/env: bad interpreter: Operation not permitted

I’m trying to run this script on Mac OS 10.7 (Lion) and I’m getting the error: $ bbcolors -bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted I’ve successfully run this script on other Macs of mine. It’s just this script downloaded and unmodified from Daring Fireball. I found this person with a very similar problem … Read more

Close Terminal window from within shell script (Unix)?

Is there a way to close a Terminal window from within a shell script? I have a .command file that should just get out of the way once it’s done. Answer Using exit 0 will cleanly terminate the script. Whether Terminal window stays open is user-configurable. The default is to always stay open. To change … Read more

Docker & Postgres: Failed to bind tcp 0.0.0.0:5432 address already in use

Problem I’m trying to start postgres in a docker container on my Mac, but I keep getting the following error message docker: Error response from daemon: driver failed programming external connectivity on endpoint postgres (8392b9e5cfaa28f480fe1009dee461f97e82499726f4afc4e916358dd2d2f61e): Error starting userland proxy: Failed to bind tcp 0.0.0.0:5432 address already in use. I have postgres installed locally, but I … Read more

Hadoop on OSX “Unable to load realm info from SCDynamicStore”

I am getting this error on startup of Hadoop on OSX 10.7: Unable to load realm info from SCDynamicStore put: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/travis/input/conf. Name node is in safe mode. It doesn’t appear to be causing any issues with the functionality of Hadoop. Answer Matthew Buckett’s suggestion in HADOOP-7489 worked for me. Add the … Read more