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 /
Last active Dec 5, 2019
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!


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.)


Shell Script Design Goals

  • Don't avoid bashisms unless you know bash will be unavailable
    • Use #!/bin/bash rather than #!/bin/sh
    • If you are going to try to avoid bash, you must test on a system that does not have bash
  • Always include a shebang #!
  • Handle errors
    • Use set -eu (errexit & nounset)
  • Sould be idemponent if read via source
    • Use subshells to avoid leaking unintended variables into the parent scope
#! /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
RichardBronosky / README.MD
Last active Nov 26, 2019
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.


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


#!/bin/bash -eu
ps -p ${1:-$$} -o pid,ppid,args | tail -n1 | \
read pid ppid args
echo -e "$pid\t$args"
[[ $pid -gt 1 ]] && pid_lineage $ppid -
) | (
[[ ${2:-} != '-' ]] && \
View Start-ScreenSaver.ps1
# Start-ScreenSaver
# Version: 1.1
# From:
param ([String]$Include, [String]$Exclude)
#Avoid execution if a screen saver is already running
if (get-Process *.scr) {
View local-bin
#!/bin/bash -eu
[[ -z ${1:-} ]] && \
echo -e "\n""Usage: $0 executable_path [destination_path] ""\n" || \
: $executable_path
exec="$( basename $executable_path )"
dir="$( dirname $executable_path )"
RichardBronosky / Fork your own
Last active Nov 14, 2019 — forked from antichris/
Fork your own Gist
View Fork your own

Fork your own Gist

It used to be possible to fork your own gists via the browser using a little JS magic. This is no longer the case. As an alternative, you can use Chris Wanstrath's cli tool to do the next best thing.


View temp
Thu Nov 14 12:11:48 EST 2019
View temp
Thu Nov 14 12:10:38 EST 2019
You can’t perform that action at this time.