Skip to content

Instantly share code, notes, and snippets.

Avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / glance_load.sh
Last active Aug 29, 2015
Glance load - a utility to monitor an ETag and load the corresponding file into glance.
View glance_load.sh
#!/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 Sep 19, 2014
"corebox" buildroot config
View .config
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2014.08 Configuration
#
BR2_HAVE_DOT_CONFIG=y
#
# Target options
#
BR2_ARCH_IS_64=y
View keybase.md

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 Dec 29, 2014
List information on Digital Ocean images
View list_images.sh
#!/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
View 05-bond0.network
[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 Feb 3, 2015
half assed password tool. this gives you 20 randomized alpha number passwords with NATO phonetics and no confusing characters
View halfass.sh
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 Aug 29, 2015
sample cloud-config for DO
View gist:dea1337f34cfdd76326f
#cloud-config
coreos:
units:
- name: etcd.service
command: restart
- name: fleet.service
command: restart
etcd:
@brianredbeard
brianredbeard / sshpub-to-rsa
Created Jan 26, 2012 — 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)
View sshpub-to-rsa
#!/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 Dec 16, 2015
Generation of etcd dropins based on a list of ip addresses
View generate_etcd_dropins.sh
#!/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 Dec 23, 2015 — 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.
View logstash.sh
#!/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