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
"""A notebook manager that uses S3 storage. (based on the Azure manager) | |
http://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html#using-a-different-notebook-store | |
Drop this file in IPython/frontend/html/notebook | |
1. Create a new notebook profile - ipython profile create nbserver | |
2. edit ~/.ipython/profile_nbserver/ipython_notebook_config.py | |
3. Add these lines: | |
c.NotebookApp.notebook_manager_class = 'IPython.frontend.html.notebook.s3nbmanager.S3NotebookManager' |
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
import ssl | |
import boto | |
import socket | |
GOOD_CERT="/opt/anaconda/lib/python2.7/site-packages/requests/cacert.pem" | |
BAD_CERT="/opt/anaconda/lib/python2.7/site-packages/boto/cacerts/cacerts.txt" | |
HOST="ec2.us-west-1.amazonaws.com" | |
PORT=443 |
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
""" | |
Need to run `ping google.com >> /tmp/google.txt` in another terminal. | |
""" | |
import re | |
from bokeh.plotting import * | |
from bokeh.plotting import line | |
from bokeh.objects import GlyphRenderer | |
MAX_HISTORY = 1000 | |
output_server("ping") |
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
Dockerfile: | |
=============== | |
FROM ubuntu | |
MAINTAINER bkreider | |
ADD return1.sh /root/return1.sh | |
ADD return0.sh /root/return0.sh | |
CMD ["/root/return1.sh"] | |
================= |
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 setup_stunnel(): | |
sudo("rm -f /etc/stunnel/stunnel.conf") | |
put("stunnel.conf", "/etc/stunnel/stunnel.conf", use_sudo=True) | |
sudo("rm -f /etc/init.d/stunnel") | |
put("stunnel", "/etc/init.d/stunnel", use_sudo=True) | |
sudo("chkconfig stunnel on") | |
with settings(warn_only=True): | |
sudo("mkdir -p /var/run/stunnel") | |
sudo("chown nobody:nobody /var/run/stunnel") |
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 configure_vzkernel(): | |
def run_in_vz(veid, cmd): | |
# Use pty so commands with sudo in them work | |
sudo("vzctl exec %s '%s'" % (veid, cmd), pty=True) | |
log.info("Downloading Centos6 VZ template") | |
sudo("wget http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz") | |
sudo("mv centos-6-x86_64.tar.gz /vz/template/cache") | |
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
# http://stackoverflow.com/questions/12544056/how-to-i-get-the-current-ipython-notebook-name | |
import json | |
import os | |
import urllib2 | |
import IPython | |
from IPython.lib import kernel | |
connection_file_path = kernel.get_connection_file() | |
connection_file = os.path.basename(connection_file_path) | |
kernel_id = connection_file.split('-', 1)[1].split('.')[0] |
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 | |
# | |
# remote ipython: | |
# | |
# This starts a remote ipython kernel. Downloads the kernel connection file, | |
# and starts a local ipython console connected to the remote machine. | |
# | |
# Features: | |
# - Automatically starts remote kernel | |
# - Copies remote file into ~/.ripython/<hostname.json> |
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
#!/opt/anaconda/bin/python | |
""" | |
Check to see if the build number conflicts with a local built package. If | |
so, set the ENVIRON variable BINSTAR_BUILD with a non-conflicting number | |
""" | |
import os | |
import sys | |
import os.path | |
import subprocess |
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
#!/usr/bin/env python | |
import os | |
import sys | |
import stat | |
import os.path | |
import getpass | |
def walktree(top, callback): |
OlderNewer