Skip to content

Instantly share code, notes, and snippets.

View tyvsmith's full-sized avatar

Ty Smith tyvsmith

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tyvsmith on github.
  • I am tsmith (https://keybase.io/tsmith) on keybase.
  • I have a public key ASDtWZRebiECxV3QSVPeXXAD4--O4D2P3eZDyX6t03V2lAo

To claim this, I am signing this object:

@tyvsmith
tyvsmith / Setting.rb
Created June 5, 2011 20:42
Dynamic changes to schedule.rb for Whenever gem
class Setting < ActiveRecord::Base
validates_uniqueness_of :var
validates_presence_of :value
after_save :send_cron_later
#Setting.for(:display).set=(value)
def self.for(var)
find_or_create_by_var(var)
@tyvsmith
tyvsmith / actions_ids_custom_ip.conf:
Last active December 24, 2023 23:13
OPNSense update IDS homenet with WAN addresses
#Install into /usr/local/opnsense/service/conf/actions.d/actions_ids_custom_ip.conf then can enable a cron from the web UI
[update-ip]
command:python3 /root/scripts/update_ids_ips.py
parameters:
type:script
message:update IDS homenet IPs from WAN
description:Update IDS homenet IPs from WAN
@tyvsmith
tyvsmith / roast-machine.py
Last active December 28, 2023 14:30
Gemini Pro Vision Roast Machine
import cv2
import tkinter as tk
from PIL import Image, ImageTk
import threading
import google.generativeai as genai
import google.ai.generativelanguage as glm
#Code written by Gemini Pro -- don't blame author for quality
API_KEY="YOUR_KEY_HERE" # add your key here
@tyvsmith
tyvsmith / sync-qbittorrent-gluetun-port-forward.sh
Created July 15, 2023 22:08
TrueCharts - Sync QBittorrent Gluetun Port Forwards
#!/bin/bash
# Run on a cron from the host.
NAMESPACE=ix-qbittorrent
CONTAINER_VPN=qbittorrent-vpn
CONTAINER_BITTORRENT=qbittorrent
LAST_PORT_FILE=.last_gluten_forwarded_port
# Fetch the name of the pod with the label "app.kubernetes.io/instance=qbittorrent"