Skip to content

Instantly share code, notes, and snippets.

View emilisto's full-sized avatar

Emil Stenqvist emilisto

  • Stockholm
View GitHub Profile
class people::emilisto {
#include osx::chsh
include macvim
include firefox
include chrome
include slate
# Skype is Broken!
# include skype
# I am the walrus
```
$ eat_my_bucket
...
```
@emilisto
emilisto / env.sh
Last active December 16, 2015 02:49
#!/bin/bash
#
# env.sh
#
# Convenience script for loading and unloading a custom shell environment. I
# use it with projects to setup paths e.g. the Django manage script, and
# activating the Python virtualenv.
#
# Author: Emil Stenqvist <[email protected]>
#
var esprima = require('esprima')
, readit = require('readit')
, traverse = require('traverse')
, code = readit()
, prettyjson = require('prettyjson')
, _ = require('underscore')
, path = require('path')
, optimist = require('optimist')
;
$ node scope.js
6Hz: 4048
214Hz: 4048

Mathias

There are actually two different ways of achieving concurrency in Go:

Nice format:

import (
  "fmt"
)
@emilisto
emilisto / config.js
Last active December 19, 2015 01:19
Installing Graphite on Ubuntu 12.10. Sadly, it's 2013, and this is the quickest procedure I could come up with. Special criticism goes out to the packaging of Graphite, Carbon and pycairo. Anyhow, see the `install.sh`, it's meant to read as copy-think-and-paste instructions.
{
graphitePort: 2003,
graphiteHost: "localhost",
port: 8125,
backends: [ "./backends/graphite" ]
}
## lib.sls
# Shorthand macro for getting pillar data
{% macro p(key, default='') -%}
{{ salt['pillar.get'](key, default) }}
{%- endmacro %}
## Usage
{% from 'lib.sls' import p with context %}
{{ p('git:url', '[email protected]') }}
@emilisto
emilisto / ec2_tags.py
Last active March 15, 2019 17:07
Grain for Salt that exposes all EC2 instance tags in grains['tags'], free for all to use and distribute. Tweet me @svammel if you have questions.
"""
ec2_tags - Exports all EC2 tags in a 'tags' grain
For Salt (http://saltstack.org)
Author: Emil Stenqvist <[email protected]>
Usage:
1. Put ec2_tags.py in roots/_grains/
@emilisto
emilisto / retry.sh
Last active December 20, 2015 03:19
Little bash script that re-runs a command until it exits with code 0, i.e. runs successfully. I get impatient when SSH'ing to new servers...
#!/bin/bash
# Examples:
#
# When's the damn thing online?
#
# $ retry.sh ssh [email protected]
#
# When's internet back?
#