Skip to content

Instantly share code, notes, and snippets.

View innateessence's full-sized avatar

Brenden innateessence

View GitHub Profile
@innateessence
innateessence / ArchDesktop.pacmanity
Last active November 5, 2024 21:57
ArchDesktop: List of installed packages
aalib
abseil-cpp
accountsservice
acl
adobe-source-code-pro-fonts
adwaita-cursors
adwaita-icon-theme
adwaita-icon-theme-legacy
alacritty
alsa-card-profiles
@innateessence
innateessence / fix-remote.sh
Created October 29, 2024 03:30
fix-ir-remote-on-apple-tv.sh
#!/bin/bash
# Resource: https://pimylifeup.com/raspberrypi-hdmi-cec/
# This will list all commands
# echo 'h' | cec-client -s -d 1
echo 'triggering a HDMI-CEC scan to force the TV to properly identify all devices...'
echo 'scan' | cec-client -s -d 1
@innateessence
innateessence / del-fb-msgs.js
Last active October 3, 2024 22:05
Unsend and remove all Facebook Messenger messages
const SHORT_DELAY = 100;
const MEDIUM_DELAY = 250;
const LONG_DELAY = 500;
let messageChatIdx = 0
let isRunning = false
let exceptionsInARow = 0
const exceptionsInARowUntilNextChat = 40
@innateessence
innateessence / compress-raw-photos.sh
Last active August 28, 2024 02:05
Convert and Compress Leica Q2 raw images using ImageMagick
#!/usr/bin/env bash
# This script converts DNG images to PNG images
# This should work with any raw image format that ImageMagick supports.
# And then compresses the PNG.
#
# This script is the result of trying to figure out how to convert
# Leica Q2 DNG files to PNG and compress them to save disk space
# In a way that can be ran as a cron job on a simple raspberry-pi NAS RAID
# As a self-managed backup solution.
@innateessence
innateessence / clean-docker-logs.sh
Last active September 1, 2024 23:41
Wipe your Docker Logs
#!/usr/bin/env bash
# I am aware this can be handled via configuration instead.
# But sometimes, a script that solves the problem is better.
# This CAN cause issues if this runs while docker is appending logs to the file.
# It is possibly that if you use this, `docker logs` will throw an error due to a partial log entry being present and unparsable by docker.
# Don't use this if you don't understand what I just said in the line above.
LOG_PATH="$HOME/Library/Containers/com.docker.docker/Data/log/host"
@innateessence
innateessence / ask-ollama.py
Last active August 15, 2024 04:06
ask-ollama.py - minimal exampe of consuming a local LLM on your machine locally
#!/usr/bin/env python3
import time
import json
import requests
import psutil
from subprocess import Popen, PIPE
"""
@innateessence
innateessence / cities.json
Created July 12, 2024 23:13
US Cities in JSON format
This file has been truncated, but you can view the full file.
[
{
"City": "Holtsville",
"State short": "NY",
"State full": "New York",
"County": "SUFFOLK"
},
{
"City": "Adjuntas",
"State short": "PR",
@innateessence
innateessence / htoprc
Created July 10, 2024 23:59
Htop RC [Config]
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
htop_version=3.3.0
config_reader_min_version=3
fields=0 124 48 45 6 5 17 18 38 39 2 46 47 49 1
hide_kernel_threads=0
hide_userland_threads=0
hide_running_in_container=0
shadow_other_users=0
show_thread_names=0
@innateessence
innateessence / rand.py
Created July 7, 2024 01:02
Custom RNG
'''
Might want to port this to C/C++ for a microcontroller in the future
I'm sure the arduino IDE has a `rand()` package for a better, more optimized version though, but was still fun
'''
# Custom random number generator parameters
custom_seed = 123456789 # The seed value
custom_a = 1664525 # Multiplier
custom_c = 1013904223 # Increment
custom_m = 4294967296 # Modulus, 2^32
@innateessence
innateessence / hashmap.py
Last active August 22, 2024 23:42
hashmap.py - custom python hashmap
#!/usr/bin/env python3
from typing import Any
# Consider using the same binary lookup table approach a `switch` statement in C/C++ uses?
# NOTE: I know this is inefficient, I wrote this for fun / out of curiosity and did not allow myself to use any real hashing
# simply trying to leverage `hash()` felt like cheating, looking up hashing algo's also felt like cheating.
# Please don't assume I know nothing about hashing algo's from reading this