Skip to content

Instantly share code, notes, and snippets.

View qubitrenegade's full-sized avatar
☂️
Building castles of abstractions

qubitrenegade

☂️
Building castles of abstractions
View GitHub Profile
<#
.SYNOPSIS
Convert one folder of MP3 chapters per audiobook into one M4B file per folder.
.DESCRIPTION
Put this script next to your audiobook folders. Each audiobook should be its own folder.
Each folder should contain numbered MP3 files and, optionally, cover.jpg, cover.jpeg, or cover.png.
Example:
@qubitrenegade
qubitrenegade / stock-weekend-gaps.py
Created October 27, 2024 18:36
stock-weekend-gaps.py - Analyze stock price gaps between last trading day of week and first trading day of next week
#!/usr/bin/env python3
"""
stock-weekend-gaps.py - Analyze stock price gaps between last trading day of week and first trading day of next week
This script fetches historical stock data and analyzes the price gaps that occur over weekends
and holidays. It captures the opening and closing prices of the last trading day of each week
and the first trading day of the following week, accounting for holidays and irregular trading days.
Installation:
@qubitrenegade
qubitrenegade / gist:06da3bae5d09ccadc4522b1162790c21
Created September 21, 2019 03:19 — forked from TeWu/gist:1234573
TCP client and multithreaded server in 14 lines of Ruby code

TCP client and multithreaded server in 14 lines of Ruby code

Server:

require "socket"
server = TCPServer.open(2626)
loop do
	Thread.fork(server.accept) do |client| 
 client.puts("Hello, I'm Ruby TCP server", "I'm disconnecting, bye :*")
@qubitrenegade
qubitrenegade / .config
Created August 14, 2019 05:18
fedora 30 kernel 5.2.8 config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.2.8 Kernel Configuration
#
#
# Compiler: gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90101
@qubitrenegade
qubitrenegade / prepend.rb
Created August 7, 2019 05:07
Prepend example of "safe" monkeypatching
class Foo
def initialize
puts '[*] In Foo#initialize'
@foo = ['Added in intialize in Foo']
end
def foo
puts '[*] In Foo#foo: '
pp @foo
puts "[*] foo.class: #{@foo.class}"
@qubitrenegade
qubitrenegade / homeserver.yaml
Last active August 1, 2019 06:23
Configuring Matrix and Riot for Private Chat
## Server ##
# When running as a daemon, the file to store the pid in
pid_file: "/var/run/matrix-synapse.pid"
public_baseurl: https://matrix.example.com/
allow_public_rooms_without_auth: true
allow_public_rooms_over_federation: true
#federation_domain_whitelist:
# - lon.example.com
@qubitrenegade
qubitrenegade / vfio-pci-override.sh
Last active July 17, 2019 03:16
VFIO Setup Scripts
#!/bin/sh
set -u
for boot_vga in /sys/bus/pci/devices/*/boot_vga; do
echo "Found vga device: ${boot_vga}"
if [ $(<"${boot_vga}") -eq 0 ]; then
echo "Found Boot VGA Device - false: ${boot_vga}"
dir=$(dirname -- "${boot_vga}")
@qubitrenegade
qubitrenegade / Freenas 11.2 Setup.md
Last active August 23, 2021 01:25 — forked from zenxedo/TrueNAS Setup.md
Ultimate FreeNAS 11.2 Setup

FreeNAS 11.2

WARNING This page contains incomplete and possibly incorrect info. The page is constantly being edited and worked on. Many of these should work but some may be broken. Read the code carefully to understand what you are doing, stuff may be nedd to be changed for your use. Use at your own risk.

Credit for IOCAGE setup goes to https://forums.freenas.org/index.php?resources/fn11-1-iocage-jails-plex-tautulli-sonarr-radarr-lidarr-jackett-ombi-transmission-organizr.58/

*** QBRD note: I have chosen different names for my zvol and so. I HAVE TRIED TO USE THE NAMES DESCRIBBED IN "Setup" SECTION! Please be aware of copy/paste errors where my actual zvol name may be used.

@qubitrenegade
qubitrenegade / my-hab.te
Created August 26, 2018 10:07
Habitat Type Enforcement for SELinux on Fedora 28 - THIS IS UNVERIFIED!!! DON'T USE THIS!
module my-hab 1.0;
require {
type init_t;
type tmp_t;
type default_t;
type http_port_t;
class sock_file { create write };
class process setpgid;
class file { create execute execute_no_trans map open read rename setattr unlink write };
# frozen_string_literal: true
# The MIT License (MIT)
#
# Copyright:: 2017, QubitRenegade
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell