This file contains 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
# Copyright (c) 2023 Gonçalo Baltazar <me@goncalomb.com> | |
# MIT License | |
# this macro can be used to manipulate face geometry (scale and origin vertex) | |
# it was specially made to rescale imported faces (e.g. svg) | |
# imported geometry may have undesired scale and position, depending on the | |
# original file (positions, translations, dpi etc.) | |
# after importing, select a single face vertex and run the macro |
This file contains 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 | |
# Copyright (c) 2022 Gonçalo Baltazar <me@goncalomb.com> | |
# MIT License | |
# Extract music/audio from 'Bully: Scholarship Edition' on PC. | |
# This script expects the game to be installed on Linux using Steam. | |
# Use Proton to install Bully on Steam, then run the script: | |
# - Open the game properties |
This file contains 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
// control a hue lights group from a shelly device, without the cloud | |
// for shelly gen2 devices that have script support | |
// author: goncalomb <me@goncalomb.com> | |
// year: 2022 | |
// 1. use the hue debugger (clip.html) to create a new username (POST to /api), see below | |
// 2. change HUE_URL and HUE_USERNAME | |
// 3. optionally change HUE_GROUP, SHELLY_INPUT and EDGE_SWITCH | |
// 4. add the script to your shelly (web ui) | |
// 5. done |
This file contains 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 | |
# Copyright (c) 2021 Gonçalo Baltazar <me@goncalomb.com> | |
# MIT License | |
# pip3 install --upgrade youtube-dl | |
# ffmpeg -y -loglevel repeat+info -i file:video.xyz -i file:audio.xyz -c copy -map 0:v:0 -map 1:a:0 file:out.mkv | |
set -eo pipefail | |
cd -- "$(dirname -- "$0")" |
This file contains 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/sh | |
# Copyright (c) 2019 Gonçalo Baltazar <me@goncalomb.com> | |
# MIT License | |
# Open a root shell on a Kubernetes cluster Node (no ssh). | |
# It uses a privileged container to unlock Linux capabilities and chroot to | |
# change into the root filesystem of the Node for full access. |
This file contains 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/env python3 | |
# Copyright (c) 2022 Gonçalo Baltazar <me@goncalomb.com> | |
# MIT License | |
import os, argparse, shutil, tempfile, requests, zipfile | |
import xml.etree.ElementTree as ET | |
tmp_dir = os.path.join(tempfile.gettempdir(), 'ps-names') | |
datfile_list = [ |
This file contains 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 | |
set -e | |
# check if is valid repo | |
git rev-parse HEAD >/dev/null | |
# cd to top level | |
cd -- "$(git rev-parse --show-toplevel)" |
This file contains 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
<?php | |
// Author: Gonçalo Baltazar <me@goncalomb.com> | |
// I place this code in the public domain. | |
/** | |
* Output an ICO image to either the standard output or a file. | |
* | |
* It takes the same arguments as 'imagepng' from the GD library. Works by | |
* creating a ICO container with a single PNG image. | |
* This type of ICO image is supported since Windows Vista and by all major |
This file contains 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 | |
# Author: Gonçalo Baltazar <me@goncalomb.com> | |
# I place this code in the public domain. | |
# Finds problems with git repositories that might lead to information loss | |
# in case of losing the local copy. | |
# Things like: uncommitted changes, untracked files, commits not pushed, etc. | |
# Put this script on your PATH. Then run 'git-problems' on a git repository or |
This file contains 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 | |
set -ex | |
mkdir -p snapraid | |
cd snapraid | |
REL_JSON=$(curl -sS "https://api.github.com/repos/amadvance/snapraid/releases/latest" | grep browser_download_url) | |
if [[ ! "$REL_JSON" =~ \"browser_download_url\":\ \"https:\/\/github.com\/[^\"]+\/releases\/download\/v([^\"]+)\/(snapraid-[^\"]+.tar.gz)\" ]]; then |
NewerOlder