Skip to content

Instantly share code, notes, and snippets.

@tgrushka
tgrushka / install-headscale.sh
Last active March 26, 2025 20:30
Headscale Install Debian
#!/bin/bash
set -euo pipefail
apt-get install -y jq || true
# Check required commands
command -v curl >/dev/null || { echo "Error: curl required" >&2; exit 1; }
command -v jq >/dev/null || { echo "Error: jq required" >&2; exit 1; }
@tgrushka
tgrushka / wakeup-bluetooth-linux.sh
Last active March 20, 2025 23:33
This script adds a udev rule to enable wakeup for each bluetooth device on the linux system in /sys/bus/usb/devices
#!/usr/bin/env bash
# This script creates a udev rule for each bluetooth controller to enable wakeup from suspend.
# Find and loop over all bluetooth files within /sys/bus/usb/devices.
# (There is only one Bluetooth controller on my system, but this should work if you have more than one.)
# Get the directory path for each bluetooth device.
# On my Framework 16, this returns: /sys/bus/usb/devices/1-5:1.0
# `find -L` follows symlinks; `-maxdepth 2` prevents infinite recursion; `xargs dirname` gets the directory name of the bluetooth file
for path in $(find -L /sys/bus/usb/devices -maxdepth 2 -name bluetooth | xargs dirname); do
# Get the "parent" USB controller by trimming the :1.0 (or :whatever) from the path.
path="${path%:*}"
@tgrushka
tgrushka / flutter_bootstrap.js
Last active January 26, 2025 23:16
Flutter Web Loading Progress Bar
// prettier-ignore
{{flutter_js}}
// prettier-ignore
{{flutter_build_config}}
// Place this file at web/flutter_bootstrap.js in your Flutter Web project.
// IMPORTANT! The two tokens at the top of this file must not contain any spaces.
const APP_NAME = document.title
document.body.style.backgroundColor = "#000"
@tgrushka
tgrushka / caffeinate
Last active August 7, 2024 20:44
Linux Gnome caffeinate shell script - Keep system awake / prevent sleep, like caffeinate on macOS
#!/usr/bin/bash
# caffeinate: Keep system awake / prevent sleep, like caffeinate on macOS.
# for Gnome desktop
# USAGE:
# Place this script somewhere in $PATH and set executable.
# Run `caffeinate` from terminal.
# Hit Ctrl-C to stop.
# To timeout, run `timeout SECONDS caffeinate`, where SECONDS is # of seconds.
@tgrushka
tgrushka / resume.json
Last active April 28, 2024 11:43
JSON Resume
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Thomas (Tom) Grushka, M.S., CPWA",
"label": "Leading Software and Data Engineering Wizard",
"image": "",
"email": "[email protected]",
"phone": "+1 720 495 7323",
"url": "https://linkedin.com/in/tgrushka",
"summary": "I’m a full-stack mobile and web engineer who architects apps and their infrastructures from the ground up. Having worked for both small and large companies, I am well-versed in a variety of programming frameworks and development processes. My expertise in accessibility is an advantage that adds unique value to my projects.",
// Adapted from https://github.com/jfortunato/esbuild-plugin-manifest/blob/develop/src/index.ts
// Plugin I modified to make esbuild generate a manifest for Spring Boot application. No longer used.
import fs from "fs"
import path from "path"
import util from "util"
export default (options = {}) => ({
name: "manifest",
setup(build) {
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.io.ClassPathResource
import org.springframework.integration.config.EnableIntegration
import org.springframework.integration.dsl.integrationFlow
import org.springframework.integration.file.FileHeaders
import org.springframework.integration.file.dsl.Files
import org.springframework.integration.file.filters.ChainFileListFilter
import org.springframework.integration.file.filters.FileListFilter
import org.springframework.integration.file.filters.SimplePatternFileListFilter