Skip to content

Instantly share code, notes, and snippets.

@TheStaticTurtle
TheStaticTurtle / CMakeLists.txt
Created November 5, 2023 01:32
LuaSocket cmake
CMAKE_MINIMUM_REQUIRED(VERSION 3.25)
PROJECT(LuaSocket VERSION 3.0.0)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
IF(WIN32)
SET(LUASOCKET_LINK_FLAGS "wsock32" "Ws2_32")
ADD_DEFINITIONS(-DLUASOCKET_DEBUG "-DLUASOCKET_API=__declspec(dllexport)")
ENDIF(WIN32)
@TheStaticTurtle
TheStaticTurtle / genererate_statments.py
Created January 16, 2023 13:07
Sonarr - C'est pas sorcier (It's not rocket science) - SQL Querry rename TBA episodes
import requests
from bs4 import BeautifulSoup
import re
data = requests.get("https://thetvdb.com/series/its-not-rocket-science/allseasons/official").content
soup = BeautifulSoup(data, 'html.parser')
print("BEGIN TRANSACTION;")
for h4 in soup.find_all("h4", {"class": "list-group-item-heading"}):
season_episode = h4.find_next("span").text.replace("\n"," ").strip()
@TheStaticTurtle
TheStaticTurtle / fu_cursor_install.bat
Created June 23, 2022 18:43
Change the windows 10 hand cursor
@echo off
set cursor-icon=AAACAAEAICAAAAkAAACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@TheStaticTurtle
TheStaticTurtle / oled_spinner.c
Created June 15, 2022 07:01
Simple spinner with variable speed and size
//Call at least every 10ms
void oled_spinner() {
int x = 64, y = 35, r = 15;
static uint32_t millis = board_millis();
static float angle = 0;
if (board_millis() - millis < 10) return;
millis += 10;
@TheStaticTurtle
TheStaticTurtle / patch.diff
Created April 10, 2022 18:12
Filezilla patch to increase the maximum number of simultaneous connections to a maximum of 500
diff settings/optionspage_transfer.cpp settings/optionspage_transfer.cpp
52,53c52,54
< impl_->transfers_->SetRange(1, 10);
< impl_->transfers_->SetMaxLength(2);
---
> #warning Here
> impl_->transfers_->SetRange(1, 500);
> impl_->transfers_->SetMaxLength(3);
55c56
< inner->Add(new wxStaticText(box, nullID, _("(1-10)")), lay.valign);
@TheStaticTurtle
TheStaticTurtle / gcal.py
Created February 8, 2022 23:44
Google calendar service
import datetime
import config
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/calendar']
@TheStaticTurtle
TheStaticTurtle / decode_onmessage.js
Last active February 8, 2022 01:26
Nodered VBAN header decoder
input_buffer = msg.payload
msg.payload = {
fourcc: input_buffer.slice(0, 4).toString(),
sample_rate: VBAN_SR_LIST[input_buffer[4] & VBAN_SR_MASK],
sub_protocol: VBAN_PROTOOLS[input_buffer[4] & VBAN_PROTOCOL_MASK],
samples: input_buffer[5],
channels: input_buffer[6],
format: VBAN_BIT_FMTS[input_buffer[7] & VBAN_BIT_RESOLUTION_MASK],
@TheStaticTurtle
TheStaticTurtle / patch.diff
Last active January 14, 2022 12:01
FileZilla patch to increase the ridiculous 10 simultaneous connections limit
diff settings/optionspage_transfer.cpp settings/optionspage_transfer.cpp
52,53c52,54
< impl_->transfers_->SetRange(1, 10);
< impl_->transfers_->SetMaxLength(2);
---
> #warning Here
> impl_->transfers_->SetRange(1, 500);
> impl_->transfers_->SetMaxLength(3);
55c56
< inner->Add(new wxStaticText(box, nullID, _("(1-10)")), lay.valign);
@TheStaticTurtle
TheStaticTurtle / minimal_syslog_server_stormshield_fierwall.py
Last active November 16, 2021 16:18
StormShield Firwall Minimal Syslog Server
HOST, PORT = "0.0.0.0", 5514
import logging,coloredlogs,socketserver
coloredlogs.install(level=logging.DEBUG, fmt='%(message)s', datefmt='')
#Remove theses values from the log
filter_proto = ["dns_udp", "dns_tcp", "ssdp", "bootps", "ntp"]
filter_dstname = []#["firefox", "github", "google", "msedge", "imgur", "cdn."]
filter_srcname = []
@TheStaticTurtle
TheStaticTurtle / rsyslog.conf
Created August 26, 2021 17:01
Rrsyslog remote logging conf
# Load Modules
module(load="imudp")
module(load="imuxsock")
# rsyslog Templates
template(name="FilePathHostnameFormat" type="string" string="/var/log/net/%hostname%/syslog.log")
template(name="FilePathIpFormat" type="string" string="/var/log/net/%fromhost-ip%/syslog.log")
template(name="RemoteFormat" type="list") {
property(name="timegenerated" dateformat="day")