Skip to content

Instantly share code, notes, and snippets.

View TylerCode's full-sized avatar
:octocat:
Probably making something, I have too many repos...

Tyler C TylerCode

:octocat:
Probably making something, I have too many repos...
View GitHub Profile
@TylerCode
TylerCode / text_to_csv_money.py
Created April 15, 2025 17:04
Takes a text file, removes lines that don't start with $, and makes a new CSV of only the $ entries.
def process_bonk_file(input_file="bonk.txt", output_file="bonk_fixed.csv"):
try:
with open(input_file, 'r') as f:
lines = f.readlines()
except FileNotFoundError:
print(f"Error: Could not find {input_file}")
return
except Exception as e:
print(f"Error reading file: {e}")
return
@TylerCode
TylerCode / install_xcpguest.sh
Last active November 25, 2024 21:50
installs the guest tools on Ubuntu for XCP-NG
#!/bin/bash
# Check if script is run as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Common CD/DVD device locations
DEVICE_LOCATIONS=(
@TylerCode
TylerCode / plant_freeze.py
Created October 8, 2024 15:57
Plant Freeze Text! - Get a text message when your plants hit freezing temperatures.
import requests
import os
from twilio.rest import Client
from datetime import datetime
# OpenWeatherMap API configuration
OWM_API_KEY = "YOUR_OPENWEATHERMAP_API_KEY"
ZIP_CODE = "YOUR US ZIP CODE"
COUNTRY_CODE = "US"

Test text

@TylerCode
TylerCode / install_unity_fedora.sh
Created May 25, 2024 16:34
Install script for installing Unity Hub on Fedora Linux
#Use this to install unity on Fedora
sudo dnf install openssl openssl-libs GConf2
sudo sh -c 'echo -e "[unityhub]\nname=Unity Hub\nbaseurl=https://hub.unity3d.com/linux/repos/rpm/stable\nenabled=1\ngpgcheck=1\ngpgkey=https://hub.unity3d.com/linux/repos/rpm/stable/repodata/repomd.xml.key\nrepo_gpgcheck=1" > /etc/yum.repos.d/unityhub.repo'
# For beta hub, use this
#sudo sh -c 'echo -e "[unityhub-beta]\nname=Unity Hub Beta\nbaseurl=https://hub.unity3d.com/linux/repos/rpm/unstable\nenabled=1\ngpgcheck=1\ngpgkey=https://hub.unity3d.com/linux/repos/rpm/unstable/repodata/repomd.xml.key\nrepo_gpgcheck=1" > /etc/yum.repos.d/unityhub_beta.repo'
sudo dnf check-update
sudo dnf install unityhub
@TylerCode
TylerCode / wayland-egpu.md
Last active March 26, 2024 21:04
Getting an eGPU working on Wayland

Another day, another eGPU documentation

First another little disclaimer; this guide partially works for me but it might not work for you. eGPU's seem to be an unwanted stepchild in terms of support. I wish anyone luck!

Also for some expectation setting, hotswap isn't a thing. I don't think that Linux will ever have hotswap eGPU support so if you want to plug or unplug the GPU, power down first. Being fair, this doesn't really work great on Windows either.

I also still have issues with the Ethernet port on the core X, and still have issues with all but 1 USB port (top left). Happy for advice on any fixes.

My Setup

@TylerCode
TylerCode / login.cshtml.cs
Created January 9, 2024 20:46
Login page for Auth0
using Microsoft.AspNetCore.Authentication;
using Auth0.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace MyApplication.Pages
{
public class LoginModel : PageModel
{
public async Task OnGet(string redirectUri, string? invitation = null, string? organization = null)
{
@TylerCode
TylerCode / speedtest.py
Created December 22, 2023 17:39
Speedtesting on the reg
import csv
import subprocess
from datetime import datetime
import time
def run_speedtest():
# Run speedtest-cli and capture output
process = subprocess.Popen(['speedtest-cli', '--csv'], stdout=subprocess.PIPE)
output, error = process.communicate()
@TylerCode
TylerCode / zorin-egpu.md
Last active January 10, 2024 00:14
Getting an eGPU Working on Zorin OS 17

eGPU on Zorin OS 17

First a little disclaimer; this guide partially works for me but it might not work for you. eGPU's seem to be one of the most fragile setups imagineable from a software standpoint. I wish anyone luck!

Also for some expectation setting, hotswap isn't a thing. I don't think that Linux will ever have hotswap eGPU support so if you want to plug or unplug the GPU, power down first.

I also still have issues with the Ethernet port on the core X, still have issues with all but 1 USB port (top left), still have issues running the laptop WITHOUT the core x connected. Happy for advice on any fixes.

My Setup

@TylerCode
TylerCode / BaldursSave.py
Last active August 12, 2023 17:21
Run this with BG to save every 10 min
import psutil
import time
from pynput.keyboard import Key, Controller
time.sleep(10)
def check_if_process_running(process_keywords):
try:
# Check every process cause this wasn't working.... idk why
for proc in psutil.process_iter():