Skip to content

Instantly share code, notes, and snippets.

Bruno Bronosky RichardBronosky

Block or report user

Report or block RichardBronosky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@RichardBronosky
RichardBronosky / confd-quick-start-guide.md
Last active Oct 18, 2019
Quick Start Guide for confd using the "file" backend
View confd-quick-start-guide.md
View aws-userdata.sh
#!/bin/bash
url="https://gist.githubusercontent.com/RichardBronosky/2d04c7c2e9a5bea67cd9760a35415a3f/raw/install_mongo.sh"
script="/tmp/userdata.sh"
echo "Running userdata script as $(whoami) from $(pwd)"
# Log commands to stdout and vicariously /var/log/cloud-init-output.log
set -o xtrace
# Exit on error
View .gitaliases
# to add these aliases, copy-pasta the following line (without the #):
# curl -L https://gist.githubusercontent.com/RichardBronosky/eb1cc18c8c23020face1fe1926d27978/raw/setup.sh | bash
[push]
# See: https://stackoverflow.com/a/23918418/117471
default = current
# Use SSH instead of HTTPS for github.com
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
@RichardBronosky
RichardBronosky / assume-role
Last active Oct 9, 2019
A wrapper around https://github.com/remind101/assume-role that feeds in the MFA and caches.
View assume-role
:<<'DOCS'
* This script is a wrapper around https://github.com/remind101/assume-role that feeds
in the MFA and caches the token.
* Either: Place this file at ~/.aws/assume-role use it in ~/.bash_profile with:
[[ -f ~/.aws/assume-role ]] && source ~/.aws/assume-role
* Or: You can copy-paste the next 5 lines to get and use this script:
curl -sLo ~/.aws/assume-role https://gist.githubusercontent.com/RichardBronosky/4cdd0b462f6fc6a8700d1d6b7650e363/raw/assume-role
cat >> ~/.bash_profile <<'EOF'
@RichardBronosky
RichardBronosky / README.md
Last active Oct 7, 2019
Using cloud-init for cloudless provisioning of Raspberry Pi
View README.md

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)

View pep8_cheatsheet.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@RichardBronosky
RichardBronosky / README.MD
Last active Oct 4, 2019
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.
View README.MD

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]).

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable

Examples

@RichardBronosky
RichardBronosky / list-all-repos.py
Last active Sep 30, 2019 — forked from ralphbean/list-all-repos.py
Script to list all repos for a github organization
View list-all-repos.py
#!/usr/bin/env python2.7
""" Print all of the (git/ssh or http) urls for all repos (public or
private+public with personal_token) in a GitHub account (user or organization).
Usage example::
[HTTP_URLS=1] python2.7 list-all-repos.py account_name [personal_token]
It requires the pygithub3 module, which you can install on macos (Mac OSX) like this::
# get pip if you don't have it
View simple-https-server.py
#!/usr/bin/env python3
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import http.server
@RichardBronosky
RichardBronosky / approve_pr
Created Sep 26, 2019
This is a WIP. Use at your own risk.
View approve_pr
#!/bin/bash
usage(){
echo -e "\n""${FUNCNAME[1]} <github_pull_url> <oauth_token>""\n"
return 1
}
_prepare_vars(){
local IFS=$'\n'
regex=''
You can’t perform that action at this time.