Skip to content

Instantly share code, notes, and snippets.


Bin Zhang gembin

Block or report user

Report or block gembin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gembin /
Last active Apr 8, 2018
Switching JDK on Mac OS X

/usr/libexec/java_home -V command to get the list of installed JDKs.

For example:

Matching Java Virtual Machines (2):
    9.0.4, x86_64:	"Java SE 9.0.4"	/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home
    1.8.0_161, x86_64:	"Java SE 8"	/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home
gembin /
Last active Mar 15, 2018
SSH Port Forwarding on Mac OS X
ssh    -L local_port:service_host:service_port \
       -p ssh_server_port \
       -l ssh_server_username \
       -N \
gembin /
Created Feb 27, 2018
Install cmake on Mac OSX
ruby -e "$(curl -fsSL" < /dev/null 2> /dev/null
brew install cmake
gembin /
Last active Jan 25, 2018
Python 3 Creation of virtual environments (3.5+)

Creating virtual environment

python3 -m venv /path/to/new/virtual/environment


  • Changed in version 3.5: The use of venv is now recommended for creating virtual environments.
  • Deprecated since version 3.6: pyvenv was the recommended tool for creating virtual environments for Python 3.3 and 3.4, and is deprecated in Python 3.6.
gembin /
Created Jan 25, 2018
Mac OS Open Files Limit

Open Files Limit

Changing Limit For Current Session

Most operating systems can change the open-files limit for the current shell session using the ulimit -n command:

ulimit -n 200000

Mac OS X El Capitan

gembin /
Created Jan 25, 2018 — forked from devinrhode2/
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:


Python3 Virtualenv Setup

  • Python 3
  • Pip 3
$ brew install python3
gembin /
Last active May 15, 2019
Installing Tensorflow on Pycharm (Mac)
  • In Pycharm, Preferences -> Project Interpreter -> Create VirtualEnv -> <your_virtualenv_name_and_location>, and select "inherit global site-packages" option -> OK.
  • In command line, install tensorflow in the virtualenv location you created in previous step. For the above case, let's assume the location is ~/tensorflow_pycharm, therefore, run command virtualenv --system-site-packages -p python3 ~/tensorflow_pycharm or python3 -m venv ~/tensorflow_pycharm(changed in version 3.5: the use of venv is now recommended for creating virtual environments).
  • Install tensorflow with one of the following approaches:
    • From command line
      • Activate the virtualenv environment by issuing one of the following commands: source ~/tensorflow_pycharm/bin/activate
      • Issue the following command to install TensorFlow and all the packages that TensorFlow requires into the active Virtualenv environment: pip3 install --upgrade tensorflow.
      • In PyCharm, select the configured Project Interpreter at `~/t
gembin /
Last active Nov 24, 2017
Install fish shell on mac
  • brew install fish
  • add /usr/local/bin/fish to /etc/shells
  • chsh -s /usr/local/bin/fish
You can’t perform that action at this time.