Skip to content

Instantly share code, notes, and snippets.

View beret's full-sized avatar

beret

View GitHub Profile
@oko
oko / mkpool.py
Created July 15, 2023 20:43
Scripts for creating ZFS pool w/ mirror vdevs on QNAP TS-673A
#!/usr/bin/env python3
import argparse
import itertools
import os
import subprocess
import sys
parser = argparse.ArgumentParser(description="set up zfs pool")
parser.add_argument("--mirror-size", type=int, default="2")
parser.add_argument("--disk-name-filter", type=str, default="*-ata-*.0")
@lucasluitjes
lucasluitjes / auto_pop.py
Last active September 3, 2021 05:00
automatically generate a click for the talon zoom mouse every n seconds
# This script automatically generates a pop for the talon zoom mouse every n seconds,
# then another one 2 seconds later. For when you want to do a ton of clicking actions
# without getting jaw cramp. If you don't want to click, just look away within 2 seconds.
from talon import Context, Module, actions, app, cron, ctrl, imgui, noise, settings, ui
from talon_plugins import eye_mouse, eye_zoom_mouse, speech
from talon_plugins.eye_mouse import config, toggle_camera_overlay, toggle_control
# Put the following at the bottom of talon/resources/talon_plugins/eye_zoom_mouse.py
# (you will need to reapply this after every talon update)

hi, and goodbye

The past few weeks has not been fun on IRC, the drama based on false information and assumptions has been insane. I've almost entirely been silent on the drama because I know the fallout that would happen if I spoke up.

A quick TLDR - I'm quitting all IRC development. KiwiIRC project lead, IRCv3 technical board, supporting the multitude of IRC networks, the lot.

Many people seem to think that I am supporting one side in everything that is going on, so just to be clear: I am not supporting any side of the current freenode drama - there is so much false information going around from everywhere that it is impossible to support anybody.

Woo freenode drama

@tararoys
tararoys / May12knausj-master-cheatsheet.pdf
Last active July 12, 2025 13:33
Code to print out all voice commands in the knausj talon repository,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joevt
joevt / M1MacTimings.sh
Last active September 3, 2022 15:30
List the display timings on an M1 Mac
#!/bin/bash
# by joevt Jan 7/2021
dodump=1
if [[ "$1" == "-s" ]]; then
dodump=0
shift
fi
@Te-k
Te-k / pdf_metadata.md
Created November 26, 2020 10:31
How to remove metadata from PDFs

Many tools do not fully remove metadata, but just remove the link with in the metadata table. The data are thus still available in the PDF file itself.

While a lot of people rely on Exiftool to remove metadata, it actually does the same in PDFs. If you remove metadata with exiftool -all= some.pdf, you can always restore the data with exiftool -pdf-update:all= some.pdf.

There are several options to remove PDF metadata safely:

Option 1 : Exiftool with qpdf

  • Remove metadata with exiftool : exiftool -all= some.pdf
  • Then remove ununsed objects with qpdf : qpdf --linearize some.pdf - > some.cleaned.pdf
@ayyybe
ayyybe / ccdl.command
Last active February 17, 2026 21:18
Adobe Offline Package Builder v0.1.2 (macOS only) --- No longer being maintained.
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@tvwerkhoven
tvwerkhoven / dedupe.sh
Last active May 9, 2026 03:05
De-duplicate using APFS clonefile(2) and jdupes in zsh
#!/usr/bin/env zsh
#
# # About
#
# Since APFS supports de-duplication on block-level, it can be useful to
# manually de-duplicate your files if you've migrated/upgrade to APFS not
# using a fresh install.
#
# I've written this simple script with the aim to:
# - Be simple, easy to read and understand (for users to check)
@akiross
akiross / cifs_automount.md
Last active May 23, 2026 06:39
Automatically mount shared windows folders at boot on linux w/ systemd

Automount of CIFS (smbfs) folders w/ systemd

i.e. mounting your Windows shares on Linux at boot

First, let's see how to mount the remote directory. Assume that there is a shared folder over the network at \\192.168.1.1\users\self\shared which is accessible with user myuser and password secret123.

We could mount it manually in /mnt/winshare with:

# mount -t cifs //192.168.1.1/users/self/shared /mnt/winshare -o user=myuser,password=secret123

This should work on your Linux box, because systemd will basically call mount with the same arguments: What (//192.168.1.1/users/self/shared), Where (/mnt/winshare) and Options (user=myuser,password=secret123).

@masklinn
masklinn / cheatsheet.md
Last active June 10, 2026 11:53
launchctl/launchd cheat sheet

I've never had great understanding of launchctl but the deprecation of the old commands with launchctl 2 (10.10) has been terrible as all resources only cover the old commands, and documentation for Apple utilities is generally disgracefully bad, with launchctl not dissembling.

Mad props to https://babodee.wordpress.com/2016/04/09/launchctl-2-0-syntax/ which contains most details

domains

Internally, launchd has several domains, but launchctl 1 would only ask for service names,