Skip to content

Instantly share code, notes, and snippets.


Ian Finch ianfinch

View GitHub Profile
ianfinch / regolith-debian
Created May 10, 2021
Install Regolith on Debian
View regolith-debian
# See
echo "deb bionic main" > /etc/apt/sources.list.d/regolith.list
apt-key adv --keyserver --recv-keys EFC31B0AE9F1000B38E37FC8C0930F305A0E0FEF
apt update
apt install devscripts build-essential cdbs libxcb1-dev gperf pkg-config xutils-dev
# create setup folder
mkdir rego-setup && cd rego-setup/
ianfinch / webserver
Created Mar 16, 2021
Quick script to start a web server when I create a server
View webserver
yum update -y
yum install httpd -y
service httpd start
chkconfig httpd on
echo "<html><head><title>Ian's Web Server</title></head><body><h1>Ian's Web Server</h1></body></html>" > /var/www/html/index.html
ianfinch / docker
Last active Jul 8, 2020
Quick reminders for docker commands
View docker
Export image as tar file .............. docker save -o <tar file> <docker image>
Import image from tar file ............ docker load --input <tar file>
ianfinch / git
Last active Jun 26, 2020
Reminder of git commands
View git
See all remotes ....................... git remote -v
Fetch a specific remote ............... git fetch <remote name>
Compare remote with local files ....... git diff --name-only remotes/<remote name>/master
Compare remote with main repo ......... git diff --name-only master remotes/<remote name>/master
Squash commits ........................ git rebase -i <after this commit>
Squash commits into initial commit .... git rebase -i --root
Force submit after squashes ........... git push origin +master
Replace "pick" with "reword" to change the commit message
Replace "pick" with "squash" to combine a commit with the last "pick" commit
ianfinch / rpi-hfs
Last active May 29, 2020
How to mount HFS+ drives (Mac) on Raspberry Pi
View rpi-hfs
Install dependencies ...
sudo apt-get install hfsplus hfsutils hfsprogs gdisk
To mount, add "-t hfsplus" to the mount command
ianfinch / rpi-add-usb
Created Feb 19, 2020
Add a USB drive to a Raspberry Pi (Raspbian)
View rpi-add-usb
Find USB device ...
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Feb 9 01:26 093F-C00F -> ../../sda1
lrwxrwxrwx 1 root root 15 Feb 9 01:26 2ab3f8e1-7dc6-43f5-b0db-dd8364731d4e -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Feb 9 01:26 5203-D7B4 -> ../../mmcblk0p1
The one we are looking for is "/sda"
ianfinch / docker-on-pi
Created Jan 12, 2020
Set up docker on Raspberry Pi
View docker-on-pi
# Based on
curl -sSL | sh
sudo usermod -aG docker $USER
# Reboot
docker run hello-world
sudo apt-get install libffi-dev libssl-dev
ianfinch / replace_pi_user.txt
Last active Dec 17, 2019
Setup new user to replace pi user
View replace_pi_user.txt
adduser $user
for group in $(groups pi | cut -d':' -f2 ) ; do
if [[ "$group" != "pi" ]] ; then
adduser $user $group
ianfinch / keypirinha-theme.txt
Created Dec 16, 2019
My theme for Keypirinha
View keypirinha-theme.txt
opacity_back = 95
satellite_show = always
satellite_pos = topleft
satellite_size = small
control_margin = 4
textbox_padding = 3
listitem_padding = 1
layout = list_icon,list_dialnum,list_selmark,list_actions
color_background = #FFBF00
ianfinch /
Last active Oct 22, 2021
Raspberry Pi 4 USB Gadget
# Set up a Raspberry Pi 4 as a USB-C Ethernet Gadget
# Based on:
# -
# -
if ! $(grep -q dtoverlay=dwc2 /boot/config.txt) ; then
echo "Add the line dtoverlay=dwc2 to /boot/config.txt"