Skip to content

Instantly share code, notes, and snippets.

View philips's full-sized avatar
👨‍💻
at the keebs

Brandon Philips philips

👨‍💻
at the keebs
View GitHub Profile
# Automatically generated, do not edit
modules=( "ifconfig" )
# Label public
config_eth0=(
"192.0.2.42 netmask 255.255.255.0"
)
routes_eth0=(
"default via 192.0.2.1"
)
# _/Users/philips/trees/etcd-client
./delete.go:37: undefined: pathPrefix
./set.go:47: undefined: pathPrefix
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /2013/
RewriteCond %{REQUEST_URI} /2013/ocw.*
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /2013/index.php [L]
</IfModule>
$ git ls-tree
100644 blob 9beaed0ed620b31495a89c79fd12f7f926f7d902 README
$ git show 9beaed0ed620b31495a89c79fd12f7f926f7d902 | head [17:16:00]
Linux kernel release 3.x <http://kernel.org/>
These are the release notes for Linux version 3. Read them carefully,
as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong.
type EtcdError struct {
ErrorCode int `json:"errorCode"`
Message string `json:"message"`
Cause string `json:"cause,omitempty"`
}
func (e *EtcdError) Error() string { return fmt.Sprintf("%i: %s (%s)", ErrorCode, Message, Cause) }
@philips
philips / gist:6142204
Last active December 20, 2015 13:49
Commands to get CoreOS running under Vagrant.
git clone https://github.com/coreos/coreos-vagrant/
cd coreos-vagrant
vagrant up
vagrant ssh
$ cat /media/state/units/docker-local.service
[Service]
Type=simple
ExecStartPre=/bin/systemctl kill docker.service
ExecStartPre=/bin/mount --make-rprivate /
# Enable forwarding to allow NAT to work
# TODO: Move this to sysctl.conf
ExecStartPre=/sbin/sysctl -w net.ipv4.ip_forward=1
# Try to use this alternate way of starting docker if docker crashes for you:

This is a temporary workaround to have etcd listening on all interfaces so you can access it from docker containers.

Add a local etcd unit file

Create a file called /media/state/units/etcd-local.service that has the following contents:

[Unit]
Description=etcd local
@philips
philips / notifier@.service
Created September 26, 2013 04:53
To enable notifications for e.g. the test service, add a symlink named notifier@.service in test.service.wants. This should work with any service. Credit: David Fisher
[Unit]
Description=Etcd service notifier
BindsTo=%i.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/etcdctl set /services/%I running
ExecStop=/usr/bin/etcdctl set /services/%I stopped
{"leader":"machine1","peers":{"machine2":{"latency":{"current":1.772338,"average":1.0749199280898891,"standardDeviation":0.8457034525757665,"minimum":0.383899,"maximum":11.992991},"counts":{"fail":4,"success":445}},"machine3":{"latency":{"current":1.509738,"average":1.0677501002227179,"standardDeviation":0.8358789034579859,"minimum":0.451365,"maximum":12.219284},"counts":{"fail":0,"success":449}}}}