Skip to content

Instantly share code, notes, and snippets.

View AjkayAlan's full-sized avatar

Alan Kay AjkayAlan

View GitHub Profile
@AjkayAlan
AjkayAlan / rpi4b-docker-host-with-ansible.md
Last active June 20, 2024 00:48
Create a Docker host with Ansible on a Raspberry Pi 4b

RPI4 Docker Host With Ansible

A fun experement to run everything on my home network using Docker, with it all managed via Ansible. A few notes...

  1. This will rely on you setting up some things on the RPI manually
  2. It will rely on running Ansible via localhost (instead of another device running ansible against the RPI)

Flashing The OS

  1. Download the Raspberry Pi Imager and format your SD card

Quickstart

  • Plug WAN into eth1, LAN into eth2
  • Boot up, go to 192.168.88.1. Login with default creds.
  • Webfig -> System -> Reset Configuration. Wait for the reboot.
    • This makes it so you get good IPv6 firewall rules by default
  • In Quick Set:
    • Ensure Port is Eth1
    • Ensure Address Acquisition is Automatic
    • Set IP Address to 192.168.1.1
@AjkayAlan
AjkayAlan / OpenWrtSetupX86.sh
Last active May 28, 2024 14:09
Setup OpenWrt Snapshots on my x86 machine
# This assumes your already running OpenWRT
# Follow https://teklager.se/en/knowledge-base/openwrt-installation-instructions/ to get OpenWRT initally installed on an SSD if you haven't
# My device expects LAN on eth0, and WAN on eth1
# Sign into the router
ssh [email protected]
# Set vars
DOWNLOAD_LINK="https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/openwrt-23.05.3-x86-64-generic-squashfs-combined-efi.img.gz"
SHA256SUMS="https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/sha256sums"

Prework

  1. Format your SD Card with FAT32 if <= 32GB, otherwise use exFAT
  2. Go to https://www.raspberrypi.org/downloads/raspberry-pi-os/ and the lite image, then unzip it
  3. Download https://www.balena.io/etcher/ and install it
  4. Use Etcher to write the downloaded image to the SD card
  5. Create a blank file named ssh into the boot partition to enable ssh with headless
  6. Put the SD card into your Raspberry Pi, plug it into ethernet, and power it on

SSH

@AjkayAlan
AjkayAlan / WSLWindows10Setup.md
Last active April 29, 2024 15:43
Windows SubSystem For Linux setup that I like with some developers stuff mixed in

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update
@AjkayAlan
AjkayAlan / RaspberryPiDevSetup.sh
Last active May 21, 2022 15:58
Setup steps for my raspberry pi 3b+ for development
## Getting image and Pi up and running
# Go to https://www.raspberrypi.org/downloads/raspbian/ and download an image, then unzip it
# Download https://www.balena.io/etcher/ and install it
# Plug in microsd card, Unzip the downloaded image and use Etcher to write the downloaded image to the SD card
# Edit boot/config.txt, and uncomment hdmi_force_hotplug=1 and hdmi_drive=2
# Plug the PI in, and go through to setup prompts
# Run the following commands in terminal
## Config stuff
sudo raspi-config
@AjkayAlan
AjkayAlan / UbiquitiERL3Setup.sh
Last active January 11, 2020 01:11
Setup for my basic settings with a Ubiquiti ERL 3 (EdgeRouter Lite 3)
# Plug in ethernet to eth0, connect to laptop, and set static IP to 192.168.1.10, subnet mask 255.255.255.0
# TODO: Script this so I dont need to touch the gui
# Navigate to 192.168.1.1, login using ubnt for username and password
# Run basic setup wizard, and set the following settings:
### Internet Port: eth0
### DHCP
### Enable the default firewall
### Enable DHCPv6 Prefix Delegation, /56, default firewall
### LAN port: eth1, enable dhcp
### Set password to whatever you want
@AjkayAlan
AjkayAlan / OpenWrtRouterSetup.sh
Last active May 26, 2019 22:04
OpenWrtRouterSetup.sh
# ssh
ssh [email protected]
# Install stuff I care about
opkg update
opkg install luci
opkg install luci-app-sqm
opkg install luci-app-upnp
# Set new password for root
@AjkayAlan
AjkayAlan / ChocoNewComputerSetup.ps1
Last active January 12, 2023 17:04
Installs Chocolatey and all the nice things I want
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install googlechrome
choco install vlc
choco install microsoft-windows-terminal
choco install peazip
choco install vscode
choco install steam
choco install choco-upgrade-all-at --params "'/TIME:21:00'"
choco install origin