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
# The following is an example of a command to clone an development(ex-app-development) as an production(ex-app-production). | |
kubectl get deployment ex-app-development -o json \ | |
| jq '.metadata.name = "ex-app-production"' \ | |
| kubectl apply -f - |
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 | |
if [[ -z $(grep dockerhost /etc/hosts) ]] | |
then | |
echo `/sbin/ip route|awk '/default/ { print $3 }'` dockerhost >> /etc/hosts | |
fi |
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
PROG="tsuru-setup" | |
if [ -z "${TSURU_USER}" ]; then | |
echo "${PROG}: Please set the TSURU_USER environment variable before running this script" | |
exit 1 | |
fi | |
if [ -z "${TSURU_TARGET}" ]; then | |
echo "${PROG}: Please set the TSURU_TARGET environment variable before running this script" | |
exit 2 |
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
cat ~/credentials/user | |
source ~/credentials/user | |
keystone discover | |
keystone catalog | |
keystone endpoint-get --service volume | |
keystone token-get --wrap 50 | |
nova list | |
nova flavor-list | |
nova boot --image cirros-qcow2 --flavor 1 MyFirstInstance |
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
test: hello.so | |
python -c 'import hello; hello.byte_bugginess()' | |
hello.so: hello.pyx | |
python setup.py build_ext --inplace | |
clean: | |
$(RM) -r *.so *.c *.pyc __pycache__ *.egg-info build |
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
diff -r e7305517260b Lib/io.py | |
--- a/Lib/io.py Sat Jul 20 15:12:19 2013 +0200 | |
+++ b/Lib/io.py Sun Jul 21 10:14:26 2013 -0700 | |
@@ -56,6 +56,8 @@ | |
BufferedWriter, BufferedRWPair, BufferedRandom, | |
IncrementalNewlineDecoder, TextIOWrapper) | |
+from unittest.mock import patch | |
+ | |
OpenWrapper = _io.open # for compatibility with _pyio |
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
[tox] | |
envlist=py27,lint | |
[testenv] | |
downloadcache={homedir}/.pipcache | |
distribute=True | |
sitepackages=False | |
[testenv:py27] | |
deps=nose |
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 django.core.management.base import BaseCommand | |
from django.conf import settings | |
class Command(BaseCommand): | |
help = "Print the active Django settings." | |
def handle(self, *args, **options): | |
for key in dir(settings): | |
if key.startswith('__'): |
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
# Install Homebrew | |
# | |
mkdir -p /usr/local | |
mkdir -p /usr/local/bin | |
sudo chown -R $USER /usr/local | |
cd $HOME && mkdir -p homebrew | |
curl -L https://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C homebrew | |
ln -nfs $HOME/homebrew/bin/brew /usr/local/bin/ | |
brew update |
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
<?php | |
namespace CHH; | |
trait MetaObject | |
{ | |
protected static $__metaClass; | |
static function setMetaClass(MetaClass $metaClass) | |
{ |
NewerOlder