Skip to content

Instantly share code, notes, and snippets.

View rgbkrk's full-sized avatar
🌎
Think globally, act locally

Kyle Kelley rgbkrk

🌎
Think globally, act locally
View GitHub Profile
@rgbkrk
rgbkrk / api.yaml
Created August 27, 2015 03:28
notebook api
swagger: '2.0'
info:
title: Jupyter Notebook API
description: Notebook API
version: "4"
contact:
name: Jupyter Project
url: jupyter.org
# will be prefixed to all paths
basePath: /api
@rgbkrk
rgbkrk / .travis.yml
Last active August 29, 2015 13:55
Travis CI for Salt States
language: python
python:
- '2.7'
before_install:
# Make sure we're in a good state, then install salt via salt bootstrap
# -- Development mode, because danger is fun (I mean, it's good to stay up to date with salt)
- sudo apt-get update
- curl -L http://bootstrap.saltstack.org | sudo sh -s -- git develop
@rgbkrk
rgbkrk / summarize_containers.py
Last active August 29, 2015 13:56
CloudFiles Summary in ORD
# The Rackspace SDK for Python
import pyrax
# For printing pretty byte totals
import humanize
pyrax.set_setting("identity_type", "rackspace")
pyrax.set_credentials(USER, APIKEY) # Replace these or use a credential file
cf = pyrax.connect_to_cloudfiles(region="ORD")
roles:
- webserver
- memcache
environment: prod
host: rackspace
@rgbkrk
rgbkrk / winrm.md
Last active August 29, 2015 13:56
[WIP] Orchestrating Windows Boxes to do Windows Builds

WinRM (Windows Remote Management) lets us manage a Windows box remotely. The WinRM service is already installed and running on Windows Server 2008+.

However, no WinRM listener is configured (see Microsoft's article on WinRM configuration).

Enable WinRM on the box

On the box over Remote Desktop (sadly), open a cmd prompt/powershell and run

winrm quickconfig
@rgbkrk
rgbkrk / logrip.md
Last active August 29, 2015 13:56
Ripping logs from salt minions

Need a rapid way of pulling your logs back using salt? With one config option in /etc/salt/master and two quick commands, you can do this in parallel across your boxes.

First, use archive.tar to tarball up your logs

salt '*' archive.tar cvzf /tmp/logs.tgz /var/log/

Next up, cp.push to pull the logs back from the minions up to the master

In order to use cp.push, you'll need to set file_recv to True within /etc/salt/master.

@rgbkrk
rgbkrk / songthatneverends.ipynb
Last active August 29, 2015 13:56
Long text test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rgbkrk
rgbkrk / chicken registered.md
Last active August 29, 2015 13:56
Register the chicken
13:25:03 ~/code$ cookiecutter https://github.com/audreyr/cookiecutter-pypackage.git
config_path is /Users/kyle6475/.cookiecutterrc
You've cloned /Users/kyle6475/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-clone it? [Y/n] y
Cloning into 'cookiecutter-pypackage'...
remote: Reusing existing pack: 297, done.
remote: Total 297 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (297/297), 47.40 KiB | 0 bytes/s, done.
Resolving deltas: 100% (140/140), done.
Checking connectivity... done
# This was the order I installed things for a working scientific computing environment on my Mac.
brew install python
pip install virtualenv virtualenvwrapper
# Also add these to your ~/.bash_profile:
export PATH=/usr/local/bin:/usr/bin:$PATH
source /usr/local/bin/virtualenvwrapper.sh
# Not necessary, but quite nice
@rgbkrk
rgbkrk / novaswift.sh
Created March 4, 2014 02:28
Nova and Swift cred layout for Rackspace
# Nova Client Settings
OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
OS_VERSION=2.0
OS_AUTH_SYSTEM=rackspace
OS_REGION_NAME=IAD
OS_SERVICE_NAME=cloudserversOpenStack
OS_TENANT_NAME=<TENANT_ID>
OS_NO_CACHE=1
OS_USERNAME=<USERNAME>
OS_PASSWORD=<API_KEY>