Skip to content

Instantly share code, notes, and snippets.

View hmalphettes's full-sized avatar

Hugues Malphettes hmalphettes

  • Standard Chartered Bank
  • Singapore
  • 19:21 (UTC +08:00)
View GitHub Profile
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/stuff
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
units:
- name: fleet-metadata.service
command: start
@skippy
skippy / cloud-config.yml
Created December 31, 2014 18:38
modifying fleet metadata (from aws meta-data service) before fleet.service start; this is a proof of concept (but it works!)
#cloud-config
---
coreos:
units:
- name: update-fleet-metadata.service
command: start
content: |-
[Unit]
Description=Update Fleet metadata tag
Before=fleet.service
@nolanlawson
nolanlawson / pouch_for_leveldown.md
Last active July 28, 2020 19:19
PouchDB for LevelDOWN authors

PouchDB for LevelDOWN authors

Introduction

Who are you? You're the author of a LevelDOWN-compatibile module, such as MemDOWN, FooDOWN, BarDOWN, whatever.

What do you want? A super-sweet module that passes the grueling 1,000+ tests in the PouchDB test suite. This guide will help get you there.

@richp10
richp10 / gist:1c367d3c67aec762788e
Created May 10, 2014 10:19
Secure iptables configuration for coreos ??
// This systemd runs iptables-restore on boot:
[Unit]
Description=Packet Filtering Framework
DefaultDependencies=no
After=systemd-sysctl.service
Before=sysinit.target
[Service]
Type=oneshot
ExecStart=/usr/sbin/iptables-restore /opt/docker/scripts/iptables/iptables.rules
var BVT = function(width, depth, init, elems) {
this._width = width;
this._depth = depth;
this._leaf = depth === 1;
this._shift = (this._depth - 1) * Math.round(Math.log(width) / Math.log(2));
this._himask = this._width - 1;
this._lomask = Math.pow(2, this._shift) - 1;
this._elems = elems;
@ismell
ismell / README.md
Last active September 10, 2016 15:39
Docker Ubuntu upstart scripts

Production Ready Process Monitoring

  1. Install docker-manger.conf and docker-instance.conf in /etc/init

  2. Create a containers file in /etc/docker/ with the following format

     name: image cmd
    

    The name must be unique.

  3. sudo service docker-manager start

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@jboner
jboner / latency.txt
Last active April 26, 2024 03:40
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD