Skip to content

Instantly share code, notes, and snippets.

@mischief
mischief / resolved.sh
Created July 13, 2015 18:44
enable resolved dns caching on coreos (run as root)
#!/bin/sh -e
cp /etc/nsswitch.conf /etc/nsswitch.conf.new
mv /etc/nsswitch.conf.new /etc/nsswitch.conf
sed -ri "s/(^hosts: files usrfiles)/\1 resolve/" nsswitch.conf
commit bbc0e222b9223660239f58f74b1b7233a3cffee5
Author: Nick Owens <[email protected]>
Date: Thu Dec 10 13:40:17 2015 -0800
core: check owner after creating matcher
diff --git a/src/core/unit.c b/src/core/unit.c
index 43a5ca1..4561825 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@mischief
mischief / etcd-rejoin-member.sh
Last active January 29, 2016 21:57
rejoining an etcd2 member after a reboot in a pxe booting cluster
#!/bin/sh
set -eo pipefail
usage(){
echo usage: $0 etcdmember newmember
exit 1
}
checkhost(){
@mischief
mischief / templater.go
Created February 29, 2016 03:48
go templater
package main
import (
"bytes"
"flag"
"io"
"io/ioutil"
"log"
"os"
"strings"
@mischief
mischief / Makefile
Created February 29, 2016 03:50
coreos templates via makefile
CTX=etcd.yaml.tmpl.ctx
etcd: CONFS=$(addsuffix .json, $(shell cat .hosts))
etcd: $(CTX) $(ROOT)/bin/templater .hosts
make $(CONFS)
install: CONFS=$(addsuffix .json, $(shell cat .hosts))
install: etcd .hosts
scp $(CONFS) $(CONFIG_TARGET)/ignition/
@mischief
mischief / coreos-cloudinit.yml
Created March 3, 2016 22:37
locksmith on a single node with a reboot window
coreos:
update:
reboot-strategy: "reboot"
locksmith:
window-start: "14:00"
window-length: "2h"
@mischief
mischief / coreos-install.go
Created March 29, 2016 04:53
coreos-install in go
package main
import (
"bytes"
"compress/bzip2"
"flag"
"fmt"
"io"
"net/http"
"os"
@mischief
mischief / grub.cfg
Created April 15, 2016 00:00
nice console resolution in coreos via grub
set gfxmode=1920x1080
set gfxpayload=keep
terminal_output gfxterm
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=5
inherit games versionator
DESCRIPTION="Cataclysm - Dark Days Ahead"
HOMEPAGE="http://en.cataclysmdda.com/"
@mischief
mischief / 90-token.conf
Created May 25, 2016 22:09
override cloudconfig discovery token
# /etc/systemd/system/etcd2.service.d/90-token.conf
[Service]
Environment="ETCD_DISCOVERY=https://discovery.etcd.io/12345678901234567890123456789012"