Skip to content

Instantly share code, notes, and snippets.

View brianredbeard's full-sized avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / logstash.conf
Last active May 2, 2016 20:28
logstash config to break out systemd output from `/usr/lib/systemd/systemd-journal-upload`
input {
tcp {
port => 19532
type => journald
}
}
filter {
if [type] == "journald" {
multiline {
@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 / 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 / .config
Last active October 15, 2020 00:41
buildroot config for node.js
BR2_HAVE_DOT_CONFIG=y
BR2_ARCH_IS_64=y
BR2_x86_64=y
BR2_ARCH="x86_64"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="nocona"
BR2_ARCH_HAS_ATOMICS=y
BR2_X86_CPU_HAS_MMX=y
BR2_X86_CPU_HAS_SSE=y
BR2_X86_CPU_HAS_SSE2=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 / .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
@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 / tmux.conf
Created February 12, 2014 20:10
A better starting tmux config. Live like screen, but better
# make CTRL+a the 'prefix' ala screen.
bind C-a send-prefix
set -g prefix C-a
# get rid of the tmux standard of CTRL+b
unbind C-b
set -s escape-time 1
set -g base-index 1
setw -g pane-base-index 1
# make it easy to reload the config (CTRL+r)
@brianredbeard
brianredbeard / db_dump.sh
Last active August 26, 2019 22:04
MariaDB / MySQL Backup script
#!/bin/bash
# Simple script to dump the contents of a database into separate files in the directory "/backups/"
# Symlink into /etc/cron.daily/ or add to crontab
# Originally from: https://gist.github.com/brianredbeard
# /usr/local/scripts/db_dump
#mysqldump -x --add-drop-table --all-databases > /backups/mysqldb-`date +%F-%I%p`.sql
/usr/bin/mysql --defaults-extra-file=/root/.my.cnf -e 'show databases' | /bin/awk '{print $1}' | /bin/grep -v "^Database$" | /usr/bin/xargs -i{} /usr/bin/mysqldump --defaults-extra-file=/root/.my.cnf --opt -Q -r /backups/{}-`date +%F-%I%p`.sql {}
@brianredbeard
brianredbeard / hubot
Created November 14, 2013 01:10
Startup script for a Red Hat SCL based node.js application which should run on startup - Hubot. http://github.com/github/hubot (Note, this isn't a _good_ example, simply _an_ example).
#!/bin/bash
# hubot
# chkconfig: 345 20 80
# description: hubot
# processname: hubot
# This script assumes you have a user called "hubot" on your system and that hubot is installed in /opt/hubot
#
# Fore more info on this craziness -
# http://thejacklawson.com/how-to-hubot/