Skip to content

Instantly share code, notes, and snippets.

View ktwrd's full-sized avatar

kate ktwrd

View GitHub Profile
@ktwrd
ktwrd / Cargo.toml
Created March 4, 2025 02:08
Remove "read-only" attribute on files in Windows (for Rust)
[package]
name = "windows-unmark-readonly-rs"
version = "0.1.0"
edition = "2024"
license = "MIT"
authors = ["Kate Ward <[email protected]>"]
[dependencies]
bitflags = "2.9.0"
widestring = "1.1.0"
@ktwrd
ktwrd / main.rs
Created January 11, 2025 04:04
Get Panic Message
// Used to get the panic message after PR 115974 was merged, which changed the type passed through
// in the "info" parameter in the "std::panic::set_hook" callback/delegate. In the new type that
// is passed through, the "message" field was removed. To get the message back from the panic info,
// use the "payload_message" function.
use std::panic::PanicHookInfo;
fn main() {
std::panic::set_hook(Box::new(move |info| {
println!("Panic Info: {:#?}", info);
#!/usr/bin/python3
# coding: utf-8
'''
------------------------------------------------------------------------------
Copyright 2024 Kate Ward
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@ktwrd
ktwrd / Day2.cs
Created December 2, 2024 06:53
Advent of Code 2024 - Day 2
// Uploaded as a gist instead in my AoC repo because I forgot to push yesterday :(
var content = File.ReadAllLines("input.txt");
int result = 0;
int secondResult = 0;
for (int i = 0; i < content.Length; i++)
{
var line = content[i];
if (string.IsNullOrEmpty(line))

MinIO Docker Compose

Files for using MinIO with docker compose while using folders as volume mountpoints.

Make sure that the environment variable MINIO_ROOT_PASSWORD is changed.

@ktwrd
ktwrd / stuns
Created August 6, 2024 08:52 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@ktwrd
ktwrd / Fix-Broken-VSToolbox.ps1
Created July 29, 2024 05:06
Fix Broken/Blank Toolbox in Visual Studio
#
# DESCRIPTION:
# - Script that fixes an empty toolbox in Visual Studio when you *know* that
# things should be showing up in the toolbox.
#
# NOTE:
# - Make sure that Visual Studio is closed before running this!
$xi = Get-ChildItem -Path $env:LocalAppData\Microsoft\VisualStudio -Directory
$targetFiles = @(
[
{
"id":"8dd95206-2b2f-482e-a729-328c650f9fde",
"version":"1.9.0.0",
"type":"InternalApp"
},
{
"id": "9f729e5e-07c5-45bb-98f4-f5a0612846d3",
"display_name": "Open Fortress",
"type": "Kachemak",
@ktwrd
ktwrd / self-signed.conf
Last active March 21, 2024 03:55
Xenia Dashboard NGINX Config
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
@ktwrd
ktwrd / adastral_install.desktop
Created December 30, 2023 04:46
Adastral Installer
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Install Adastral
Exec=sh -c 'curl -L -O --output-dir /tmp/ https://gk.kate.pet/adastral-install.sh 2> /dev/null && bash /tmp/adastral-install.sh'
Icon=steamdeck-gaming-return
Terminal=true
Type=Application
StartupNotify=false