Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / Vagrantfile
Last active April 1, 2016 23:03
Some of the things I have for BBB https://github.com/EntropyWorks/BBB that aren't checked in
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'
# Require YAML module so we can use yaml for doing the configuation
require 'yaml'
@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 / 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 / aptly-mirror.sh
Last active September 17, 2021 17:46
This is my script for mirroring a bunch of apt repos. This only touches the very basics of what (aptly)[http://www.aptly.info/] can do.
#!/bin/bash
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
# Authored by Yazz D. Atlas <yazz.atlas@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#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 / preseed-no-file-template-support.sls
Last active December 23, 2015 09:39
Trying to set debconf-set-selections to preseed percona mysql password
percona_preseed_require:
pkg.latest:
- pkgs:
- debconf-utils
preseed_mysql_password_1:
debconf.set_file:
- source: salt://percona_galera/templates/preseed.answers
- require:
- pkg: percona_preseed_require
@EntropyWorks
EntropyWorks / gist:5801879
Created June 18, 2013 01:06
Contents of /etc/alt/master
##### Primary configuration settings #####
file_roots:
base:
- /srv/salt/state/base
dbaas_aw2_az1:
- /srv/salt/state/env/aw2_az1
dbaas_aw2_az2:
- /srv/salt/state/env/aw2_az2
dbaas_aw2_az3:
- /srv/salt/state/env/aw2_az3
@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"