Skip to content

Instantly share code, notes, and snippets.

[Unit]
Description=Redis cluster 1 instance 2
After=docker.service
Requires=docker.service
After=redis-1-2-amb-1.service
Requires=redis-1-2-amb-1.service
After=redis-1-2-amb-2.service
Requires=redis-1-2-amb-2.service
After=redis-1-2-amb-3.service
Requires=redis-1-2-amb-3.service
[
{
"Node":"core-03",
"Address":"172.17.8.103",
"ServiceID":"registrator:redis-1:6379",
"ServiceName":"redis",
"ServiceTags":null,
"ServicePort":49153
},
{
@sheldonh
sheldonh / docker-register.service
Last active August 29, 2015 14:05
docker-register.service
# I was hoping that marking this service global would allow me to start it with:
#
# fleetctl load docker-register.service
#
# Instead, I had to go onto each CoreOS host and do:
#
# cp docker-register.service /etc/systemd/system/
# systemctl enable docker-register.service
# systemctl start docker-register.service
#
@sheldonh
sheldonh / opencl-dev-setup.sh
Last active August 29, 2015 14:05
OpenCL Development Setup
# Install the stuff
sudo yum groupinstall "Development Tools" "Development Libraries"
sudo yum install cmake cmake-gui subversion gcc gcc-c++ opencl-headers pocl
# Get the book and make a build directory
cd /home/joshng
svn checkout http://opencl-book-samples.googlecode.com/svn/trunk/ opencl-book-samples-read-only
@sheldonh
sheldonh / activity-log.txt
Created August 28, 2014 10:28
panamax cyclic dependency
Aug 28 12:23:28 systemd Stopped redis_1.service.
Aug 28 12:23:28 systemd Stopped redis_2.service.
Aug 28 12:23:28 systemd Stopped redis_3.service.
Aug 28 12:23:31 systemd Found ordering cycle on redis_1.service/start
Aug 28 12:23:31 systemd Found dependency on redis_3.service/start
Aug 28 12:23:31 systemd Found dependency on redis_1.service/start
Aug 28 12:23:31 systemd Found ordering cycle on redis_1.service/start
Aug 28 12:23:31 systemd Found dependency on redis_3.service/start
Aug 28 12:23:31 systemd Found dependency on redis_1.service/start
Aug 28 12:23:31 systemd Found ordering cycle on redis_3.service/start
@sheldonh
sheldonh / spy_spec.rb
Last active August 29, 2015 14:00
rspec spies: spy on unstubbed method
# This spec demonstrates how rspec's and_call_original
# allows spying on real objects without affecting their
# behaviour. In the following output from rspec, note
# that real output ("Moo!") actually goes to $stdout,
# even though the latter's puts method was stubbed.
#
# Cow
# before it speaks
# is considered quiet
# when it speaks
@sheldonh
sheldonh / heartbleed.sh
Last active August 29, 2015 13:58
Heartbleed hotfix for Fedora 19
yum update -y
yum -y install koji krb5-devel zlib-devel
koji download-build --arch=x86_64 openssl-1.0.1e-37.fc19.1
rpm -U openssl-1.0.1e-37.fc19.1.x86_64.rpm \
openssl-libs-1.0.1e-37.fc19.1.x86_64.rpm \
openssl-devel-1.0.1e-37.fc19.1.x86_64.rpm
if rpm -q openssl-libs.i686 >/dev/null 2>&1; then
koji download-build --arch=i686 openssl-1.0.1e-37.fc19.1
rpm -U openssl-libs-1.0.1e-37.fc19.1.i686.rpm
fi
@sheldonh
sheldonh / heartbleed.sh
Last active August 29, 2015 13:58
Heartbleed hot fix on fedora 20
yum update -y
yum -y install koji krb5-devel zlib-devel
koji download-build --arch=x86_64 openssl-1.0.1e-37.fc20.1
rpm -U openssl-1.0.1e-37.fc20.1.x86_64.rpm \
openssl-libs-1.0.1e-37.fc20.1.x86_64.rpm \
openssl-devel-1.0.1e-37.fc20.1.x86_64.rpm
if rpm -q openssl-libs.i686 >/dev/null 2>&1; then
koji download-build --arch=i686 openssl-1.0.1e-37.fc20.1
rpm -U openssl-libs-1.0.1e-37.fc20.1.i686.rpm
fi
Failure/Error: expect(response.error).to_not eql "CSR subject (axl.hetzner.africa) disagrees with request CN (monkeyface.example.com)"
expected: value != "CSR subject (axl.hetzner.africa) disagrees with request CN (monkeyface.example.com)"
got: "CSR subject (axl.hetzner.africa) disagrees with request CN (monkeyface.example.com)"
(compared using eql?)
@sheldonh
sheldonh / gist:7640835
Last active December 29, 2015 08:08
euca client-token problem
$ euca-run-instances -n 3-3 --client-token debug-instances-1 -k sheldonh emi-ED24394E
POST /services/Eucalyptus HTTP/1.1
Accept-Encoding: identity
Host: 197.189.194.66:8773
Content-Type: application/x-www-form-urlencoded
Content-Length: 304
User-Agent: euca2ools/3.0.2 (CPython 2.7.5; Linux 3.11.9-200.fc19.x86_64; x86_64) requestbuilder/0.1.0 requests/1.2.3
SignatureVersion=2&AWSAccessKeyId=XXXXXXXXXXXXXXXXXXXX&Version=2013-02-01&Timestamp=2013-12-09T07%3A46%3A01Z&MaxCount=3&Signature=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&ImageId=emi-ED24394E&SignatureMethod=HmacSHA256&KeyName=sheldonh&ClientToken=debug-instances-1&Action=RunInstances&MinCount=3