Skip to content

Instantly share code, notes, and snippets.

@jarv
jarv / gist:2936255
Created June 15, 2012 12:36
ungenerated certs
$ ./manage.py find_ungenerated
Ungenerated certificates: 1
userid name
---------- ----------
1 john jarvis
define user_manage(
$ensure = 'present'
) {
if $ensure == 'absent' {
User[$name] -> Group[$name]
}
user { $name:
ensure => $ensure,
host <internal address>
ProxyCommand ssh -W %h:%p <jumpbox address>
ForwardAgent yes
IdentityFile <path/to/key>
User <username>'
@jarv
jarv / gist:7484570
Created November 15, 2013 13:49
devstack dosa release
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'edx-devstack'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
Pruning invalid NFS exports. Administrator privileges will be required...
@jarv
jarv / gist:7775280
Last active December 30, 2015 04:19
- name: check out code
git: dest=path/to/dest repo=some_repo version=master
environment:
GIT_SSH: /tmp/git_ssh.sh
git_ssh.sh:
#!/bin/sh
exec /usr/bin/ssh -o StrictHostKeyChecking=no -i /path/to/git-identity "$@"
- name: checkout code
git: dest={{ dir }} repo={{ repo }}
environment:
GIT_SSH: /tmp/git_ssh.sh
/tmp/git_ssh.sh
#!/bin/sh
exec /usr/bin/ssh -o StrictHostKeyChecking=no -i {{ git_identity }} "$@"
instance_tags:
environment: sandbox
github_username: jarv
Name: jarv-sandbox
...
- name: Launch ec2 instance
local_action:
@jarv
jarv / gist:4ed9e6faa374a99acbc8
Created September 12, 2014 16:28
edx xqueue
The XQueue software is one of our earliest components and not very
well documented unfortunately.
What it is from a high level is a Django app that monitors a rabbitMQ
cluster that takes student submissions and makes it available to an
external grader.
Here is example code that watches the xqueue for new submissions and
grades them using our python grader -
https://github.com/edx/xqueue-watcher
Here is documentation that describes how to interface with xqueue -
@jarv
jarv / fa-ublock-adblock-workaround
Created January 16, 2015 18:42
fontawesome ublock adblock workaround
.my-fa-facebook:before {
content: "\f09a";
}
.my-fa-facebook-square:before {
content: "\f082";
}
.my-fa-flickr:before {
content: "\f16e";
}
.my-fa-google-plus-square:before {
@jarv
jarv / generate-wc
Created November 5, 2015 22:47
Generate wordcloud of TPP
from os import path
from scipy.misc import imread
import matplotlib.pyplot as plt
import random
import os
from wordcloud import WordCloud, STOPWORDS
text = ""
for f in os.listdir("."):