Skip to content

Instantly share code, notes, and snippets.

View alexellis's full-sized avatar
📖
Check out my eBook on Go

Alex Ellis alexellis

📖
Check out my eBook on Go
View GitHub Profile
@joewalnes
joewalnes / test.pde
Created December 17, 2011 23:33
atmega32u4, leonardo, i2c and serial problem
#include "Wire.h"
#define DS1307_ADDRESS 0x68
struct DateTime {
int second;
int minute;
int hour;
int weekDay;
int monthDay;
@estesp
estesp / clash-instructions.md
Last active August 12, 2016 18:25
Ubuntu 16.04 / LXFS / Docker daemon + user namespaces clash

The Problem

See Docker issue #24834 for the more complete background. The short story is that if lxcfs is installed (which it is by default in Ubuntu 16.04) and you attempt to use the Docker daemon with user namespaces enabled, most likely you will end up with a confusing "container command could not be invoked error" like the one here:

# docker run --rm busybox date
docker: Error response from daemon: Container command 'date' could not be invoked..
@tylertreat
tylertreat / benchmark.go
Last active January 24, 2017 22:20
Redis and NATS Benchmark
package main
import (
"flag"
"fmt"
"os"
"time"
"github.com/gocql/gocql"
"github.com/nats-io/nats"
@alexellis
alexellis / init.sh
Last active June 12, 2017 13:28
CloudInit for FaaS
#!/bin/bash
curl -sSL get.docker.com | sh
systemctl start docker
site=$(curl -s https://api.ipify.org/?format=text); echo $site; docker swarm init --advertise-addr=$site
cd /root/
git clone https://github.com/alexellis/faas
cd faas
# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |
@tonistiigi
tonistiigi / paint_status.go
Created September 16, 2017 00:39 — forked from alexellis/paint_status.go
paint_status.go
package main
import (
"fmt"
"os/exec"
"strings"
"sync"
"github.com/morikuni/aec"
)
@ecliptik
ecliptik / bucketbench-output-docker.md
Last active September 16, 2017 21:44
Bucketbench on Packet.net Type 2A Instance with Docker v17.07.0-ce

Results

./bucketbench --log-level=debug run -b examples/docker.yaml threads: 3

SUMMARY TIMINGS/THREAD RATES           

                      Iter/Thd    1 thrd   2 thrds   3 thrds   4 thrds   5 thrds   6 thrds   7 thrds   8 thrds   9 thrds  10 thrds                           
               Limit      1000    218.64    314.52    353.42    354.66    347.47    318.98    302.99    289.11    282.92    273.01                           
@danigian
danigian / Get OpenFaaS on ACS.md
Last active September 26, 2017 16:11
Get OpenFaaS running on Azure Container Service with Kubernetes

Get OpenFaaS running on Azure Container Service with Kubernetes

Pre-requisites

Deploying ACS with Kubernetes

OpenFaas on Google Container Engine

Setting up faas-netes cli

TODO: add this step combine with https://github.com/openfaas/faas-netes/blob/master/HELM.md

gcloud container clusters get-credentials ${CLUSTER-NAME} --zone us-central1-a --project ${PROJECT-ID}
git clone https://github.com/openfaas/faas-netes
cd faas-netes
@h-a-t-zz
h-a-t-zz / Dockerfile
Last active November 10, 2017 22:57
nmap RCE
FROM alexellis2/faas-alpinefunction:latest
RUN apk update && apk add nmap
ENV fprocess="xargs nmap"
CMD ["fwatchdog"]