Skip to content

Instantly share code, notes, and snippets.

View sam2332's full-sized avatar

Lily Rudloff sam2332

  • Ingham County
  • Lansing, Michigan
View GitHub Profile
@sam2332
sam2332 / decrypt.py
Created April 28, 2025 14:30
Decrypt web.config to cloned directory structure
#!/usr/bin/env python
"""
scan-decrypt-configs.py
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Recursively looks for Web.config files that contain encrypted
sections (identified by `configProtectionProvider=` or <EncryptedData>),
then decrypts each protected section into a mirror tree under ./decrypted/
❱❱ python scan-decrypt-configs.py D:\inetpub\wwwroot --dry-run
❱❱ python scan-decrypt-configs.py D:\inetpub\wwwroot
@sam2332
sam2332 / proj.py
Last active March 12, 2025 15:33
Current Projects manager system.
#!/usr/bin/env bash
# --- COLORS -------------------------------------------------------------------
RESET='\033[0m'
BOLD='\033[1m'
GREEN='\033[1;32m'
BLUE='\033[1;34m'
YELLOW='\033[1;33m'
RED='\033[1;31m'
CYAN='\033[1;36m'
@sam2332
sam2332 / filehawk.py
Created March 12, 2025 15:21
log all file events to a sqllite file
import os
import logging
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
file_handler = logging.FileHandler('filehawk.log')
file_handler.setLevel(logging.INFO)
@sam2332
sam2332 / blender_cad.py
Last active December 13, 2024 18:01
USE Blender python As a Step tool and code it all in python like a real programmer
import bpy
from mathutils import Euler, Vector
import math
import bmesh
def set_origin_to_bottom_center(obj):
"""
Sets the origin of the given object to its bottom center.
Args:
@sam2332
sam2332 / WhisperTrascribe.py
Created October 18, 2024 20:23
Whisper based notes taking software
import sounddevice as sd
import numpy as np
import pynput.keyboard
import time
import whisper
import tempfile
import os
from scipy.io.wavfile import write
# Load Whisper Model
@sam2332
sam2332 / TripCard.js
Last active September 4, 2024 17:18
Home Assistant Trip Card
import "https://unpkg.com/[email protected]/wired-card.js?module";
import "https://unpkg.com/[email protected]/wired-toggle.js?module";
import { LitElement, html, css } from "https://unpkg.com/[email protected]/lit-element.js?module";
class TripsCard extends LitElement {
static get properties() {
return {
person: { type: String },
homeZone: { type: String },
hours: { type: Number },
@sam2332
sam2332 / StateDuration.js
Created September 3, 2024 20:18
HomeAssistant Lovelace js module for showing durations of states, useful for person trackers
class StateDurationCard extends HTMLElement {
set hass(hass) {
this._hass = hass;
if (!this.content) {
const cardTitle = this.config.title || 'State Duration Totals';
this.innerHTML = `
<ha-card>
<div class="card-header">
<div class="name" style="cursor: pointer;">${cardTitle}</div>
@sam2332
sam2332 / SimpleLogCard.js
Last active August 6, 2024 17:16
Simple Daily Log
class SimpleLogCard extends HTMLElement {
set hass(hass) {
this._hass = hass;
if (!this.content) {
const title = this.config.title || 'Sensor Log';
this.innerHTML = `
<ha-card header="${title}">
<div class="card-content"></div>
</ha-card>
`;
@sam2332
sam2332 / system_path_file_checker.py
Last active July 22, 2024 14:18
Check System paths for command overwrites
import os
import pwd
import grp
import hashlib
from collections import defaultdict
# Trusted users
TRUSTED_USERS = ['root']
# Base system directories
@sam2332
sam2332 / weather_related_wallpaper.py
Created July 18, 2024 19:54
home assistant pyscript to select a wall paper and replace the file in www dir