Skip to content

Instantly share code, notes, and snippets.

View kelseyhightower's full-sized avatar

Kelsey Hightower kelseyhightower

View GitHub Profile
@kelseyhightower
kelseyhightower / gist:9146173
Created February 21, 2014 23:50
csv2json-cli
$ ./main -infile famous-gophers.csv
[
{
"Date": "1947",
"Name": "Mac",
"Title": "The Goofy Gophers"
},
{
"Date": "1947",
"Name": "Tosh",
#!ipxe
set coreos-version dev-channel
set base-url http://storage.core-os.net/coreos/amd64-generic/${coreos-version}
kernel ${base-url}/coreos_production_pxe.vmlinuz root=squashfs: state=tmpfs: sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQC2PxAKTLdczK9+RNsGGPsz0eC2pBlydBEcrbI7LSfiN7Bo5hQQVjki+Xpnp8EEYKpzu6eakL8MJj3E28wT/vNklT1KyMZrXnVhtsmOtBKKG/++odpaavdW2/AU0l7RZiE= coreos pxe demo"
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
boot

Apache Apollo SSL

Creating a keystore using an existing SSL cert

Create a certificate bundle

Create a single cert bundle that includes the wildcard cert and key, also include any required intermediate certs.

cat /etc/os-release
NAME=CoreOS
ID=coreos
VERSION=282.0.0
VERSION_ID=282.0.0
BUILD_ID=
PRETTY_NAME="CoreOS 282.0.0"
ANSI_COLOR="1;32"
HOME_URL="http://www.coreos.com/"
# journalctl -b
-- Logs begin at Sat 2014-04-12 21:00:35 UTC, end at Sat 2014-04-12 21:03:51 UTC. --
Apr 12 21:00:35 localhost systemd-journal[58]: Runtime journal is using 8.0M (max allowed 99.9M, trying to leave 149.9M free of 991.6M a
Apr 12 21:00:35 localhost systemd-journal[58]: Runtime journal is using 8.0M (max allowed 99.9M, trying to leave 149.9M free of 991.6M a
Apr 12 21:00:35 localhost kernel: Initializing cgroup subsys cpuset
Apr 12 21:00:35 localhost kernel: Initializing cgroup subsys cpu
Apr 12 21:00:35 localhost kernel: Initializing cgroup subsys cpuacct
Apr 12 21:00:35 localhost kernel: Linux version 3.13.8+ (buildbot@ip-10-221-137-94) (gcc version 4.6.3 (Gentoo Hardened 4.6.3 p1.13, pie
Apr 12 21:00:35 localhost kernel: Command line: root=squashfs: state=tmpfs: sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHo+5nVpxDhnWB
Apr 12 21:00:35 localhost kernel: Disabled fast string operations
#!ipxe
set filename http://192.168.12.1:4777
dhcp
:retry_chain
chain ${filename}?profile=${serial} || sleep 5
chain ${filename}?profile=${uuid} || sleep 5
chain ${filename}?profile=${net0/mac} || sleep 5 && goto retry_chain
upstream app {
{{range $server := GetDir "upstream"}}
server {{$server.Value}};
{{end}}
}
server {
server_name www.example.com;
location / {
Running CoreOS outside of the Cloud with iPXE
Kelsey Hightower
CoreOS runs pretty much everywhere, but running it effectively outside of the cloud can be a challenge using traditional tooling. We’ll take a look at the various ways to boot a machine via iPXE and how to leverage cloud-config to automate machine initialization.
journalctl -u etcd
-- Logs begin at Mon 2014-06-09 07:08:04 UTC, end at Mon 2014-06-09 18:28:48 UTC. --
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.214 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.264 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.314 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.364 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.414 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.464 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd[3202]: [etcd] Jun 9 07:08:04.514 WARNING | [ss] Error: nil response
Jun 09 07:08:04 core3.c.hightower-labs.internal etcd
#!/bin/ruby
require 'yaml'
raw_data =
%Q{
apps:
appname:
workgroup1:
data: