Skip to content

Instantly share code, notes, and snippets.

View brianredbeard's full-sized avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / glance_load.sh
Last active August 29, 2015 14:02
Glance load - a utility to monitor an ETag and load the corresponding file into glance.
#!/usr/bin/env bash
# glance_load.sh
# Brian "Redbeard" Harrington <brian@dead-city.org>
#
# This code is in the public domain.
#
# A tool for monitoring remote files and loading them into a glance image
# store. This tool has been optimized for use on CoreOS but should work
# for most files where an ETag is exposed.
@brianredbeard
brianredbeard / .config
Created September 19, 2014 22:27
"corebox" buildroot config
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2014.08 Configuration
#
BR2_HAVE_DOT_CONFIG=y
#
# Target options
#
BR2_ARCH_IS_64=y

Keybase proof

I hereby claim:

  • I am brianredbeard on github.
  • I am brianredbeard (https://keybase.io/brianredbeard) on keybase.
  • I have a public key whose fingerprint is 9244 6DEB CE08 9086 7E4C C634 933F 5408 3D6D F566

To claim this, I am signing this object:

@brianredbeard
brianredbeard / list_images.sh
Created December 29, 2014 20:00
List information on Digital Ocean images
#!/bin/bash
source .do
output=$(curl -s -X GET "https://api.digitalocean.com/v2/droplets" -H "Authorization: Bearer $TOKEN")
if [ "$1" == "-a" ]; then
echo $output | jq -s '.[][][] | { name: .name?, id: .id?, ip_address: .networks.v4[].ip_address} | select(.name | contains("redbeard"))' | grep -v -f reserved
else
echo $output | jq -s '.[][][] | { name: .name?, id: .id?} | select(.name | contains("redbeard")) | .id' | grep -v -f reserved
fi
@brianredbeard
brianredbeard / 05-bond0.network
Last active August 29, 2015 14:14
network samples
[Match]
Name=bond0
[Network]
Address=192.168.1.111/24
Gateway=192.168.1.1
DNS=8.8.8.8
@brianredbeard
brianredbeard / halfass.sh
Created February 3, 2015 01:46
half assed password tool. this gives you 20 randomized alpha number passwords with NATO phonetics and no confusing characters
alias passthing="curl -s -L 'https://secure.pctools.com/guides/password/?length=13&phonetic=on&alpha=on&mixedcase=on&numeric=on&nosimilar=on&quantity=20&generate=true#password_generator' | grep \"<tr><td valign=top nowrap style='border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px'><b>\" | sed -r 's/<tr><td valign=top nowrap style=.border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px.><b>([[:alnum:]]+)<.b><.td><td valign=top style=.border: 1px solid #c5c5c7;padding-top:3px;padding-bottom:3px.><i>([-a-zA-Z \(\)]+)<.i><.td><.tr>/\1 \2/g'"
@brianredbeard
brianredbeard / gist:dea1337f34cfdd76326f
Last active August 29, 2015 14:20
sample cloud-config for DO
#cloud-config
coreos:
units:
- name: etcd.service
command: restart
- name: fleet.service
command: restart
etcd:
@brianredbeard
brianredbeard / sshpub-to-rsa
Created January 26, 2012 15:16 — forked from thwarted/sshpub-to-rsa
converts an openssh RSA public key into a format usable by openssl rsautl (if you don't have openssh 5.6 or later with ssh-keygen PEM export format)
#!/usr/bin/env python
# with help and inspiration from
# * ASN1_generate_nconf(3) (specifically the SubjectPublicKeyInfo structure)
# * http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL
# * http://blog.oddbit.com/2011/05/converting-openssh-public-keys.html
import sys
import base64
import struct
@brianredbeard
brianredbeard / generate_etcd_dropins.sh
Last active December 16, 2015 23:59
Generation of etcd dropins based on a list of ip addresses
#!/bin/bash
#
# usage: ./generate_etcd.sh 10.240.0.14 10.240.0.12 10.240.0.13
# output is in /tmp
for ipaddr in "$@"
do
let count+=1
peerlist="${peerlist},infra${count}=http://${ipaddr}:2380"
done
@brianredbeard
brianredbeard / logstash.sh
Last active December 23, 2015 05:49 — forked from slojo404/logstash RPM spec
Updated to more closely follow Linux Standard Build (lsb; http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html) practices as well as more clearly abstract the function of the agent to support separate scripts for shippers, indexers, etc.
#!/bin/bash
#
# logstash Startup script for logstash
# chkconfig: 2345 20 80
# description: Logstash is a log shipping, indexing, and collocation tool.
# processname: java
### BEGIN INIT INFO
# Provides: logstash
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs