Skip to content

Instantly share code, notes, and snippets.

View noflcl's full-sized avatar

Stephen McNamara noflcl

View GitHub Profile
@noflcl
noflcl / networking.nix
Created September 20, 2024 10:59
nixos router
```nix
{ config, pkgs, ... }:
{
boot.kernel = {
sysctl = {
"net.ipv4.conf.all.forwarding" = 1;
"net.ipv4.conf.default.rp_filter" = 1;
"net.ipv4.conf.WAN.rp_filter" = 1;
"net.ipv4.conf.br0.rp_filter" = 0;
@noflcl
noflcl / tailscaleRocky.sh
Last active July 28, 2026 06:11
tailscale install for Rocky Linux
sudo dnf config-manager --add-repo https://pkgs.tailscale.com/stable/rhel/9/tailscale.repo
sudo dnf update
sudo dnf install tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up --ssh
@noflcl
noflcl / devuan.sources.list
Created October 12, 2024 15:37
devuan apt sources list
deb http://deb.devuan.org/merged daedalus main
deb http://deb.devuan.org/merged daedalus-updates main
deb http://deb.devuan.org/merged daedalus-security main
deb-src http://deb.devuan.org/merged daedalus-security main
@noflcl
noflcl / systemdBusEnv
Created October 14, 2024 14:44
Rocky no desktop install is missing user environment variable for local systemd control
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
@noflcl
noflcl / mkdocs-runner.yaml
Last active February 19, 2025 15:27
Builds and pushes signed commits - base image is Ubuntu 22.04 for build env
name: Forgejo local runner building mkdocs and deploying to pages
on:
push:
branches:
- 'main'
paths:
- 'mkdocs.yaml'
- 'docs/*'
- 'README.md'
@noflcl
noflcl / tmux-launch.sh
Created November 3, 2024 14:47
tmux launch new windows under "trunk" session starting at branch0
if ! [ "$(tmux ls | cut -d: -f1)" = "trunk" ]; then
tmux new-session -d -s trunk -n branch0
tmux attach-session -t trunk:branch0
elif [[ -z "${TMUX}" ]]; then
branch_id="$(tmux ls | cut -d ' ' -f2)"
tmux new-window -d -n branch$branch_id -t trunk:
tmux attach-session -t trunk:$branch_id
else
branch_id="$(tmux ls | cut -d ' ' -f2)"
tmux new-window -n branch$branch_id -t trunk:
@noflcl
noflcl / Win11-Pro-Force.md
Last active January 19, 2025 15:10
Two files required to force Windows 11 to install Professional

Lenovo embedded a PreAuthroized OS License for Windows Home edition inside the BIOS. Windows11 tries really hard to force Home edition within a fresh install. How do you bypass this?

Create Windows11 USB, mount and place the following two files under the sources folder inside the root of the live USB.

Note: If creating ei.cfg within notepad, Save-as and "Filetype" set to All Files so the text file saves as a proper .cfg

Otherwise notepad will set the header to plaintext and the installer won't recognize it.

ei.cfg

@noflcl
noflcl / pihole-v6.md
Last active February 19, 2025 15:42
PiHole V6 podman container using Nix oci-containers

PiHole V6

Are you using Nix? Have you been using oci-containers turing your Docker compose files into systemd podman services?

Probably should check it out, it's sweet!

Note: You must create your mapped volumes locally before the container will start.

Since they have dropped .php the new dashboard URL is http's'://server-ip/admin/login

  virtualisation = {
@noflcl
noflcl / optional-nix-code.md
Created June 21, 2025 02:34
Two ways you can have optional nix code apply to a system based on the hostname

Hostname based nix code

You will use hostname = config.networking.hostName; to gather the hostname of the device you are running the nixos-rebuild switch command on

{ config, pkgs, ... }:

let
  hostname = config.networking.hostName;
@noflcl
noflcl / convert-docx-to-md.sh
Created July 6, 2025 15:11
Watch directory for new .docx files, convert to markdown and delete source file if successful
#!/bin/bash
# Set the source and destination directories
SRC_DIR=/path/to/source
DST_DIR=/path/to/destination
# Create the destination directory if it doesn't exist
mkdir -p "$DST_DIR"
# Watch the source directory for new .docx files