This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' ' ') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lists the names of smurfette in all languages that wikidata knows about . | |
# the result should have two columns, "language_label" and "smurfette_name" | |
SELECT ?language_label ?smurfette_name WHERE { | |
wd:Q305405 rdfs:label ?smurfette_name. | |
FILTER(LANG(?smurfette_name) != ""). | |
BIND(LANG(?smurfette_name) AS ?lang). | |
?language_item wdt:P218 ?lang. | |
NewerOlder