Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

47 total results found

Technical

Bash

Files

Manipulating files with tools

Matrix

Working with the Matrix Network

Linux

Docker

Bread

Meat

Date & Time

Bash

File Operations

Bash

Media Repository

Matrix

Working with 3rd party Matrix Media Repository

Snippets

Bash

A collection of (!)useful chunks to get things done..

Arch

Linux

Git

Linux

NixOS

Linux

SystemD

Linux

Dates

Bash Date & Time

date +'%Y-%m-%d' 2023-02-28 date --date='2 days ago' +'%Y-%m-%d' 2023-02-26 date +'%s' 1677607151 date --date @1677607151 +'%Y-%m-%d.%H:%M:%S %Z' 2023-02-28.09:59:11 PST

Time Elapsed

Bash Date & Time

start_time=$(date +'%s') sleep 5 end_time=$(date +'%s') total_time="$(echo $((end_time-start_time)))" echo "${total_time}" | awk '{printf "%dh%02dm%02ds", $1/3600, ($1/60)%60, $1%60}' 0h00m05s

Delete older than..

Bash File Operations

Find directories and delete recursively find /path/ -mtime +7 -type d -exec rm -rf {} + Find files and delete recursively find /path/ -mtime +7 -type f -exec rm -rf {} +

Variables

Bash

Uppercase VAR="vaRiAbLe" echo "Uppercase ${VAR^^}" VARIABLE Lowercase echo "Lowercase ${VAR,,}" variable First Letter Capitalized echo "First Letter Capitalized: ${VAR^}" Variable

JSON

Files

XML

Files

YAML

Files

Scratchpad 1 yq -n ' .listeners =[ { "type": "http", "port": 8080, "tls": false, "x_forwarded": false, "resources": "foo" ...

Import / Export

Matrix Media Repository

Export Data from Synapse Make sure that there is access to the Synapse DB and the Synapse media_store mkdir -p /tmp/export export_synapse_for_import \ -ServerName synapse.example.com \ -destination /tmp/e...

Gitlab

Bash Snippets

Working with the API Get CSV of all open issues on instance #!/bin/bash TOKEN=get_your_token URL=https://your.gitlab.instance.tld/ PAGE=1 while [ "${PAGE}" -lt "50" ] ; do curl --header "PRIVATE-TOKEN: ${TOKEN}" "${URL}/api/v4/issues?scope=all&state=opene...

Web

Bash Snippets

Working with remote APIs Check status of a website that is locked behind an authorization cookie. #!/bin/bash ### authenticate() { headers=$(mktemp) authenticate_response=$(curl -sSL -D $headers \ -H "Accept: ...

Rebuild Python Packages

Linux Arch

When new versions of python is released there are packages that are needing to be rebuilt. yay -S $(pacman -Qoq /usr/lib/python3.10) --answerclean All

Migrate Github Repository to Gitea

Linux Git

GITHUB_AUTH_TOKEN=1234 GITEA_AUTH_TOKEN=5678 GITEA_URL=https://git.example.com _payload=$(mktemp) cat <<EOF > ${payload} { "auth_token": "${GITHUB_AUTH_TOKEN}", "clone_addr": "https://github.com/tiredofit/$1.git", "issues": true, "pull_requests": true, "priv...

Installing NixOS (Encrypted BTRFS Impermanance)

Linux NixOS

Intro This details the steps to create a LUKS encrypted BTRFS NixOS installation with impermanance, only keeping the settings that are required in between reboots. Features: UEFI Boot w/GRUB Encrypted Btrfs File System with hourly snapshots on /home and /var/...

Creating BTRFS Disk Snapshots

Linux NixOS

The following shows two alternate ways to be performing BTRFS snapshots on a NixOS system. First - a look at how the disk is setup: Disk Setup # /etc/fstab /dev/disk/by-uuid/1234567890-abcdef-0987654321-fedcba /home btrfs subvol=home/active,compress=zstd,noat...

OnCalendar / Timer examples

Linux SystemD

Frequency Code Every Minute *-*-* *:*:00 Every 2 minute *-*-* *:*/2:00 Every 5 minutes *-*-* *:*/5:00 Every 15 minutes *-*-* *:*/15:00 Every quarter hour *-*-* *:*/15:00 Every 30 minutes *-*-* *:*/30:00 Every half an hour *-*-* *:*/30:00 E...

Home Manager Setup

Linux NixOS

Manage user environments with Home Manager Manage personal configuration files and profiles with Home Manager, similar to the way that system configuration is performed, but don't require users to have root access. This is a work in progress. TODO Optimize p...

Writing Scripts in Nix

Linux NixOS

Create executible shell script writeShellScriptBin # custom-script.nix { pkgs, config, ...}: let custom_script = pkgs.writeShellScriptBin "script_name" '' function() { if [ -n "$1" ] ; then echo $1 fi } ''; in { ho...

Secrets Management

Linux NixOS

Managing secrets with SOPS-Nix. Install NixOS Subset of flake.nix # flake.nix { inputs = { sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs@{ sops-nix, ... }: { ni...

Setup Docker Swarm

Docker

This is a guide on setting up the NG Network Prequisites Working VPN (Tailscale/Headscale) allowing ESP In order to use an encrypted overlay network Headscale must be configured to allow ESP (Protocol 50) through its tunnel. Sample ACL: "acls": [ ...

Installing NixOS on Raspberry PI 3B

Linux NixOS

This is assumed that you already have access to a running NixOS System - We'll be using a NixOS system to do the building of packages and copying the changes over via SSH as the SOC is just so underwhelming.. Initial Configuration Download SD Image from Hydra...