Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dadatuputi
dadatuputi / nvidia-driver-update.sh
Last active March 4, 2024 15:09
Proxmox script to update nvidia driver on system and in containers
#!/bin/bash
function usage() {
echo "Usage: $0 -u DRIVERURL -c CTID0,CTID1,..." 1>&2; exit 0;
}
while getopts ":hu:c:" opt; do
case "$opt" in
u) driverurl="$OPTARG";;
c) containers="$OPTARG";;
@dadatuputi
dadatuputi / embupdate.py
Last active February 21, 2024 11:29
Script to automatically upgrade Emby on Debian or Ubuntu
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
import json
import subprocess
import sys
import certifi
def log_error(e):
@dadatuputi
dadatuputi / zfs_smart.sh
Last active February 12, 2024 16:13
Run SMART tests on a ZFS pool
#!/bin/bash
usage() { echo "Usage: $0 -p <POOL> (-s|-l)" 1>&2; exit 1; }
while getopts ":p:sl" o; do
case "${o}" in
p)
p=${OPTARG}
;;
s)
@dadatuputi
dadatuputi / wise_to_ynab.py
Last active August 2, 2023 10:54
Wise CSV to YNAB CSV
import argparse
import pandas as pd
from enum import Enum
class Direction(Enum):
OUT = -1
IN = 1
# Get input and output file as arguments
parser = argparse.ArgumentParser(description="Convert Wise CSV to YNAB CSV")
@dadatuputi
dadatuputi / ancestornames.py
Created June 27, 2023 09:13
Convert a GED file to a list of first and last names - used in looking through a family tree for baby names
from gedcom.element.individual import IndividualElement
from gedcom.parser import Parser
import re, string
def valid_name(name):
if not name:
return False
name = name.strip()
if not name:
return False
@dadatuputi
dadatuputi / reception_hack_demo.py
Created January 27, 2023 16:27
Hack Demo for Reception-age
#!/usr/bin/env python3
import requests
import argparse
import inquirer
import sys, select, os
import time
from colorama import Fore, Style
kickoff = [
@dadatuputi
dadatuputi / amcrest_timelapse.py
Created July 22, 2022 19:32
Convert Amcrest images to Timelapse Video
import os
import shutil
# for root, dirs, files in os.walk('G:\\', topdown=False):
# if 'dav' in root:
# continue
# for name in files:
# if '.jpg' in name:
# _full = os.path.join(root, name)
@dadatuputi
dadatuputi / get-windscribe-port.py
Last active June 7, 2022 16:02
Uses Selenium to get (or refresh) your Windscribe ephemeral port, absent a proper API to do it. It does not require a gui, or even x to be installed.
#!/usr/bin/python3
# Step 1: install firefox: $ sudo apt install firefox
# Step 2: install selenium: $ pip3 install selenium
# Step 3: install geckodriver: https://github.com/mozilla/geckodriver/releases
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
@dadatuputi
dadatuputi / edgeos_access.sh
Created May 16, 2020 22:36
EdgeOS script to enable or disable access to webui or ssh / useful with task-schedule
#!/bin/vbash
# From https://wiki.vyos.net/wiki/Configuration_scripting
# Check for correct group
if [ "$(id -g -n)" != 'vyattacfg' ] ; then
echo "switching to vyattacfg group"
exec sg vyattacfg -c "/bin/vbash $(readlink -f $0) $@"
exit 0
fi
@dadatuputi
dadatuputi / pct-update.sh
Last active January 6, 2022 00:24
Update all Proxmox containers
#!/bin/bash
# update all containers
# modified from https://seantemple.com/proxmox/bash/admin/2017/10/01/update-all-containers.html
function update_container() {
container=$1
tmux new-window -t $2:$3 -n "$container" -d
tmux send-keys -t $2:$3 "pct exec $container -- bash -c 'apt update && apt upgrade -y && apt autoremove -y && apt clean' ; tmux wait-for -S $container" Enter
tmux wait-for $container