Skip to content

Instantly share code, notes, and snippets.

View masterflitzer's full-sized avatar

masterflitzer

  • 00:26 (UTC +01:00)
View GitHub Profile
#!/usr/bin/env bash
domain="${1}"
hsts_preload_url="https://github.com/chromium/chromium/raw/main/net/http/transport_security_state_static.json"
curl -Ls "${hsts_preload_url}" | grep -Piv "^$|^\s*//" | jq -e ".entries[] | select(.name == \"${1}\")"
exit_code="${?}"
printf "\n"
test "${exit_code}" -eq 0 && printf "true" || printf "false"
@masterflitzer
masterflitzer / convert2m4a.ps1
Last active April 14, 2024 18:33
Simple script to convert any audio/video to M4A using drag'n'drop on shortcut after first run
#Requires -Version 5.1
Set-StrictMode -Version Latest
if ($args.Length -eq 0) {
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut($PSCommandPath.Replace(".ps1", "") + " (Drag'n'Drop).lnk")
$pwsh = "pwsh"
if (!$(Get-Command pwsh -ErrorAction SilentlyContinue)) {
Write-Output "PowerShell (pwsh) not found, falling back to Windows PowerShell (powershell)"
$pwsh = "powershell"
@masterflitzer
masterflitzer / proxy.ps1
Created January 3, 2024 17:29
Simple script to toggle HTTP proxy on Windows
#Requires -PSEdition Core
[CmdletBinding()]
param (
[Parameter(ParameterSetName = "enable")]
[switch]
$On,
[Parameter(ParameterSetName = "disable")]
[switch]
$Off,
@masterflitzer
masterflitzer / prime-video-library.js
Created January 2, 2024 18:07
Convert your Prime Video Library to JSON!
// https://amazon.de/gp/video/mystuff/library/all
// adjust based on connection speed
let counter = 3;
if (document.readyState === "complete") await mainPrimeVideoLibrary(counter);
else alert("Please run this script after the webpage finished loading!");
async function mainPrimeVideoLibrary(counter) {
const sleep = async (ms) =>
@masterflitzer
masterflitzer / compile-kotlin-native-freebsd.sh
Created December 14, 2023 19:09
Compile Kotlin/Native on FreeBSD
#!/usr/bin/env bash
DIR_KOTLIN="${HOME}/kotlin"
GIT_KOTLIN="jetbrains/kotlin"
PORT_CA_ROOT="security/ca_root_nss"
PORT_GIT="devel/git"
PORT_JDK="java/openjdk17"
PORT_JQ="textproc/jq"
for PORT in "${PORT_CA_ROOT}" "${PORT_GIT}" "${PORT_JDK}" "${PORT_JQ}"
@masterflitzer
masterflitzer / email-multiplexer.py
Last active November 26, 2023 20:13
Send E-Mail from IMAP to multiple recipients over SMTP
#!/usr/bin/env python3
import os
import toml
from email import message_from_bytes, policy
from email.message import EmailMessage
from enum import Enum
from html import escape
from imaplib import IMAP4, IMAP4_SSL
from smtplib import SMTP, SMTP_SSL
@masterflitzer
masterflitzer / README.md
Last active November 29, 2023 15:41
Make ChatGPT window wider

ChatGPT Wide

  • Open a chat on ChatGPT
  • Create a bookmark in your browser and paste javascript: followed by the minified code into the URL input field (Bookmarklet)
  • Alternatively: Open the browser DevTools (F12) and paste the code into the console

Minify

terser --compress --mangle --output chatgpt-wide.min.js chatgpt-wide.js
@masterflitzer
masterflitzer / compile-ffmpeg-debian.sh
Last active November 19, 2024 21:34
Compile ffmpeg on Debian
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
if test -z "${FFMPEG_VERSION:-}"
then
echo "You need to set the FFMPEG_VERSION environment variable (see https://git.ffmpeg.org/gitweb/ffmpeg.git/tags)"
@masterflitzer
masterflitzer / ffmpeg.sh
Last active October 9, 2024 19:41
Convert any movie to WebM (AV1/Opus/WebVTT)
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
# e.g. "Movie name (Year)" or "Series name (Year) - S01E01 - Episode title"
TITLE="${TITLE:-}"
DESCRIPTION="${DESCRIPTION:-}"
@masterflitzer
masterflitzer / battery-log.ps1
Created March 13, 2023 19:32
Log current battery charge on Windows
while ($true) {
$charge = Get-CimInstance -ClassName Win32_Battery | Select-Object -ExpandProperty EstimatedChargeRemaining
Write-Output "Current Charge: ${charge}%" | Tee-Object -Append "$([System.Environment]::GetFolderPath("Desktop"))/battery.log"
Start-Sleep -Seconds 30
}