Skip to content

Instantly share code, notes, and snippets.

View HandcartCactus's full-sized avatar

Elias HandcartCactus

  • Acclaim Technical Services
View GitHub Profile
@HandcartCactus
HandcartCactus / canvas_daemon.py
Created June 9, 2024 06:21
An almost-pure python script to download all files off of Canvas
from typing import Any, Dict, Literal, Optional
import urllib.parse
import urllib.request
import requests
import urllib
import re
import os
import platform
import subprocess
import sys
@HandcartCactus
HandcartCactus / README.md
Last active May 24, 2024 01:47
SYS6001 Case 33 Bridge Knapsack Solver

Knapsack Solver Script for SYS6001 Case 33 Bridge Data

Create virtual environment with dependencies

Works on linux, macOS, and possibly windows if you have Python set up "right". (INSTALL GUIDE) Open up Terminal if you have linux/MacOS, or CMD if you have Windows.

python3 -m venv bridges
source bridges/bin/activate
pip install pandas ortools openpyxl xlrd
@HandcartCactus
HandcartCactus / eml_html_parser.py
Last active May 5, 2024 21:36
Portable Pure Python .eml/HTML parser
"""
Portable Pure Python .eml/HTML parser (no dependencies, just download (modify) and run)
Current extraction paths: extracts data from Lyft ride reciept emails
```shell
python3 -m eml_html_parser <DIRECTORY WITH EML FILES>
```
MIT License
@HandcartCactus
HandcartCactus / amazon_linux_install_goaccess.sh
Created March 15, 2024 23:57 — forked from tankhuu/amazon_linux_install_goaccess.sh
Install GoAccess - real-time web log analyzer in Amazon Linux
sudo yum install ncurses-devel geoip-devel libmaxminddb-devel tokyocabinet-devel openssl-devel
wget https://tar.goaccess.io/goaccess-1.3.tar.gz
tar -xzvf goaccess-1.3.tar.gz
cd goaccess-1.3/
./configure --enable-utf8 --enable-geoip=legacy
make
sudo make install
# Run
# goaccess /var/log/nginx/access.log -c
@HandcartCactus
HandcartCactus / live_table_report.py
Created March 11, 2024 03:09
A streamlit app which displays a table that updates automatically (on a fixed schedule) or manually.
import streamlit as st
import pandas as pd
from time import sleep
def update_data():
"""you can change this to modify st.session_state.data however you like"""
d = st.session_state.data
newrow = {
'abc': d.iloc[-1]['abc']+1,
'def': (d.iloc[-1]['def'] + d.iloc[-2]['def']) % 9,
@HandcartCactus
HandcartCactus / README.md
Created July 1, 2023 06:05
Convolutional Fibonacci Numbers

$$f(0)=0;; f(1)=1;; f(n) = f(n-1) + f(n-2)$$

$$f^{(m)}(n) = \sum_{i=0}^{n} f(i) * f^{(m-1)}(n-i)$$

@HandcartCactus
HandcartCactus / LinuxKillSwitch.ino
Last active May 7, 2023 09:55
Linux Instant Kill Switch for Adafruit NeoPixel Trinkey
/*
Linux Instant Kill Switch for Adafruit NeoPixel Trinkey
https://learn.adafruit.com/adafruit-neo-trinkey/
When plugged in, will glow red until touchpads are touched.
Once touchpads are touched, a quick spinner animation appears on the trinkey.
Immediately afterwards it enters the following keyboard inputs:
* ALT+PRINTSCRN+R to set your keybaord into RAW mode
* ALT+PRINTSCRN+B to instantly reboot your linux machine :)
@HandcartCactus
HandcartCactus / custom_edit_dist.py
Last active January 21, 2023 18:29
Computes Edit Distance on Sequences, Allows For Custom Definitions Of "Equality" (Used For Experimental Process Mining)
from typing import Callable, Union, Sequence, Protocol, List, Tuple, Any
from functools import partial
from collections import namedtuple
from dataclasses import dataclass
import numpy as np
class EqualityFunction(Protocol):
"""Defines call for a custom equality function"""
@HandcartCactus
HandcartCactus / Issue.md
Created January 4, 2023 02:35
Start Menu X Broken

image As you can see from this image, on windows 10, selecting the videos tab shows the control panel items, and in fact every button on this menu appears to show what should be the submenu for the next button up. The first item, the "Desktop" button shows a blank menu that says "(empty)". I think there's some kind of 0-1 indexing issue here.

@HandcartCactus
HandcartCactus / tabcmd-commands
Created November 11, 2022 18:47
Starhunter -- identify tableau workbooks using a table.
tabcmd login -s <tableausiteurl> -u <username> -p <password>
tabcmd get "workbooks.xml"