Skip to content

Instantly share code, notes, and snippets.

View gembin's full-sized avatar
🎯
Focusing

gembin

🎯
Focusing
  • Seattle, WA
View GitHub Profile
@gembin
gembin / git-branch-simplify.md
Created June 6, 2018 06:49 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@gembin
gembin / ca.md
Created May 12, 2018 08:50 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@gembin
gembin / set_jdk_mac.md
Last active April 8, 2018 03:08
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
gembin / ssh_port_forward.md
Last active March 15, 2018 07:18
SSH Port Forwarding on Mac OS X
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 February 27, 2018 07:03
Install cmake on Mac OSX
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 January 25, 2018 15:51
Python 3 Creation of virtual environments (3.5+)

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 / README.md
Created January 25, 2018 14:40 — forked from devinrhode2/README.md
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 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:

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@gembin
gembin / install_fish_on_mac.md
Last active November 24, 2017 03:18
Install fish shell on mac
  • brew install fish
  • add /usr/local/bin/fish to /etc/shells
  • chsh -s /usr/local/bin/fish
@gembin
gembin / download.sh
Created November 3, 2017 17:46 — forked from bittlingmayer/download.sh
Download fastText pre-trained models for many languages [moved to ftio/wiki/download.sh - pip install ftio / https://github.com/SignalN/ftio]
# See https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md
for (( i=1; i<=$#; i++ )); do
wget -c "https://s3-us-west-1.amazonaws.com/fasttext-vectors/wiki.${!i}.zip"
done
# For example:
# ./download.sh bg el ka hy ru fa es fr de it pt ar tr pl ko
# If stopped it will not re-start automatically, but if re-started it will continue from where it stopped.