Skip to content

Instantly share code, notes, and snippets.

View ipmb's full-sized avatar

Peter Baumgartner ipmb

View GitHub Profile
REPO=$1
ORG=mycorp
git clone git@github.com:$ORG/$REPO.git
cd $REPO
for remote in `git branch -r | grep -v HEAD`; do git checkout --track $remote; done
git remote add bitbucket git@bitbucket.org:$ORG/$REPO.git
git push --all bitbucket
@ipmb
ipmb / hash_benchmark.py
Last active September 27, 2020 16:54
Test speeds of different Django password hashing functions
#!/usr/bin/env python
import os
import time
from django.contrib.auth.hashers import make_password
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
class Timer(object):
def __init__(self, name, iterations):
self.name = name
@ipmb
ipmb / lesson0.ipynb.json
Last active December 15, 2015 08:39
IPython Notebook & IPython Blocks: Lesson 0
{
"metadata": {
"name": "Lesson 0"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@ipmb
ipmb / gist:6249825
Last active December 21, 2015 04:29 — forked from kennethlove/gist:6233919
Web Generalist at Lincoln Loop

Lincoln Loop is looking for a web generalist to join our ranks. We have lots of domain experts, but need someone who can tie up the loose ends. A strong knowledge of CSS and HTML is required along with a working knowledge of JavaScript and Python. You should have a year or so of experience building clean cross-browser interfaces and be familiar with responsive design techniques for mobile.

Bonus points for experience/knowledge in:

  • CSS Preprocessors (SASS or LESS)
  • Django
  • Backbone or similar JS framework
  • Visual design

We're a fully distributed company where everyone sets their own hours and salary. You can learn more about how we operate at http://lincolnloop.com/blog/categories/business/. This is a full-time position. If you feel like you're a good fit, tell us about yourself at jobs+generalist@lincolnloop.com.

@ipmb
ipmb / gist:6295311
Created August 21, 2013 14:36
Webkit full screen bookmarklet
javascript:document.documentElement.webkitRequestFullScreen();
@ipmb
ipmb / schedule.sls
Created December 17, 2013 18:05
Sample schedule pillar for Salmon
{% set minutes = 5 %}
{% set returner = "salmon_return" %}
schedule:
# all servers no args
{% for func in ['ps.physical_memory_usage', 'ps.virtual_memory_usage', 'ps.disk_io_counters', 'ps.network_io_counters'] %}
stat{{ loop.revindex }}:
function: {{ func }}
minutes: {{ minutes }}
returner: {{ returner }}
@ipmb
ipmb / article.md
Last active August 29, 2015 14:01
Wired.jp New Work Style article translation

A proposal from the creator of "a company without an office": recommending a work style that allows you to live wherever you want

The staff at Lincoln Loop, a company that doesn't have any office, are free to choose wherever they want to work, in addition to wherever they want to live. No two of them live in the same place: France, Sweden, Portugal, and New Zealand, among others. The founder has tried to prove that in spite of differences in location, the staff can still come together as a company. He says that the work style of the future will "allow you to live where you want" before any other considerations.

Text by WIRED.jp_M
Photographs courtesy of Peter Baumgartner & Editory

Peter Baumgartner

import logging
from functools import wraps
from django.core.cache.backends.memcached import PyLibMCCache
logger = logging.getLogger(__name__)
def fault_tolerant_wrapper(f):
@wraps(f)
def wrapper(*args, **kwargs):
@ipmb
ipmb / nginx.conf
Created October 22, 2014 16:31
Hack to put Google auth in front of Kibana and ES
upstream elasticsearch {
# google auth proxy -> elasticsearch
server 127.0.0.1:9201;
}
server {
root /path/to/kibana;
# insert standard Nginx boilerplate...
@ipmb
ipmb / ratelimit.nginxconf
Last active April 5, 2024 00:46
Nginx reverse proxy with rate limiting
upstream myapp {
server 127.0.0.1:8081;
}
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
server {
listen 443 ssl spdy;
server_name _;