178.91.123.132 -> testsvc:80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _Singleton(object): | |
def id(self): | |
return id(self) | |
def __init__(self): | |
print("creating singleton") | |
_singleton = _Singleton() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import Decimal | |
class Node: | |
def __init__(self, label): | |
self.label = label | |
class Edge: | |
def __init__(self, to_node, length): | |
self.to_node = to_node | |
self.length = length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _partition(array, lo, hi): | |
pivot = array[hi] | |
i = lo - 1 | |
for j in range(lo, hi): | |
if array[j] < pivot: | |
i += 1 | |
temp = array[i] | |
array[i] = array[j] | |
array[j] = temp |
brew install kubectl
kubectl version --client
brew cask install minikube
brew install docker-machine-driver-xhyve
(xhyve is now deprecated in favor of hyperkit)
(run the chown and chmod)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status virtualenv root_indicator background_jobs history time) | |
POWERLEVEL9K_VIRTUALENV_FOREGROUND='black' | |
POWERLEVEL9K_VIRTUALENV_BACKGROUND='31' | |
POWERLEVEL9K_PYTHON_ICON='🐍 ' | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL="$1" | |
echo "Testing $URL" | |
while [ 1 ]; do | |
RESPONSE=`curl $URL -o /dev/null -s -w %{time_total},%{http_code}` | |
TIME=`cut -d',' -f1 <<< $RESPONSE` | |
CODE=`cut -d',' -f2 <<< $RESPONSE` | |
DATE=`date` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/virtualenv | |
virtualenv -p python2.7 ~/virtualenv/APPNAME/ | |
source ~/virtualenv/APPNAME/activate | |
pip install blah | |
pip freeze > requirements.txt | |
pip install -r requirements.txt # (instead of pip install ...) | |
python blah.py | |
deactivate |