Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Bin Zhang gembin

🎯
Focusing
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
gembin / set_jdk_mac.md
Last active Apr 8, 2018
Switching JDK on Mac OS X
View set_jdk_mac.md

/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
gembin / ssh_port_forward.md
Last active Mar 15, 2018
SSH Port Forwarding on Mac OS X
View ssh_port_forward.md
ssh    -L local_port:service_host:service_port \
       -p ssh_server_port \
       -l ssh_server_username \
       -N \
       ssh_server_host
@gembin
gembin / mac_install_cmake.md
Created Feb 27, 2018
Install cmake on Mac OSX
View mac_install_cmake.md
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install cmake
@gembin
gembin / python3_create_venv.md
Last active Jan 25, 2018
Python 3 Creation of virtual environments (3.5+)
View python3_create_venv.md

Creating virtual environment

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

NOTE:

  • 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
gembin / mac_os_open_files_limit.md
Created Jan 25, 2018
Mac OS Open Files Limit
View mac_os_open_files_limit.md

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
gembin / README.md
Created Jan 25, 2018 — forked from devinrhode2/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

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 https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

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

View python3-virtualenv-setup.md

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@gembin
gembin / install_tensorflow_pycharm_mac.md
Last active May 15, 2019
Installing Tensorflow on Pycharm (Mac)
View install_tensorflow_pycharm_mac.md
  • 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
gembin / install_fish_on_mac.md
Last active Nov 24, 2017
Install fish shell on mac
View install_fish_on_mac.md
  • 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.