Skip to content

Instantly share code, notes, and snippets.

@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 March 21, 2024 15:50
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 (c.tippett@gmail.com)
#
# Originally adapted from the great work by Jared Males (jaredmales@gmail.com)
# https://gist.github.com/jaredmales/2f732254bb10002fc0549fa9aa0abdd7
#
# Copyright (C) 2020 Chris Tippett (c.tippett@gmail.com)
#
@christippett
christippett / profiles.json
Last active April 2, 2020 09:16
Windows Terminal Settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
"alwaysShowTabs": true,
"showTabsInTitlebar": true,
@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",