Skip to content

Instantly share code, notes, and snippets.

View in03's full-sized avatar
💭
Working on new projects!✨

Caleb Trevatt in03

💭
Working on new projects!✨
View GitHub Profile
@in03
in03 / install_nvidia_driver_host.sh
Last active October 21, 2024 06:47
Configures an LXC container with Nvidia GPU passthrough.
#!/bin/bash
# Variables
DRIVER_FILE=$(ls NVIDIA-Linux-*.run | head -n 1)
# Ensure the driver file exists
if [ ! -f "$DRIVER_FILE" ]; then
echo "NVIDIA driver file not found in the current directory."
exit 1
fi
@in03
in03 / Cleanup-Tailscale.sh
Created September 24, 2024 03:20
Cleanup a Tailscale installation on MacOS
#!/bin/bash
# If you're having issues with Tailscale after a reinstall, try cleaning up.
# Tailscale recommends the following. I've just scripted it for ease:
# https://tailscale.com/kb/1069/uninstall?q=uninstall&tab=macos+%28standalone%29
# Oh would you look at that, if you've got brew, just use that.
# https://github.com/Homebrew/homebrew-cask/blob/master/Casks/t/tailscale.rb
# NOTE:
@in03
in03 / .traefik-cloudflare-tunnel
Created March 8, 2024 03:09 — forked from mattdy/.traefik-cloudflare-tunnel
Traefik on Docker Swarm accessed via Cloudflare Tunnel
Please see https://mattdyson.org/blog/2024/02/using-traefik-with-cloudflare-tunnels for a detailed write-up of this configuration
@in03
in03 / Jump_To_Folder.ahk
Created January 6, 2024 03:15
Creates a quick nav menu in any Windows browser dialog based on open explorer windows - trigger with Ctrl+G or middle mouse button
; Easy Access to Currently Opened Folders
; Original author: Savage
; Fork by Leeroy
; Invoke a menu of currently opened folders when you click
; the middle mouse button inside Open / Save as dialogs or
; Console (command prompt) windows. Select one of these
; locations and the script will navigate there.
; CONFIG: CHOOSE A DIFFERENT HOTKEY
; You could also use a modified mouse button (such as ^MButton) or

Pip won't install because of packet-inspection CA Cert Re-signing SSL errors? Gosh!

Problem

Packet inspection re-signs all SSL conections with Citipointe's own self-signed CA certificate. Pip doesn't recognise the certificate and fails each download request with a nice SSL error:

connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)

You won't be able to install anything with pip unless you ignore SSL certificates with

@in03
in03 / cross_platform_path_mapping.py
Created April 29, 2022 21:53
Convert network-share mount points between platforms using path-mapping
import platform
import os
def resolve_path_map(rpath, path_map_list, strict=True):
target_os = platform.system().lower()
rpath = os.path.normpath(rpath)
for path_maps in path_map_list:
@in03
in03 / resolve_network_path.py
Last active April 27, 2022 23:53
Resolve cross-platform network paths from local mapped mounts
import logging
import os
import pathlib
import socket
def resolve_network_path(local_path, strict=True):
"""
Resolve cross-platform network paths from local mapped mounts
Args:
- local_path (str): local path to resolve
@in03
in03 / AHK_Resolve_Master.ahk
Last active January 27, 2024 19:17
DaVinci Resolve AutoHotkey scripts - not exhaustive! Examples for others.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn, All
#Warn, Unreachable, Off ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%\ResolveHelper ; Ensures a consistent starting directory.
SetDefaultMouseSpeed 1
#SingleInstance, Force
@in03
in03 / Currently-Opened-Folders.md
Created September 25, 2021 01:02 — forked from akaleeroy/Currently-Opened-Folders.md
Easy Access to Currently Opened Folders

Easy Access to Currently Opened Folders

Windows Enhancement Productivity

Enhance Open... or Save As... dialogs with a quick way to navigate to currently opened folders.

Easy Access to Currently Opened Folders - Demo

This is an AutoHotkey script that gives common file selection dialogs an extra feature: middle-clicking invokes a menu of currently opened folders. Say you want to save or upload something to/from a folder you've got open in Windows Explorer. The dialog box pops up with the last folder (from another project) or My Documents, and now you have to manually navigate to the folder you want, or copy-paste its path from the open Explorer window. I wanted to get to the active locations quicker. Recent Items wasn't exactly helping, so I made this by forking FavoriteFolders.ahk by Savage. Tested

@in03
in03 / multithreaded-socket-server.py
Created March 11, 2021 12:28
socket server using multithreading to catch keyboard interrupts
# Thanks GratefulGuest from SO:
# https://stackoverflow.com/questions/34871191/cant-close-socket-on-keyboardinterrupt
from multiprocessing import Pipe, Process
from socket import socket, AF_INET, SOCK_STREAM
from threading import Thread
import time
def detect_interrupt(conn):
try: