Skip to content

Instantly share code, notes, and snippets.

@davidmroth
davidmroth / Instructions.md
Last active January 17, 2026 19:07
Install LineageOS 23 on SM-P613 (MacOS)

Download Heimdall

  • Download: Heimdall OSX (arm64)
  • NOTE: The frontend doesn't work (UI), use the binary found in heimdall-frontend.app/Contents/MacOS

Installation

Hold vol up + vol down while putting in cable

  • On your Mac, type: ./heimdall flash --RECOVERY <path>/recovery-23.0-20251122-UNOFFICIAL-gta4xlveu/recovery.img --no-reboot
  • On your Mac, type: ./heimdall flash --VBMETA /recovery-23.0-20251122-UNOFFICIAL-gta4xlveu/vbmeta.img --no-reboot
@davidmroth
davidmroth / .bash_profile
Last active August 9, 2025 22:12
Homebrew Setup Mac M1
# !!! IMPORTANT
# Must point to the correct director or this entire script breaks
eval $(/opt/homebrew/bin/brew shellenv)
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/usr/local/google-cloud-sdk/path.bash.inc' ]; then . '/usr/local/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/usr/local/google-cloud-sdk/completion.bash.inc' ]; then . '/usr/local/google-cloud-sdk/completion.bash.inc'; fi
@davidmroth
davidmroth / upgrade_all_node_modules.sh
Last active April 22, 2025 11:58
Upgrade All NPM Modules in One Shot
#https://stackoverflow.com/a/56723462/3697224
node -e "const pk = JSON.parse(require('fs').readFileSync('package.json', 'utf-8'));require('child_process').spawn('npm', ['install', ...Object.keys(Object.assign({},pk.dependencies, pk.devDependencies)).map(a=>a+'@latest')]).stdout.on('data', d=>console.log(d.toString()))"
# Simple Bash Script
for package in $(npm outdated | tail -n+2 | awk '{print $1"@"$4}'); do npm i $package; done
@davidmroth
davidmroth / Tutorial
Created July 21, 2024 16:50
Apache ModRewite
https://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial/
@davidmroth
davidmroth / Conversation Settings
Last active June 15, 2024 16:10
Custom GPTs OAuth Settings and API for Google Sheets
Converstations Starter: Create a new project: Type: Project, Assignee: John, Category: Job
Instructions (appended to your exsting instructions): When a project data is provided, please update Google Sheets ID: `<sheet id>` using `sheets.spreadsheets.values.append` api call with the information provided and starting at range: `Sheet1!A2`, and continue adding rows as needed.
NOTE: How to find the Google Sheet ID - https://stackoverflow.com/questions/36061433/how-do-i-locate-a-google-spreadsheet-id
@davidmroth
davidmroth / cronjob.yaml
Last active June 9, 2024 02:47
Remove Failed Pods
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-deleter-sa
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
@davidmroth
davidmroth / grafana-ingress.yaml
Created June 6, 2024 17:05
Hosting grafana using ingress-nginx behind a sub path
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
name: grafana
namespace: monitoring
spec:
ingressClassName: nginx
@davidmroth
davidmroth / Share Docker Desktop via Port 2375
Created June 2, 2024 08:56
Share Docker Desktop via Port 2375
docker run --name=docker-share --volume=/var/run/docker.sock:/var/run/docker.sock -p 2375:2375 -d alpine/socat tcp-listen:2375,fork,reuseaddr unix-connect:/var/run/docker.sock
@davidmroth
davidmroth / notes.txt
Created May 14, 2024 15:57
Dockerfile Conditional ARGS
FROM node:latest
ARG YARN_OFFLINE
WORKDIR /app
# Install app dependencies
COPY package.json ./package.json
RUN yarn ${YARN_OFFLINE:+--offline}
@davidmroth
davidmroth / dump.txt
Created May 1, 2024 03:35
Drone Config
# status
System Uptime: 93 seconds, Voltage: 0 * 0.1V (3S battery - OK), System load: 0.03
CPU Clock=72MHz, GYRO=MPU6050, ACC=MPU6050.n, MAG=AK8975
Cycle Time: 997, I2C Errors: 0, config size: 2064
# dump
# version
# Cleanflight/SPARKY 1.12.0 Feb 19 2016 / 20:01:50 (aa8608a)
# dump master