Skip to content

Instantly share code, notes, and snippets.

View Expertcoderz's full-sized avatar
:octocat:
Meow.

Expertcoderz Expertcoderz

:octocat:
Meow.
View GitHub Profile
@Expertcoderz
Expertcoderz / MergeGPOBackups.ps1
Last active March 18, 2025 13:27
Combine many Windows GPO backups into one. For working with live GPOs, consider this instead: https://learn.microsoft.com/en-us/archive/blogs/ashleymcglone/updated-copy-and-merge-group-policies-gpos-with-powershell
<#
.SYNOPSIS
Combines Group Policy Object (GPO) backups from multiple source directories
into a single unified directory containing the GPO backups.
.DESCRIPTION
Combines Group Policy Object (GPO) backups from multiple source directories
into a single unified directory containing the GPO backups.
Duplicate GPOs will be ignored based on display name.
@Expertcoderz
Expertcoderz / serialize.luau
Last active March 18, 2025 13:25
Serialize Luau data into a string representation suitable for display. Intended for use as a Roblox ModuleScript to aid in debugging.
--[[
Description: This module provides a single function to serialize arbitrary data
(tuple accepted) into a string representation suitable for display.
Author: Expertcoderz (GH/RBX)
]]
local BUILTIN_TABLES: {[{}]: string} = {
-- Types
[Axes] = "Axes",
@Expertcoderz
Expertcoderz / credstore.py
Created January 4, 2025 08:51
An old attempt at creating a CLI password manager. Uploaded for archival purposes. UI somewhat inspired by diskpart.exe from MS Windows.
#!/usr/bin/env python3
import os
import re
import string
import signal
import json
import hashlib
from sys import argv, exit
from random import shuffle
@Expertcoderz
Expertcoderz / filemod.sh
Created July 17, 2025 14:08
Modify a hierarchy of files, based on a text specification. Conceptually similar to mtree(8) from the BSDs, but simpler and implemented in POSIX sh.
#!/usr/bin/env sh
#
# filemod.sh: a tool for modifying inode metadata in bulk, based on
# a text-based declarative specification passed from standard input.
#
# Usage: echo '<specification>' | filemod.sh <root directory>
#
# Define $FILEMOD_DEBUG to enable verbose diagnostics.
#
# Specification syntax example:
@Expertcoderz
Expertcoderz / private_attribute.py
Last active September 18, 2025 15:05
PoC implementation of private instance attributes for Python, using descriptors and runtime introspection.
"""
Truly Private Instance Attributes for Python
(Proof-of-concept, for-fun demonstration only. And probably not a good idea...)
This module provides the PrivateAttribute descriptor class,
which can be used to implement "truly private" instance attributes.
Direct access to instance attributes managed by the PrivateAttribute
descriptor can only be performed from instance methods under the
owner class. Attempting to read or write private attributes from
@Expertcoderz
Expertcoderz / toggle-charselector.py
Created September 18, 2025 07:26
Fuzzel script collection for use with a Wayland desktop. Uploaded for archival purposes. See: https://codeberg.org/dnkl/fuzzel
#!/usr/bin/env python3
from sys import exit
from subprocess import run, PIPE
from unicodedata import name as unicode_name
if run(["/usr/bin/pkill", "-x", "fuzzel"]).returncode == 0:
exit(0)
chars = []
@Expertcoderz
Expertcoderz / launchmimeapp.sh
Created September 18, 2025 07:37
Launch the XDG desktop app associated with a MIME type. Like xdg-open(1), but without supplying a file.
#!/usr/bin/env sh
#
# launchmimeapp.sh: launch the XDG desktop application associated
# with a given MIME type. Similar to xdg-open(1) but without the
# need for passing a specific file corresponding to the MIME type.
#
# Usage: launchmimeapp.sh <MIME type> [<app arguments>]
#
# Official list of MIME types:
# https://www.iana.org/assignments/media-types/media-types.xhtml