Skip to content

Instantly share code, notes, and snippets.

View christippett's full-sized avatar

Chris christippett

View GitHub Profile
@christippett
christippett / tailscale-install.sh
Created May 31, 2024 23:14
Install Tailscale on Steam Deck ft. SquashFS & systemd-sysext
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# _____ _ _ _
# /__ \__ _(_) |___ ___ __ _| | ___
# / /\/ _` | | / __|/ __/ _` | |/ _ \
# / / | (_| | | \__ \ (_| (_| | | __/
# \/ \____|_|_|___/\___\__,_|_|\___| _ _
# ,d88b.d88b, / _\ |_ ___ __ _ _ __ ___ __| | ___ ___| | __
# 88888888888 \ \| __/ _ \/ _` | '_ ` _ \ / _` |/ _ \/ __| |/ /
# `Y8888888Y' _\ \ || __/ (_| | | | | | | (_| | __/ (__| <
@christippett
christippett / macos-plex-tls.sh
Created April 12, 2024 13:15
Configure Plex TLS with Tailscale on macOS
#!/bin/sh
DOMAIN='______.ts.net'
PASSWORD="____"
tailscale_cert="$HOME/Library/Containers/io.tailscale.ipn.macos/Data/${DOMAIN}.crt"
tailscale_key="$HOME/Library/Containers/io.tailscale.ipn.macos/Data/${DOMAIN}.key"
plex_cert="$HOME/Application Support/Plex Media Server/https.p12"
@christippett
christippett / split-grid.sh
Last active February 3, 2024 01:13
Split Midjourney image grid into individual images
#!/bin/sh
set -e
ext=".$(basename "$1" | rev | cut -d'.' -f1 | rev)"
fname="$(basename "$1" "$ext")"
width="$(identify -format "%w" "$1")"
height="$(identify -format "%h" "$1")"
@christippett
christippett / README.md
Last active January 28, 2023 19:33
Custom Userstyle – freedesktop.org

freedesktop.org userstyle

A few light touches to improve the experience of finding and reading the documentation on freedesktop.org.

Install directly with Stylus

Screenshots

1

@christippett
christippett / README.md
Last active September 4, 2024 21:13
Hacker News Stylesheet

Hacker News userstyle

A modern re-styling of the Hacker News front page, including automatic light/dark mode.

Install directly with Stylus

Screenshots

HN 1

@christippett
christippett / doit.tf
Last active June 11, 2020 15:09
Terraform definition to create a service account for DoIT in Google Cloud Platform
locals {
org_id = ""
project_id = ""
}
resource "google_service_account" "doit" {
account_id = "doit-management"
display_name = "DoiT Service Account"
project = local.project_id
}
@christippett
christippett / rclone-cron.sh
Last active April 13, 2024 20:20 — forked from jaredmales/rclone-cron.sh
An rclone backup script for cron
#!/bin/bash
##############################################################################
# An rclone backup script by Chris Tippett ([email protected])
#
# Originally adapted from the great work by Jared Males ([email protected])
# https://gist.github.com/jaredmales/2f732254bb10002fc0549fa9aa0abdd7
#
# Copyright (C) 2020 Chris Tippett ([email protected])
#
@christippett
christippett / build.sh
Last active September 11, 2023 05:53
Trigger Cloud Builds in a mono-repo
#!/bin/sh -e
IGNORE_FILES=$(ls -p | grep -v /)
TRACKING_BUCKET="$COMMIT_STATE_BUCKET/$REPO_NAME/$BRANCH_NAME"
detect_changed_folders() {
gsutil cp gs://$TRACKING_BUCKET/LAST_COMMIT . &> /dev/null || true
last_commit_sha=`cat LAST_COMMIT 2> /dev/null || git rev-list --max-parents=0 HEAD`
echo "Detecting changes from last build: $last_commit_sha"
folders=`git diff --name-only "$last_commit_sha" | sort -u | awk 'BEGIN {FS="/"} {print $1}' | uniq`
export changed_components=$folders
@christippett
christippett / poll_dataflow_status.sh
Last active May 8, 2019 14:31
Shell script to poll successful completion of Dataflow job
#!/bin/sh
JOB_ID=$1
SLEEP_TIME=10
echo "Polling status for Dataflow job: ${JOB_ID}"
check_job_status() {
echo "${JOB_STATUS}" | grep "JOB_STATE_DONE\|JOB_STATE_CANCELLED\|JOB_STATE_FAILED\|JOB_STATE_DRAINED\|^$" > /dev/null
GREP_RETURN_CODE=$?
if [ ${GREP_RETURN_CODE} -eq 0 ]
then
@christippett
christippett / gcs_mover.py
Created February 11, 2019 04:27
Migrate GCS bucket(s) from one project/location to another
import uuid
from google.cloud import storage
from google.cloud.storage import blob, bucket
client = storage.Client()
BUCKETS = [
"bucket-a",