Skip to content

Instantly share code, notes, and snippets.

View bulletinmybeard's full-sized avatar
🤘

Robin Schulz bulletinmybeard

🤘
View GitHub Profile
@bulletinmybeard
bulletinmybeard / better-youtube-notifications-organizer.md
Last active April 17, 2025 18:15
Better YouTube Notifications Organizer

A userscript that improves YouTube's notification system by:

  • Eliminating the annoying Important category by moving all notifications from it into More notifications
  • Sorting all notifications by recency (newest first)
  • Reducing the need to check multiple notification categories
// ==UserScript==
// @name         Better YouTube Notifications Organizer
// @namespace    https://rschu.me/
@bulletinmybeard
bulletinmybeard / macos-mic-manager.md
Last active October 26, 2024 17:07
Automatic Call Detection & Volume Control with Python on macOS

Automatic Call Detection & Volume Control with Python on macOS

A Python script that automatically maintains consistent built-in microphone input volume during calls/meetings on macOS. It detects active audio sessions and adjusts the microphone level accordingly, ensuring the mic volume stays at an optimal level during calls.

Features

  • Automatic call/meeting detection through audio sampling
@bulletinmybeard
bulletinmybeard / ping_failure_monitor_command.md
Created October 3, 2024 14:23
Ping Failure Monitor Command

Ping Failure Monitor Command

This command continuously pings google.com and logs any connection failures. It's useful for monitoring network connectivity and identifying intermittent issues.

while true; do
  if ! ping -c 1 -W 5 google.com &> /dev/null; then
    echo "$(date): Connection to google.com failed"
 fi
@bulletinmybeard
bulletinmybeard / nginx_lua_logging.md
Last active April 11, 2024 01:06
Lua logging module for NGINX

This Lua logging module facilitates colorized log messages to visually distinguish between different log levels such as DEBUG, INFO, WARN, ERR, and CRIT. It integrates with NGINX through the ngx.log method to log directly to NGINX's error log and a custom lua log file at appropriate levels, in addition to writing to specified log files (default: /var/log/lua/default.log). It supports conditional logging based on a maximum log level setting and can serialize table messages to JSON format. It is suitable for both development and production environments, with recommendations to adjust log levels appropriately.

Prerequisites

lua-cjson (>= 2.1.0.10-1) -> https://luarocks.org/modules/openresty/lua-cjson

Lua Module (lua_logging.lua)

local cjson = require "cjson.safe"
@bulletinmybeard
bulletinmybeard / auto-test-and-reload-nginx-configuration.md
Last active April 9, 2024 18:49
Detect NGINX configuration changes, test them, and reload NGINX automatically

This bash script monitors directories and files for changes, runs nginx -t to test the configuration, and reloads NGINX by executing nginx -s reload. All actions are being logged in /var/log/monitor.log and /var/log/monitor-errors.log.

Prerequisites

inotify-tools -> https://github.com/inotify-tools/inotify-tools

The Script

#!/bin/bash
@bulletinmybeard
bulletinmybeard / youtube-likes-dislikes-export.md
Created March 18, 2024 08:29
Export your YouTube liked and disliked videos (.csv)

Create a bash script with the code below as export-yt-liked-and-disliked-videos.sh, give it execution rights with chmod +x export-yt-liked-and-disliked-videos.sh, and run it with your Google access token like so:

./export-yt-liked-and-disliked-videos.sh ya29.a0Ad52N39hmTcEjI1QoL...

The Bash Script

#!/bin/bash
@bulletinmybeard
bulletinmybeard / selfservice.officient.io-my-team-filter-button.md
Last active March 18, 2024 04:56
Extend the team calendar on "selfservice.officient.io" with a button to filter by YOUR TEAM

This browser userscript will programmatically add a button to the team calendar at "selfservice.officient.io", allowing you to filter the list of employees to only your team under .../daysOff/coworkers => week-calendar. Simply add the names of your team members to TEAM_CONTACTS and you good.

Before

image

After

image
@bulletinmybeard
bulletinmybeard / chill-institute-update-button-auto-clicker.md
Created March 9, 2024 22:50
Chill Institute - Update Button Auto Clicker (Browser Userscript)
// ==UserScript==
// @name         Chill Institute - Update Button Auto Clicker
// @namespace    https://rschu.me/
// @homepage     https://rschu.me/
// @version      1.0.0
// @encoding     utf-8
// @description  Chill Institute - Update Button Auto Clicker
// @author       Robin Schulz
// @match        *://chill.institute/*
@bulletinmybeard
bulletinmybeard / poetry-tooling.md
Last active March 12, 2024 19:57
Zsh function to extend the `poetry` command

Extend the poetry command...

function poetry() {
    function ensure_virtual_environment() {
        local venv_path=".venv"

        if [[ ! -d $venv_path ]]; then
            echo -e "Virtual environment not found."
            python3 -m venv $venv_path            
@bulletinmybeard
bulletinmybeard / zsh-shell-env-tooling.md
Last active March 6, 2024 09:30
Zsh Shell Functions to `export` and `unset` all variables from environment files in the current shell session

Zsh Shell Functions to export and unset all variables from env files located in the active working directory from which the commands are being executed.

Usage

Copy the two functions into your ~/.zshrc, ~/.bashrc, etc. and run source ~/.zshrc etc. to refresh your shell configuration, use source ~/.zshrc, etc.

You can now call set-env to export all variables from the given filename (e.g., set-env .env) and unset-env (e.g., unset-env .env) to unset the environment variables.

set-env() {
    if [[ -f $1 ]]; then