Skip to content

Instantly share code, notes, and snippets.

View RichardBronosky's full-sized avatar

Bruno Bronosky RichardBronosky

View GitHub Profile
@RichardBronosky
RichardBronosky / k8s-pi.md
Last active November 6, 2018 09:19 — forked from alexellis/k8s-pi.md
K8s on Raspbian

Kubernetes on (vanilla) Raspbian Lite

Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.

This is part of a blog post Serverless Kubernetes home-lab with your Raspberry Pis written by Alex Ellis.

Copyright disclaimer: Please provide a link to the post and give attribution to the author if you plan to use this content in your own materials.

Pre-reqs:

@RichardBronosky
RichardBronosky / rPi3-ap-setup.sh
Created July 4, 2018 02:35 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@RichardBronosky
RichardBronosky / tmux.md
Last active June 28, 2018 16:18 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux [MINIMAL] cheat sheet

Objective

This is the minimum you should memorize to feel at home on any server your SSH into. There are many cheatsheets out there that try to be exhaustive, or suggest mapping shit to more convenient locations, but that is not the goal of this one. Everyone should use tmux for every connection, to every server, always. Memorizing this brings down the barrier to doing so.

Sessions, windows, panes

Session is a set of windows, plus a notion of which window is current.

#!/bin/bash -e
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
NAME=blink
DIR=/home/pi
PIDFILE=/home/pi/$NAME.pid
DAEMON=/home/pi/pi_gpio_hack.py
DAEMON_ARGS="[[31,0,37,1],[31,1,37,0]]"
STOP_SIGNAL=INT
@RichardBronosky
RichardBronosky / adafruit.io
Last active November 27, 2017 23:26 — forked from deckerego/send_io.sh
Send Adafruit IO data using curl
#!/bin/bash
# Usage: AIO_KEY=key_hash FEED_KEY=name_of_feed VALUE=an_integer send_io.sh
# Specify any or none of the environment variables
aio_key="${AIO_KEY:-feedfacedeadbeef}" # default: replace everything after the -
feed_key="${FEED_KEY:-myfeedname}" # default: replace everything after the -
value="$(sed 's/"/\\"/g' <<<"${VALUE:-$(( ( RANDOM % 25 ) + 1 ))}")" # default: random int between 0 and 25
curl -H "X-AIO-Key: $aio_key" \
@RichardBronosky
RichardBronosky / 00README.md
Last active November 13, 2017 21:43 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
@RichardBronosky
RichardBronosky / tmux.cheat
Last active January 8, 2018 18:46 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@RichardBronosky
RichardBronosky / 0-TLDR.md
Last active March 23, 2024 15:09 — forked from datagrok/git-serve.md
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.

User 1

remote_server=172.31.0.1
git daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/ > /tmp/git-serve.log 2>&1 &
ssh -R 9418:localhost:9418 ec2-user@$remote_server
git clone git://localhost/ local-repo-name

Repo from workstation is cloned onto server.

User 2

#!/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

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to: