Skip to content

Instantly share code, notes, and snippets.

@rcarmo
rcarmo / gist:01ecea6a5e93e0de89d8d5d4c411638b
Created August 20, 2016 18:05 — forked from tofarley/gist:8285845
My Blender render farm ansible playbook.
---
- name: Create render slaves on Rackspace Cloud
hosts: renderslaves
user: root
connection: local
gather_facts: False
tasks:
- name: Provision a set of instances
local_action:
module: rax
@rcarmo
rcarmo / gist:4255864f2755636b22cc29a8c2c9230b
Created August 9, 2016 13:59 — forked from tonymtz/gist:714e73ccb79e21c4fc9c
Uninstall XQuartz.app from OSX El Capitan
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
/*
Example code to get a MCP3*08 running with an ESP8266
for DiY energy monitoring solutions
*/
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "MCP3208.h"
const char* ssid = "...";
const char* host = "...";
@rcarmo
rcarmo / decorator.py
Created March 5, 2016 19:23 — forked from j0lvera/decorator.py
bottle.py basic auth examples
from bottle import route, run, auth_basic
from passlib.hash import sha256_crypt
def check_pass(username, password):
hashed = ''.join(redis.hmget(username, "password"))
return sha256_crypt.verify(password, hashed)
@route('/', method='GET')
@auth_basic(check_pass) # <-- decorator
def index():
@rcarmo
rcarmo / event_hubs_send.py
Created February 2, 2016 11:01 — forked from tomconte/event_hubs_send.py
Send messages to an Azure Event Hub using the Apache Qpid Proton AMQP library.
#!/usr/bin/python
# Send messages to an Azure Event Hub using the Apache Qpid Proton AMQP library.
import sys
import commands
from proton import *
# Event Hub address & credentials
# amqps://<keyname>:<key>@<namespace>.servicebus.windows.net/<eventhubname>
[
{
"action": {
"type": "block"
},
"trigger": {
"url-filter": ".*",
"resource-type": ["script"],
"load-type": ["third-party"],
"if-domain": ["imore.com"]
@rcarmo
rcarmo / default
Last active August 29, 2015 14:23 — forked from mzsanford/default
# Set the peer listening address
# export ETCD_PEER_ADDR=127.0.0.1:7001
# Set other command line options like the name and discovery url
# from https://discovery.etcd.io/new
# export ETCD_OPTS="-name=name_here -discovery=https://discovery.etcd.io/token_here"
export ETCD_OPTS="--data-dir '/var/run/default.etcd'"
{
"lines.linewidth": 2.0,
"examples.download": true,
"patch.linewidth": 0.5,
"legend.fancybox": true,
"axes.color_cycle": [
"#30a2da",
"#fc4f30",
"#e5ae38",
"#6d904f",
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!
# Go to dropbox.com/developers/apps to create an app.
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
# access_type can be 'app_folder' or 'dropbox', depending on
# how you registered your app.
access_type = 'app_folder'