Skip to content

Instantly share code, notes, and snippets.

View jonasfj's full-sized avatar

Jonas Finnemann Jensen jonasfj

View GitHub Profile
@jonasfj
jonasfj / s3-read-only-IAM-policy.json
Created June 25, 2014 16:36
IAM policy for read-only access to the `telemetry-published-v1` bucket.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1400030942000",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
@jonasfj
jonasfj / auth.js
Last active August 29, 2015 14:04 — forked from lightsofapollo/auth.js
/**
* Create a client class from a JSON reference.
*
* Returns a Client class which can be initialized with following options:
* options:
* {
* // TaskCluster credentials, if not provided fallback to defaults from environment variables
* // if defaults are not explicitly set with taskcluster.config({...})
* // To create a client without authentication (and not using defaults) use `credentials: {}`
* credentials: {
@jonasfj
jonasfj / bitfield.h
Created July 31, 2014 18:28
bitfield and graph structures from bnc, for priorityqueue and directedgraph amongst things like triangulation algorithms see: http://jonasfj.dk/blog/2010/12/triangulation-project/
#ifndef CONFIG_H
#define CONFIG_H
#include <stdint.h>
#include <vector>
#include <string.h>
#ifndef __ICC
#include <tr1/unordered_map>
#else
#include <hash_map>
@jonasfj
jonasfj / README.md
Last active August 29, 2015 14:08
Pulse Publishing Example

Pulse Publishing Example

We really should consider moving this to a library.

Dependencies: (works if installed with in virtualenv)

  • kombu
  • jsonschema
@jonasfj
jonasfj / README.md
Last active July 13, 2018 01:06
Comparison of tweetnacl, tweetnacl-fast, node-sodium and js-nacl for node.js

Tests and Benchmarks for Node Ed25519 libraries and bindings

Mainly looking at using this for signing HTTP(S) requests, as a replacements for HMAC-SHA256, which requires symmetric keys.

Note, we want to this work in browser, python and node. But we only really care about performance in node. Clients that sign request, usually don't make hundreds of these per second. And python servers are slow anyways :)

So if it's fast server side on node, when deployed correctly (ie. without

@jonasfj
jonasfj / aws-results.csv
Last active August 29, 2015 14:17
Preliminary results from talos experiments in the cloud, see: https://github.com/jonasfj/talos-experiments
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 1 column, instead of 2 in line 7.
Score is a relative measure of stability.
It's basically:
for each test case:
Rank configurations by lowest std.dev.
for each configuration:
compute score as mean over ranks assigned in test-cases
(this needs a little improvement)
c4.2xlarge/us-west-1/xorg/a4d43797b065, 12.090476190476192
{
"provisionerId": "aws-provisioner",
"workerType": "rustbuild",
"schedulerId": "-",
"retries": 5,
"created": "2015-03-24T17:55:22.372Z",
"deadline": "2015-03-24T18:55:22.372Z",
"scopes": [],
"payload": {
"image": "ubuntu:14.04",
./analysis/node_modules/.bin/babel-node -r \
./analysis/rank-configs-by-ability;
### Comparing Tests Using: mozilla-inbound-non-pgo
tp5o: 273.50 271.24
tart: 3.78 4.91
cart: 31.78 40.00
tsvgr_opacity: 254.00 254.28
tsvgx: 258.27 262.99
tscrollx: 9.56 9.84
@jonasfj
jonasfj / main.js
Created July 6, 2015 07:28
Initial hack for interactive tutorials...
var util = require('util');
var slugid = require('slugid');
var ace = require('brace');
require('brace/mode/javascript');
require('brace/theme/ambiance');
var babel = require('babel-core/lib/babel/api/browser');
// Babel runtime part we use
require('babel-runtime/regenerator');
require('babel-runtime/core-js/promise');
#!/bin/bash -e
# Test AWS credentials
if [ "$AWS_ACCESS_KEY_ID" == "" ] ; then
echo "Missing credentials";
exit 1;
fi
# Find public IP of hostname
IP=`dig +short $1`;