Skip to content

Instantly share code, notes, and snippets.

View pataruco's full-sized avatar
♥️

Pedro Martin pataruco

♥️
View GitHub Profile
@gaearon
gaearon / unfuck-hotel-tv.sh
Last active December 19, 2025 16:00
Unfuck Sony hotel TV picture mode
#!/bin/bash
# Note: Connect to the TV's wifi network first
MY_IP=$(ipconfig getifaddr en0)
SUBNET=$(echo $MY_IP | cut -d. -f1-3)
TV_IP=""
echo "🔍 Scanning $SUBNET.0/24 for Sony TV..."
@pataruco
pataruco / readme.md
Last active July 6, 2025 15:04
SOPS operations

SOPS

Installation

brew install sops

GPG keys

@pataruco
pataruco / installfest.md
Last active April 13, 2023 10:48
installfest.md
@kerma
kerma / convert_flac_to_aac.sh
Last active November 11, 2025 06:11
Convert all flac files in folder to m4a using ffmpeg and libfdk_aac
# on os x use brew to get ffmpeg with libfdk_aac
brew install ffmpeg --with-fdk-aac
# convert and use m4a as file extension
find . -name '*.flac' -exec sh -c 'ffmpeg -i "$1" -c:a libfdk_aac -b:a 320k "${1%.flac}.m4a"' _ {} \;
@sethlopezme
sethlopezme / full-match.js
Last active February 13, 2024 07:35
Regex for matching any hex, rgb(a), or hsl(a) value. Assumes that you've lowercased the string and removed spaces.
/^(#?([a-f\d]{3,4}|[a-f\d]{6}|[a-f\d]{8})|rgb\((0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d)\)|rgba\((0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),(0|255|25[0-4]|2[0-4]\d|1\d\d|0?\d?\d),(0|0?\.\d|1(\.0)?)\)|hsl\((0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),(0|100|\d{1,2})%,(0|100|\d{1,2})%\)|hsla\((0|360|35\d|3[0-4]\d|[12]\d\d|0?\d?\d),(0|100|\d{1,2})%,(0|100|\d{1,2})%,(0?\.\d|1(\.0)?)\))$/