Skip to content

Instantly share code, notes, and snippets.

View bdmorin's full-sized avatar
👁️‍🗨️
the horrors persist, but so do l

Brian bdmorin

👁️‍🗨️
the horrors persist, but so do l
View GitHub Profile
@bdmorin
bdmorin / fml.py
Created August 5, 2024 14:05
fml - first middle last
#!/usr/bin/env python3
# cat life.txt | fml.py -n 10
import sys
import argparse
def process_stream(n):
lines = []
for line in sys.stdin:
@bdmorin
bdmorin / tgx.py
Last active July 28, 2024 03:57
torrentgalaxy rss manager
import re
import sqlite3
import click
import json
import os
def remove_periods(text):
return re.sub(r'\.+', ' ', text).strip()
def lowercase_sanitize(value):
---
- name: Schedule VM shutdown and server reboot
hosts: kvm_servers
become: yes
vars:
shutdown_time: "23:00"
tasks:
- name: Create a cron job to shutdown VMs and reboot server
cron:
ansible-playbook -i your_inventory_file schedule_shutdown_and_reboot.yml
```yaml
---
- name: Schedule VM shutdown and server reboot
hosts: kvm_servers
become: yes
vars:
shutdown_time: "23:00"
@bdmorin
bdmorin / convert_fish_to_zsh_history.py
Created July 2, 2024 15:55
fish history to zsh history
#!/usr/bin/env python3
# default verbose
import os
import time
from pathlib import Path
def convert_fish_to_zsh_history():
fish_history_path = Path.home() / '.local/share/fish/fish_history'
zsh_history_path = Path.home() / '.zsh_history'
@bdmorin
bdmorin / dns_test.py
Created June 26, 2024 13:48
Very simple unit test for DNS
import unittest
import yaml
import dns.resolver
# Load the YAML file
with open('dns_tests.yaml', 'r') as file:
test_cases = yaml.safe_load(file)
class TestDNSLookup(unittest.TestCase):
def dns_lookup(self, host, record_type):
@bdmorin
bdmorin / mocha_kagi.css
Created June 25, 2024 18:31
catppuccin mocha for kagi
/* Catppuccin Mocha Theme for Kagi */
.search-input-container {
position: relative;
width: 100%;
color: #d9e0ee;
background-color: #1e1e2e;
border-radius: 2rem !important;
border: 1px solid #f5c2e7 !important;
transition-duration: 0.2s;
@bdmorin
bdmorin / demo.yml
Created June 15, 2024 17:49
example GH wf
name: CI Pipeline
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
{
description = "Colmena nixflake demo";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
colmena.url = "github:zhaofengli/colmena";
};
outputs = { self, nixpkgs, flake-utils, colmena }:
@bdmorin
bdmorin / convert_tatulli_troxide.md
Created June 3, 2024 17:51
troxide import tatulli tv shows.

#troxide user? You can import your tatulli information like this.

$ sqlite3 /opt/stacks/tautulli/tautulli.db 'SELECT
  json_extract(tvmaze_json, \'$.id\') AS show_id,
  json_extract(tvmaze_json, \'$.name\') AS show_name
  FROM tvmaze_lookup;' > tvm.export

$ echo '( version:1, series: [' > tatulli.import
$ awk -F\| '{print "(id:$1,name:\"$2\", is_tracked: true; seasons: {}),"}' >> tatulli.import