Skip to content

Instantly share code, notes, and snippets.

#include <SoftwareSerial.h>
#define CARD_CODE_LENGTH 10
const int ledPin = 2;
const int doorLock = 4;
const int txPin = 6;
const int rxPin = 8;
int byteRead = 0;
int bytesRead = 0;
@EntropyWorks
EntropyWorks / example-output.txt
Last active August 29, 2015 14:15
Looping into vagrant vm's
$ vagrant-loop "lsb_release -a"
#--- minion-01
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy
Connection to 127.0.0.1 closed.
#--- minion-02
No LSB modules are available.
@EntropyWorks
EntropyWorks / ubuntu_64.json
Created February 13, 2015 22:47
Messing around with Packer
{
"variables": {
"version": "{{env `CLOUD_VER`}}",
"cloud_user": "{{env `CLOUD_USER`}}",
"cloud_token": "{{env `CLOUD_TOKEN`}}",
"atlas_token": "{{env `ATLAS_TOKEN`}}",
"push_name": "entropyworks/ubuntu-stable-atg-amd64",
"os_codename": "ubuntu-stable",
"arch": "amd64",
"release" "14.04"
@EntropyWorks
EntropyWorks / config.rb
Created March 27, 2015 15:53
trying to make this only run only if a file does not exisit
if File.exists?('user-data.master') && ARGV[0].eql?('up') || File.exists?('user-data.master.yml')
require 'open-uri'
token = open('https://discovery.etcd.io/new').read
file_names = ['user-data.master']
file_names.each do |file_name|
text = File.read(file_name)
new_contents = text.gsub(/AUTO_REPLACED_WITH_DISCOVERY_URL/, token )
@EntropyWorks
EntropyWorks / do-it.sh
Last active August 29, 2015 14:20
Starts up coreos galera cluster via docker.
#!/bin/bash
#asciinema rec -w 1 -t do-it.sh -c ./do-it.sh -y /tmp/do-it.record
#
# You can change these to whatever you need to prevent confliting
# ip ranges.
#
IP_VIRTUALBOX="192.168.240"
IP_VMWARE="172.17.8"
# Where the https://github.com/EntropyWorks/fleet-units-galera-cluster repo is placed
@EntropyWorks
EntropyWorks / Not fully working.md
Last active August 29, 2015 14:24
Vagrantfile and vangrant.yml for testing bifrost

Bifrost running inside vagrant virtualbox

Yes I know this is not perfect and Virtualbox does not pass the VT-x instructions making using it painfully slow. I will adding provider to use VMware Fusion and hopefully ESXi.

With the that out of the way.

  1. "git clone https://github.com/EntropyWorks/bifrost.git"
  2. "cd bitfrost"
# Setup influx, grafana and collector
dcos marathon app add mesos-usb/mesosphere/marathon/monitoring/1-influxdb.json
dcos marathon app add mesos-usb/mesosphere/marathon/monitoring/2-nibbler.json
dcos marathon app add mesos-usb/mesosphere/marathon/monitoring/3-grafana.json
# Run workload on 0.2 cpu cores
mesos-execute --master=127.0.1.1:5050 --name=load_1 --command="dd if=/dev/zero of=/dev/null" --resources="cpus:0.2"
# Influx db db/username/password
mesos/root/root
@EntropyWorks
EntropyWorks / late_command.sh
Created June 19, 2012 21:38
12.04 TLS preseed.cfg and ipxe file for network install
!ipxe
set ipxe-ip 10.X.Y.Z
set base-url http://${ipxe-ip}
set preseed http://${ipxe-ip}
set http-proxy http://${ipxe-ip}:3142
set nic eth2
set use-cached 1
dhcp net1
echo mac...............: ${net1/mac}
echo ip................: ${ip}
@EntropyWorks
EntropyWorks / kvm-build.sh
Created November 14, 2012 02:15
Just building KVM images for myself
#!/bin/bash
# Yazz Building KVM images
ubuntu="quantal"
name=(bm-installer) # Just add more seperated by a space to build
domain="example.com"
nic="eth0"
location="http://us.archive.ubuntu.com/ubuntu/dists/${ubuntu}/main/installer-amd64/"
preseed="http://192.168.41.89/preseed.cfg"
vm_disks="$HOME/kvm"
@EntropyWorks
EntropyWorks / ansible-requirements
Last active November 4, 2015 07:17
Some things I need
Jinja2
PyYAML
dnspython
httplib2
pip-tools
passlib
pyrax
ssh-import-id
ansible