Skip to content

Instantly share code, notes, and snippets.

View heywoodlh's full-sized avatar
:octocat:
Trapped in Vim

Spencer Heywood heywoodlh

:octocat:
Trapped in Vim
View GitHub Profile
@heywoodlh
heywoodlh / server.toml
Last active April 28, 2024 17:50
atticd configuration
# Socket address to listen on
listen = "[::]:8080"
# Allowed `Host` headers
#
# This _must_ be configured for production use. If unconfigured or the
# list is empty, all `Host` headers are allowed.
allowed-hosts = []
# The canonical API endpoint of this server
@heywoodlh
heywoodlh / README.md
Last active May 7, 2024 22:09
Script for installing Linux environments

Usage:

Workstation:

curl -L https://files.heywoodlh.io/scripts/linux.sh | bash -s -- workstation --ansible --home-manager

Server:

@heywoodlh
heywoodlh / mullvad-browser.nix
Created March 18, 2024 16:32
Example Home-Manager snippet using my branch of Home-Manager for Mullvad Browser
{ config, pkgs, home-manager, nur, mullvad-browser-home-manager, ... }:
let
system = pkgs.system;
browser = if system == "aarch64-linux" then "firefox" else "mullvad-browser";
noproxies = "localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10,.ts.net";
socksProxy = "some-socks-proxy.example.ts.net";
socksPort = 1080;
browser-settings = if browser == "mullvad-browser" then {
"browser.compactmode.show" = true; # enable compact bar
---
apiVersion: v1
kind: Service
metadata:
name: second
namespace: default
labels:
app.kubernetes.io/name: second
app.kubernetes.io/instance: second
spec:
@heywoodlh
heywoodlh / flake.nix
Created February 15, 2024 23:36
Example NixOS flake
{
description = "example nixos/nix-darwin/home-manager/nix-droid flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
darwin = {
url = "github:LnL7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
@heywoodlh
heywoodlh / debloat.sh
Last active December 30, 2023 04:47
Debloat Android (specifically, Moto G 5G)
#!/usr/bin/env bash
# Install F-Droid
if adb shell pm list packages | grep -q org.fdroid.fdroid
then
echo 'F-Droid already installed, skipping.'
else
echo 'Installing F-Droid.'
curl -o /tmp/F-Droid.apk https://f-droid.org/F-Droid.apk
adb install /tmp/F-Droid.apk
apiVersion: k0sctl.k0sproject.io/v1beta1
kind: Cluster
spec:
hosts:
- role: controller+worker
ssh:
address: 100.89.165.64
user: nathanhywd
noTaints: true
privateInterface: tailscale0
@heywoodlh
heywoodlh / ish-setup.sh
Last active May 25, 2023 03:48
My shell script for setting up iSH
#!/usr/bin/env ash
## Enable location, allow iSH to run in background
grep -q '/dev/location' $HOME/.profile || echo 'cat /dev/location > /dev/null &' >> $HOME/.profile && source $HOME/.profile
# Install my dependencies
apk update
apk add vim git coreutils openssh-client mosh tmux curl
# Setup tmux
@heywoodlh
heywoodlh / example-1.nix
Created April 14, 2023 20:08
Example of Nix's option expansion
{
programs.zsh.enable = true;
programs.zsh.enableAutosuggestions = true;
programs.zsh.envExtra = ''
export MYVAR="true"
export MYVAR2="false"
'';
}
#!/usr/bin/env bash
title="Battery"
battery_level="$(pmset -g batt | grep 'InternalBattery' | awk '{print $3 $4}' | awk '{print $1}' | cut -d';' -f1)"
osascript -e "display notification \"${battery_level}\" with title \"${title}\""