Skip to content

Instantly share code, notes, and snippets.

@msabramo
msabramo / test_gophercloud.go
Created August 12, 2014 18:32
A simple sample of using gophercloud to authenticate and create a keypair using Nova
package main
import (
"fmt"
"github.com/rackspace/gophercloud"
"github.com/rackspace/gophercloud/osutil"
)
func main() {
provider, auth_options, err := osutil.AuthOptions()
@msabramo
msabramo / python-openstackclient_bug.txt
Created September 2, 2014 18:03
Illustrate "ERROR: openstackclient.shell Exception raised: load_keyring() takes exactly 1 argument (2 given)" bug in python-openstackclient
marca@marca-mac2.local ⮀ ~ ⮀
❯ mkvirtualenv python-openstackclient
New python executable in python-openstackclient/bin/python
Installing setuptools, pip...done.
marca@marca-mac2.local ⮀ ~ ⮀ python-openstackclient ⮀
❯ workon python-openstackclient
marca@marca-mac2.local ⮀ ~ ⮀ python-openstackclient ⮀
❯ pip freeze
@msabramo
msabramo / deploy-to-tsuru.out.txt
Created November 7, 2014 17:27
Output of `deploy-to-tsuru` script
❯ ./deploy-to-tsuru
********************************************************************
git cloning tsuru-dashboard from GitHub...
********************************************************************
Cloning into 'tsuru-dashboard'...
remote: Counting objects: 5533, done.
remote: Total 5533 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (5533/5533), 3.44 MiB | 1.67 MiB/s, done.
Resolving deltas: 100% (2693/2693), done.
Checking connectivity... done.
@msabramo
msabramo / tsuru-setup.sh
Created November 12, 2014 05:56
Script to automate a lot of the setup of tsuru
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
@msabramo
msabramo / logit.py
Created November 25, 2014 07:26
VarLogger class that can log both variable name and value
import ast
import inspect
import logging
import sys
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@msabramo
msabramo / gist:5e82d78ad9687ddf2cbc
Last active August 29, 2015 14:10
ansible python 2.6 test failures
❯ tox
GLOB sdist-make: /Users/marca/dev/git-repos/ansible/setup.py
py26 recreate: /Users/marca/dev/git-repos/ansible/.tox/py26
py26 installdeps: Jinja2, mock, nose, passlib, PyCrypto, PyYAML, unittest2
py26 inst: /Users/marca/dev/git-repos/ansible/.tox/dist/ansible-1.9.zip
py26 runtests: PYTHONHASHSEED='587768245'
py26 runtests: commands[0] | nosetests -d -w test/units
..............................................................................................E......................................................................................E...............................................
======================================================================
ERROR: test.units.TestModuleUtilsDatabase.TestQuotePgIdentifier.test_how_many_dots
exporting patches:
# HG changeset patch
# User Marc Abramowitz <marc@marc-abramowitz.com>
# Date 1418102744 28800
# Branch markdown-readme-1
# Node ID 1b4f37c1b9f6839c4c835cbe1a38f2017fa014ec
# Parent 58c3f40321becbbcb3ac2b28cd4995931bf2a332
Add tests for markdown rendering
diff --git a/tests/test_description_utils_markdown.py b/tests/test_description_utils_markdown.py
@msabramo
msabramo / gist:b2f73bb72e4a4c2cab73
Created December 17, 2014 16:16
tox error with Python 3
[marca@marca-mac2 readme]$ tox -r -e py33
GLOB sdist-make: /Users/marca/dev/git-repos/readme/setup.py
py33 create: /Users/marca/dev/git-repos/readme/.tox/py33
ERROR: invocation failed (exit code 1), logfile: /Users/marca/dev/git-repos/readme/.tox/py33/log/py33-0.log
ERROR: actionid=py33
msg=getenv
cmdargs=['/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python', '-mvirtualenv', '--setuptools', '--python', '/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3', 'py33']
env={'GOPATH': '/Users/marca/go', 'VIRTUAL_ENV_DISABLE_PROMPT': '1', 'LESS_TERMCAP_md': '\x1b[01;31m', 'HOMEBREW_CASK_OPTS': '--appdir=/Applications', 'rvm_niceness': '', 'LESS': '-F -g -i -M -R -S -w -X -z-4', 'rvm_gemstone_package_file': '', 'rvm_path': '/Users/marca/.rvm', 'LESSOPEN': '| /usr/bin/env lesspipe.sh %s 2>&-', 'TMPDIR': '/var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/', 'RUBY_VERSION': 'ruby-2.1.2', 'DOCKER_HOST': 'tcp://172.16.42.43:4243', 'LOGNAME': 'marca', 'USER': 'marca', 'r
@msabramo
msabramo / gist:6a321caa5e21e3ec03f8
Created December 17, 2014 16:23
virtualenv error Python 3
❯ /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -mvirtualenv --setuptools --python /Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3 py33
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 41, in <module>
import ConfigParser
ImportError: No module named 'ConfigParser'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
@msabramo
msabramo / gist:b3a12a570e49fd1a1858
Created December 17, 2014 16:27
virtualenv error creating py3 env
❯ virtualenv --python python3.3 py33
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 41, in <module>
import ConfigParser
ImportError: No module named 'ConfigParser'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):