Skip to content

Instantly share code, notes, and snippets.

View BitesizedLion's full-sized avatar
🔌
Nothing

Casper BitesizedLion

🔌
Nothing
View GitHub Profile
@BitesizedLion
BitesizedLion / garmin_split.py
Created April 24, 2025 17:28
sr105's garmin split updated for Python 3 (Splits a GPX file with pauses in the track into multiple files).... original: https://gist.github.com/sr105/e7d651e9c96a67d80e41
#!/usr/bin/env python
# Copyright (C) 2015 Harvey Chapman <[email protected]>
# Public Domain
# Use at your own risk.
"""
Splits a gpx file with breaks in the track into separate files.
Based on: http://stackoverflow.com/q/33803614/47078
@BitesizedLion
BitesizedLion / guide.md
Created February 24, 2025 00:25
firecracker multiple vms, taps + bridge, external access

Create bridge

sudo ip link add name fc-88-br0 type bridge
sudo ip link set fc-88-br0 up
sudo ip addr add 10.10.10.1/24 dev fc-88-br0

Create tap interfaces and add to bridge

sudo ip tuntap add dev fc-88-tap0 mode tap
# Create and configure the tap interface
sudo ip tuntap add dev fc-88-tap0 mode tap
sudo ip addr add 169.254.0.22/30 dev fc-88-tap0
sudo ip link set fc-88-tap0 up
# Set up iptables rules
sudo iptables -A FORWARD -i fc-88-tap0 -o enp1s0 -j ACCEPT
sudo iptables -A FORWARD -i enp1s0 -o fc-88-tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE
@BitesizedLion
BitesizedLion / kommuner.txt
Created January 28, 2025 02:15
Lista på Svenska kommuner
Ale
Alingsås
Alvesta
Aneby
Arboga
Arjeplog
Arvidsjaur
Arvika
Askersund
Avesta
@BitesizedLion
BitesizedLion / guide.md
Last active February 23, 2025 01:43
How to setup a HetrixTools Server Agent on Unraid
  1. Install the "User Scripts" plugin from Community Apps.

  2. Under the Settings tab, open "User Scripts" (under "User Utilities")

  3. Add a new script and name it "Hetrix Server Agent"

  4. Open the terminal and run cd "/boot/config/plugins/user.scripts/scripts/Hetrix Server Agent"

  5. Run nano script and paste in the install code from the HetrixTools dashboard.

@BitesizedLion
BitesizedLion / hls.sh
Created November 17, 2024 19:37 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@BitesizedLion
BitesizedLion / guide.md
Created October 13, 2024 11:34
Forward arRPC from Parsec (Tailscale) to Laptop

ADD

netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=1337 connectaddress=100.109.41.112 connectport=1337

REMOVE

netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=1337

@BitesizedLion
BitesizedLion / solve.js
Created October 8, 2024 11:44
solve db schenker captchas
// Function to solve the puzzle asynchronously
async function solvePuzzle(t) {
// Calculate the target number using parameters from the puzzle
const e = calculateTarget(t[13], t[14]);
// Variable to hold the solution
let o;
// Loop to find a valid solution
for (let attempts = 0; attempts <= Number.MAX_SAFE_INTEGER; attempts++) {
@BitesizedLion
BitesizedLion / extract_garages.py
Created August 17, 2024 19:34
Scrape Tunabyggen's available garages and output to CSV. Includes ID, Display Name, Description, Price and Complete Address.
import requests
import csv
headers = {
'Accept': 'application/json, text/plain, */*',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
'X-Api-Key': 'pJnKrR6B3FzRNFsF33xL8LhSs55KPJrm',
'X-Momentum-Client': 'momentum.se-fastighetminasidor',
'X-Momentum-Client-Id': 'EAP-47356',
'X-Momentum-Client-Version': '5.20.3.15457',
@BitesizedLion
BitesizedLion / conv.py
Last active August 17, 2024 19:39
Bulk ACRCloud fingerprint generation, configured for videos but can replace with audio.
import os
import subprocess
from concurrent.futures import ThreadPoolExecutor
directory_path = './'
acrcloud_path = '/tmp/tmp.KINBD0Xo6M/acrcloud' # path to executable
output_base_path = './'
video_extensions = ['.mkv', '.mp4']