Skip to content

Instantly share code, notes, and snippets.

View kescherCode's full-sized avatar
📺
amogus

Jeremy Kescher kescherCode

📺
amogus
View GitHub Profile
@kescherCode
kescherCode / README.md
Created June 13, 2023 21:24
Ownership info initcpio hook

How to add

  • Add hooks file as /etc/initcpio/hooks/owner
  • Add install file as /etc/initcpio/install/owner
  • Add owner to the HOOKS array right before any hook that requires user input, like encrypt, to ensure anyone wanting to find out your devices' ownership info by turning it on actually sees it
  • Run mkinitcpio -P as root
@kescherCode
kescherCode / daemon
Last active December 4, 2023 11:18
A rrdtool network graph generator, as seen on https://mirror.kescher.at.
#!/usr/bin/env bash
while :; do
bash loop
sleep 5
done

Keybase proof

I hereby claim:

  • I am keschercode on github.
  • I am kescher (https://keybase.io/kescher) on keybase.
  • I have a public key ASCxlTt6pgNT2_RU5sY5-nWoD6ntKMgAtFaCFuR8BGUIJwo

To claim this, I am signing this object:

@kescherCode
kescherCode / 01-syncarch4edu.sh
Last active March 6, 2022 12:46
A mirror script for the arch4edu repositories. Assume MIT License.
#!/usr/bin/env bash
set -e
# This is a simple mirroring script. To save bandwidth it first checks a
# timestamp via HTTP and only runs rsync when the timestamp differs from the
# local copy. As of 2016, a single rsync run without changes transfers roughly
# 6MiB of data which adds up to roughly 250GiB of traffic per month when rsync
# is run every minute. Performing a simple check via HTTP first can thus save a
# lot of traffic.
@kescherCode
kescherCode / notify_updates.sh
Last active September 23, 2022 12:19
A script for Arch Linux-based machines to send update notifications via mail.
#!/usr/bin/env bash
sudouser="kescher"
aur_helper="yay"
last_update_notification="/usr/local/etc/last_update_notification"
subjectline="Update notification for $(hostname -s)"
fromaddress="Update Notification <no-reply@kescher.at>"
toaddress="Jeremy Kescher <jeremy@kescher.at>"
repo=$(checkupdates)
@kescherCode
kescherCode / bitdepthecho_flac.sh
Created June 18, 2019 10:42
List 24-bit and 16-bit FLACs in current directory.
#!/usr/bin/env bash
# Check if mediainfo is installed. That tool is needed to parse the bit depth of flac files in your current directory.
if ! `hash mediainfo &>/dev/null`; then
echo "Install mediainfo prior to using this script!"
exit 1;
fi
bit24="24-bit:\n"
bit16="16-bit:\n"
# Created by Jeremy Kescher. This file is public domain. Do whatever you want with it.
# Tests TCP connections on ports in range minport - maxport.
# Odd output with Python 2 but works with both Python 2 and 3.
import socket
import sys
import os
# Adjust the min-/maxport if you only want to test for a specific range
minport = 1
@kescherCode
kescherCode / Program.cs
Last active January 30, 2018 21:54
DeletablePrimes Coding Contest exercise in C# - filthyCode
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DeleteablePrimes
{
class Program
{