Skip to content

Instantly share code, notes, and snippets.

View knbknb's full-sized avatar
💭
🙅‍♀️💡💤😴🛌🤪🧔

Knut Behrends knbknb

💭
🙅‍♀️💡💤😴🛌🤪🧔
View GitHub Profile
@knbknb
knbknb / vscode-llm-beastmode-gpt41.chatmode.md
Last active August 3, 2025 16:29
chatmode: Beast Mode 3.1 for Copilot Agents
description tools
Beast Mode with web fetching
codebase
usages
vscodeAPI
problems
changes
testFailure
terminalSelection
terminalLastCommand
openSimpleBrowser
fetch
findTestFiles
searchResults
githubRepo
extensions
editFiles
runNotebooks
search
new
runCommands
runTasks
filesystem
context7

Beast Mode 3.1

@knbknb
knbknb / .editorconfig
Last active August 3, 2025 16:29
editorconfig: Project Boilerplate for Common Languages
# http://editorconfig.org
# directory where .editorconfig resides is top level of project
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
@knbknb
knbknb / run-in-browser-console.js
Last active August 3, 2025 16:29
TYPO3: JS Snippets for Modal Table Filtering
// this works in the browser console,
// when the modal dialog is visible
// after clicking on the "i" button for a frontendusergroup
function filterTableRows(tableDiv) {
if (!tableDiv) { console.error(`selector 'div.table-fit' not found!`); return; }
const table = tableDiv.querySelector('table');
if (!table) { console.error(`table contains no data`); return; }
const headers = table.querySelectorAll('thead th');
@knbknb
knbknb / yt-dlp-subtitles-only.sh
Last active August 3, 2025 16:29
bash: Download and Format YouTube Subtitles with yt-dlp
#!/usr/bin/env bash
url=$1
# if no url is provided, exit
if [ -z "$url" ]; then
echo "No URL provided"
exit 1
fi
subtitle_url=$(yt-dlp -q --skip-download --convert-subs srt --write-sub --sub-langs "en" --write-auto-sub --print "requested_subtitles.en.url" "$url")
content=$(curl -s "$subtitle_url" | sed '/^$/d' | grep -v '^[0-9]*$' | grep -v '\-->' | sed 's/<[^>]*>//g' | tr '\n' ' ')
@knbknb
knbknb / cisco-startup-gui-bugfix.sh
Last active August 3, 2025 16:29
bash: Cisco Secure Client GUI Startup Bugfix
#!/bin/bash
export WEBKIT_DISABLE_DMABUF_RENDERER=1 && /opt/cisco/anyconnect/bin/vpnui
#
# Fix for Cisco AnyConnect VPN client GUI startup bug on Linux
# AnyConnect 4.10.05111 displays blank page instead of SSO login
# https://community.cisco.com/t5/vpn/anyconnect-4-10-05111-displays-blank-page-instead-of-sso-login/td-p/4648440
@knbknb
knbknb / cut-csvkit-cheatsheet.sh
Created December 17, 2024 14:08
sh: Data Processing Cheatsheet (curl, csvkit, in2csv)
curl -LOC myurl
# - L: folllow redirects
# - O: use Original Remote Filename
# - C: Continue interrupted downloads
wget -bc myurl
# -b : do it in background
# -c : continue broken downloads
@knbknb
knbknb / speech2text-whisper.sh
Created December 15, 2024 20:29
sh: Whisper Speech-to-Text Shell Script
#!/bin/bash
# Speech to text with Whisper model using OpenAI API
# Assumes that the OpenAI API key is set as an environment variable
# Usage: ./speech2text-whisper.sh input_audio_file
# Check if an input argument is provided and validate the file extension
if [ -z "$1" ]; then
echo "Error: No input file provided. Please specify an audio file (MP3, WAV, etc.) as the first argument."
exit 1
fi
@knbknb
knbknb / recraft-text2image.sh
Last active August 3, 2025 16:32
sh: Recraft Text-to-Image API Example
#!/usr/bin/env bash
RECRAFT_API_KEY=YOU_MUST_REPLACE_THIS_WITH_YOUR_API_KEY
now=$(date +"%Y%m%d_%H%M%S")
logo_description_outfile=logo_description_$now.svg
temp_response_file=response_$now.json
@knbknb
knbknb / recraft-vectorize.api.sh
Created December 15, 2024 18:23
sh: Recraft Vectorize API Example
#!/usr/bin/env bash
RECRAFT_API_KEY=...
now=$(date +"%Y%m%d_%H%M%S")
# Check if an input argument is provided and validate the file extension
if [ -z "$1" ]; then
echo "Error: No input file provided. Please specify a Webp, PNG or JPG file as the first argument."
exit 1
fi
@knbknb
knbknb / ansible-adhoc-commands-cheatsheet.sh
Last active August 3, 2025 16:32
ansible: Ad-hoc Command Cheatsheet
# Visualize the gathering phase of Ansible, on a target host.
# Returns a JSON structure with all the facts about the target host
# More than ping, less than a full playbook
ansible -m setup 192.168.178.29
# Filter the output of the setup module to only show facts related to the distribution
ansible -m setup 192.168.178.29 -a "filter=ansible_distribution*"
# a LOT of facts are gathered and put into variables
# this is how to get them back as pure json
ANSIBLE_STDOUT_CALLBACK=json ansible -m setup localhost