Skip to content

Instantly share code, notes, and snippets.

View Denperidge's full-sized avatar

Cat Denperidge

View GitHub Profile
{ pkgs, config, ... }:
with pkgs; stdenv.mkDerivation rec {
pname = "caddy";
version = "2.6.2";
dontUnpack = true;
nativeBuildInputs = [ git go xcaddy ];
configurePhase = ''
@Denperidge
Denperidge / default.nix
Created March 3, 2024 22:29
Another attempt at Caddy with plugins!
{ lib
, stdenv
, fetchFromGitHub
, nixosTests
, caddy
, testers
, installShellFiles
, autoPatchelfHook
}:
let
@Denperidge
Denperidge / default.nix
Last active March 3, 2024 22:21
Attempt at a Caddy package with an addon!
{ lib, stdenv, fetchurl, autoPatchelfHook }:
stdenv.mkDerivation rec {
pname = "caddy-plugin";
version = "0.1.0";
src = fetchurl {
url = "https://caddyserver.com/api/download?os=linux&arch=arm64&p=github.com%2Fcaddy-dns%2Fporkbun";
};
nativeBuildInputs = [
@Denperidge
Denperidge / default.nix
Last active March 1, 2024 16:40
Nix caddy with modules maybe?
{ lib
, buildGoModule
, fetchFromGitHub
, nixosTests
, caddy
, testers
, installShellFiles
}:
let
version = "2.7.6";
# Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml
name: Build static & deploy to GitHub Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@Denperidge
Denperidge / date-recursive.py
Created March 4, 2023 14:43
Hope to move this to a dedicated script repo soon! But for backups sake:
from glob import glob
from pathlib import Path
from sys import argv
from os import system
from re import search, RegexFlag
from datetime import datetime
#exiftool -r "-FileCreateDate<DateTimeOriginal" "-FileModifyDate<FileCreateDate" "%1%"
DATE_FORMAT_STRING = "%Y%m%d_%H%M%S__" # == yyyyMMdd_HHmmss__
NAME_FORMATTED = r"[^a-z]{1,}_{2}"
@Denperidge
Denperidge / gh-card-png.sh
Created January 2, 2023 16:29
Leverages the gh-card project to create PNG's. Because Google Docs doesn't support SVG's.
#!/bin/bash
read -p 'User: ' user
repo='Placeholder'
while [ "$repo" ]
do
read -p 'Repo: ' repo
wget "https://gh-card.dev/repos/$user/$repo.svg"
inkscape "$repo.svg" --export-type=png -h 540 -o "$repo.png"
@Denperidge
Denperidge / azerty-power-to-ltgt.md
Last active December 6, 2022 13:16
Typing <> on a qwerty keyboard converted to azerty is a challenge, so lets make it a bit simpler

Normally you have to type SHIFT+ALTGR+W/X for <>, which is not, good.

This command will remap the ²³ key to be <> for the current session

xmodmap -e "keycode 49 = less greater less greater backslash backslash backslash"

How I got the relevant keycodes & names (mostly added for future references)

@Denperidge
Denperidge / DotConfig.md
Created October 3, 2022 22:51
A writeup of how I store and update my config files!

Dotconfig

The method with which I securely and easily keep track of my local config files.

The basic workflow consists of creating a private (GitHub) Repo with the following structure

  • {SERVERNAME}.{CONFIGFILENAME}: for example, raspberrypi.docker-compose.yml. These can be as many as you want.
  • {SERVERNAME}.config.sh: a script that clones or pulls the repo, and creates symbolic links for the necessary files. The code for this will be shown below.

From there, you can simply run the X.config.sh files using a cronjob, systemd, or just manually.