Skip to content

Instantly share code, notes, and snippets.

@apfelchips
apfelchips / macOS-shortcuts.ahk
Last active November 20, 2025 06:06
First remap modifier keys with sharpkeys; AHK script has to run as Administrator to work on System Windows / Apps running as Administrator; see Watchdog ScheduledTask below, when you do this make sure to remove the inherited file permissions from C:/tools and only allow administrators write access.
#SingleInstance force
;#Persistent https://www.autohotkey.com/docs/commands/_Persistent.htm
;#InstallKeybdHook ; see: https://www.autohotkey.com/docs/v1/lib/_HotkeyModifierTimeout.htm
;#NoTrayIcon
TraySetIcon("accessibilitycpl.dll","6") ; Keyboard Icon
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
; Debugging
; #Warn All, OutputDebug ; Show Warnings in DebugView ( https://learn.microsoft.com/en-us/sysinternals/downloads/debugview )
@apfelchips
apfelchips / user.js
Last active November 19, 2025 22:28
~ 🥖.config🥖firefox🥖Profiles🥖profile.default🥖user.js
// src: https://gist.github.com/apfelchips/f129c8316055e524774d757365267e26
// goal: disable all annoying stuff from firefox and tighten security, but still retain all modern web features
// configure as little as possible to benefit from changeing/hardened defaults by Mozilla
// inspired by:
// https://github.com/pyllyukko/user.js/blob/master/user.js
// https://github.com/ghacksuserjs/ghacks-user.js/blob/master/user.js
// http://kb.mozillazine.org/About:config_entries
// https://gist.github.com/ruilapa/3207798
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sidebar HTML Template</title>
<style type="text/css">
#nav {
@apfelchips
apfelchips / defaults.duti
Last active September 30, 2025 20:59
set file-associations on macOS: ~/.config/duti/defaults.duti
# duti settings file
# src: https://gist.github.com/apfelchips/0073cb3e8d186115f590d318998c1025
# mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/duti/" && curl -L "https://git.io/JRtzH" -o "${XDG_CONFIG_HOME:-$HOME/.config}/duti/default.duti"
# duti-apply wrapper: alias duti-apply='duti -v "${XDG_CONFIG_HOME:-$HOME/.config}/duti"'
## duti documentation http://duti.org/documentation.html
## see also: https://github.com/Lord-Kamina/SwiftDefaultApps#readme
# List of MIME Types:
@apfelchips
apfelchips / ipa-renamer.sh
Last active August 16, 2025 18:49
rename IPA files by parsing the contained info.plist and analyzing the main macho binary
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
# src: https://gist.github.com/apfelchips/5336fd75a18bd9137266abd356f31c6f
# required commands: xmllint unzip plutil llvm-objdump
# plutil is provided by the gnustep-base-runtime package on debian / ubuntu
# llvm-objdump from the llvm package
RENAME=1
VERBOSE=0
@apfelchips
apfelchips / .stignore_synced
Last active August 13, 2025 02:47
Backup / Sync exclusion patterns
// https://docs.syncthing.net/users/ignoring
// (?d) prefix to allow deletion of ignored files
// (?i) prefix makes the matching case insensitive
// echo #include .stignore_synced >> .stignore
(?d)(?i).Trash
(?d).DS_Store
._*
(?d)(?i)Thumbs.db
@apfelchips
apfelchips / keyremap.sh
Last active June 23, 2025 21:35
macOS US layout fix tick location on ISO Keyboards + Capslock --> LCtrl
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
if [ "$(id -u)" -ne 0 ]; then
echo "Script has to be run as root"
exit 1
fi
KEYMAP=$(cat << EOF | tr -d ' ' | grep -v '^#' | tr -d '\n'
@apfelchips
apfelchips / .lftp.mockup.rc
Created June 21, 2025 09:49 — forked from gaubert/.lftp.mockup.rc
~/.lftp.rc parameters detailed
########## SETTINGS
# On startup, lftp executes ~/.lftprc and ~/.lftp/rc. You can place aliases and 'set' commands
# there. Some people prefer to see full protocol debug, use 'debug' to turn the debug on.
# Certain commands and settings take a time interval parameter. It has the format Nx[Nx...], where N is time amount
# (floating point) and x is time unit: d - days, h - hours, m - minutes, s - seconds. Default unit is second. E.g.
# 5h30m or 5.5h. Also the interval can be 'infinity', 'inf', 'never', 'forever' - it means infinite interval. E.g.
# 'sleep forever' or 'set dns:cache-expire never'.
@apfelchips
apfelchips / ~ 🥖bin🥖init_osx.sh
Last active June 12, 2025 14:34
initialize macOS.
#!/bin/bash
# https://www.defaults-write.com
# https://github.com/joeyhoer/starter/tree/master/system
# https://github.com/atweiden/macfiles/blob/master/macos.sh
# https://gist.github.com/ryanpcmcquen/b2e608311f286a4ab3e1
# https://github.com/herrbischoff/awesome-macos-command-line
#
# discover filesystem changes: sudo filemon -c
#
@apfelchips
apfelchips / aliexpress_en.js
Last active May 21, 2025 23:57
userscript that forces aliexpress.com to be in english
// ==UserScript==
// @name aliexpress_en
// @version 0.2
// @description always redirect to aliexpress.com and reset the location/language/currency settings. This script pins locale settings cookie. Please clear cookies on all "aliexpress" domains before using this userscript.
// @author @attero@mastodon.social
// @match *://www.aliexpress.com/*
// @match *://*.aliexpress.com/*
// @match *://www.aliexpress.ru/*
// @match *://*.aliexpress.ru/*
// @noframes