Skip to content

Instantly share code, notes, and snippets.

View RichardBronosky's full-sized avatar

Bruno Bronosky RichardBronosky

View GitHub Profile
@RichardBronosky
RichardBronosky / AddSSHKeysAtLogin.plist
Last active January 13, 2024 19:20
Launch ssh-agent on boot (OSX macos)
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-add-a</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/ssh-add</string>
<string>-A</string>
</array>
<key>StandardOutPath</key>
@RichardBronosky
RichardBronosky / README.md
Last active December 1, 2023 08:19
Using cloud-init for cloudless provisioning of Raspberry Pi

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

<tr>
<td class="pos">\n
"Some text:"\n
<br>\n
<strong>some value</strong>\n
</td>
</tr>
<tr>
<td class="pos">\n
"Fixed text:"\n
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Bruno Bronosky",
"label": "Principal DevOps Engineer and Trainer",
"image": "http://www.gravatar.com/avatar/959ccd33301cb3c15953c1a632a36763?s=500",
"email": "bruno@bronosky.com",
"phone": "(404) 992-7866",
"url": "https://github.com/RichardBronosky/resume",
"summary": "Born in the Appilachian mountains of West Virginia to a radio electronics technician, Bruno grew up in coal mining\ncountry where most of his classmates remain. He never threw a ball with his father, though they did attend a\nhandfull of Cincinnati Reds baseball games. They spent their nights and weekends soldering Heathkit projects from\nRadio Shack and writing games and equation solvers in Borland Turbo Basic, then Turbo Pascal, and eventually Delphi.\nWhen calling his father in 1995 to tell him Bruno got his first professional programming gig, they both saw this\nlike getting drafted in the MLB.
@RichardBronosky
RichardBronosky / get_authorized_keys.sh
Created January 25, 2019 16:03
Get ssh keys for Raspberry Pi from GitHub
sudo bash <<EOF
local_user=pi
github_user=RichardBronosky
umask 077
mkdir -p ~$local_user/.ssh
curl -sSL https://github.com/${github_user}.keys >> ~$local_user/.ssh/authorized_keys
chown -R $(id -u $local_user):$(id -g $local_user) ~$local_user/.ssh
EOF
@RichardBronosky
RichardBronosky / source.bash
Last active August 17, 2023 15:49
A collection of tools for working with JS and JSON
:<<'DOCS'
* This script adds to your bash shell, a collection of tools for working with JS and JSON
* To install it, cd to where ever you checkout git repos and copy-paste the following line:
dst=jtools; git clone https://gist.github.com/81a3991aa63580283bf2f3db18ecf2fb.git $dst && echo -e "\n[[ -f $(dirs +0)/$dst/source.bash ]] && source $(dirs +0)/$dst/source.bash" >> ~/.bash_profile
DOCS
# converts serialized python to JSON
p2j() { python3 -c "import json, sys; print(json.dumps(eval(sys.stdin.read())))"; }
@RichardBronosky
RichardBronosky / similarities.sh
Created February 8, 2019 07:47
Identify how similar a file is to each file in a group of others.
#!/bin/bash
fileA="$1"
shift
for fileB in "$@"; do
(
# diff once grep twice with the help of tee and stderr
diff $fileA $fileB | \
tee >(grep -cE '^< ' >&2) | \
grep -cE '^> ' >&2
@RichardBronosky
RichardBronosky / vscode_cheat_sheet.md
Last active August 17, 2023 15:45
Visual Studio code - VSCode Cheat Sheet - Keyboard Shortcuts

VSCode Cheat Sheet

Keyboard Shortcuts

Jump to closing bracket

Cmd+Shift+\

Though I suggest changing it as follows:

editor.action.jumpToBracket Ctrl+]

@RichardBronosky
RichardBronosky / approve_pr
Created September 26, 2019 15:54
This is a WIP. Use at your own risk.
#!/bin/bash
usage(){
echo -e "\n""${FUNCNAME[1]} <github_pull_url> <oauth_token>""\n"
return 1
}
_prepare_vars(){
local IFS=$'\n'
regex=''
# 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/