Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / bootable-usb-drive.md
Last active January 8, 2019 07:25
osx debian usb asus 900A EEE PC

I created a bootable usb drive in disk utility

then ran diskutil list to find the identifier

/dev/disk2s1 in my case

make sure to unmount the drive

then dd

raspberry pi auto mount usb drive

my drive is hfsplus usb 2TB

get the usb UUID from blkid

pretty print drive locations lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL

followed this, with special attention to the order. Drive must be unmounted before running fsck.

@todgru
todgru / emby.md
Last active March 16, 2019 00:22
install emby on a raspbery pi 3
@todgru
todgru / ufw.md
Created January 6, 2019 21:45
set up ufw to forward requests to port 2222 of server to same server, port 22

Foward requests to one port to another on the same server

I wanted to forward requests comming to a server on port 2222 to the same server port 22.

I'm using ufw for the firewall on the server.

  1. allow port 22 and 2222 on the server.
$ sudo ufw allow 22
@todgru
todgru / dns-troubleshooting.md
Last active October 18, 2019 02:31
setting up dnsmasq on raspberry pi nmap ports dns

Local DNS dnsmasq

Use case

I wanted to have an outside domain name resolve to a computer inside my local private network. I am tyring out duckdns.org to handle the resolution. The DNS resolves fine outside of my local network, yet locally the fqdn will not resolve. To enable this, a local dns needs to handle the request, routing to the local server.

This is where the raspberry pi dns comes in. I'm running Raspbian GNU/Linux 9 (stretch), a Debian variant. http://www.raspbian.org/

NOTE

I have been unable to get dnsmasq to start correctly on reboot. Nothing stands out in daemon.log. sudo service dnsmasq status shows one particular line that is different from the status of a reboot vs a manual service restart:

@todgru
todgru / install.sh
Last active January 13, 2019 19:28
raspberry pi debian 9 stretch cleanup and nice-to-have package install
# modified version of:
# wget https://gist.githubusercontent.com/samatjain/4dda24e14a5b73481e2a/raw/5d9bac8ec40b94833b4e9938121945be252fdee1/Slim-Raspbian.sh -O Slim-Raspbian.sh
# GUI-related packages
# none right now...
# Edu-related packages
pkgs="
oracle-java8-jdk
minecraft-pi
python-minecraftpi
@ServerlessBot
ServerlessBot / IAMCredentials.json
Last active December 20, 2023 16:50
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@afeish
afeish / md-renderer.conf
Created September 12, 2018 10:49 — forked from max-lt/md-renderer.conf
Nginx config to render markdown files (client side)
location /__special {
internal;
allow all;
root /usr/share/nginx/html/__special;
}
location = /__md_file {
internal;
allow all;
@wyllie
wyllie / parse_ini.sh
Created July 22, 2018 17:04
Parse aws credentials file in bash
#!/usr/bin/env bash
INI_FILE=~/.aws/credentials
while IFS=' = ' read key value
do
if [[ $key == \[*] ]]; then
section=$key
elif [[ $value ]] && [[ $section == '[default]' ]]; then
if [[ $key == 'aws_access_key_id' ]]; then