Skip to content

Instantly share code, notes, and snippets.

View tyvsmith's full-sized avatar

Ty Smith tyvsmith

View GitHub Profile
@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"

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 / ModelAdapter.java
Last active September 4, 2015 10:08
Composed View Holder with decoupled OnClickListener
package com.example.ui.utils;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
@tyvsmith
tyvsmith / keybase.md
Created December 17, 2014 18:55
keybase.md

Keybase proof

I hereby claim:

  • I am tyvsmith on github.
  • I am tsmith (https://keybase.io/tsmith) on keybase.
  • I have a public key whose fingerprint is 6844 9AB2 4FC5 ECE7 78B7 31F9 AF0C C86E D089 D7EB

To claim this, I am signing this object:

@tyvsmith
tyvsmith / App.java
Last active August 29, 2015 14:04
Android ListAdapter using custom ViewGroup over ViewHolder pattern
package com.example.app;
public class App {
public String id;
public String name;
public String icon_url;
@Override
public String toString() {
return name;
@tyvsmith
tyvsmith / EvernoteIntentActions
Last active January 9, 2017 11:48
Some helpful intents for interacting with the Evernote Android app.
public static final String SEARCH_NOTES = "com.evernote.action.SEARCH_NOTES";
public static final String VIEW_NOTE_LIST = "com.evernote.action.VIEW_NOTELIST";
public static final String NOTE_PICKER = "com.evernote.action.NOTE_PICKER";
public static final String VIEW_NOTE = "com.evernote.action.VIEW_NOTE";
public static final String NEW_NOTE = "com.evernote.action.CREATE_NEW_NOTE";
public static final String EDIT_NOTE = "com.evernote.action.EDIT_NOTE";
public static final String UPDATE_NOTE = "com.evernote.action.UPDATE_NOTE";
public static final String DELETE_NOTE = "com.evernote.action.DELETE_NOTE";
@tyvsmith
tyvsmith / CrashReporting
Created August 13, 2013 01:10
Report Custom events to Crashlytics without actually killing the process.
public class CrashReporting {
public static class GenericReportingException extends Exception {
public GenericReportingException(){}
public GenericReportingException(String str){
super(str);
}
}
@tyvsmith
tyvsmith / App.java
Last active October 26, 2018 19:15
If you have multiple Android apps that need to report to the same Crashlytics app endpoint. This allows overriding the package name that Crashlytics discovers and reports.
public class MyApp extends Application {
private final String PACKAGE="me.tysmith.app";
@Override
public void onCreate() {
super.onCreate();
Crashlytics.start(new CrashContextWrapper(this, PACKAGE));
}
}