Skip to content

Instantly share code, notes, and snippets.

@shmerl
shmerl / gpu_power_cap.sh
Last active March 3, 2024 23:10
AMD GPU power cap
#!/bin/bash
# Note: make sure the card / hwmon indexes correspond to your GPU!
# They can differ depending on your set up.
gpu_hwmon="/sys/class/drm/card0/device/hwmon/hwmon2"
# Takes cap parameter in Watts. "max" sets it to max allowed.
cap_watts=$1
@shmerl
shmerl / zstdcompress
Created February 21, 2024 00:07
For convenient creation of zstd archives
#!/bin/bash
source="$1"
keep_dir=${keep_dir:-false}
tar_wrap=${tar_wrap:-true} # for wrapping a single file
if [[ "$source" == "" ]]; then
echo "Error: No source provided!"
exit 1
@shmerl
shmerl / zstdextract
Created February 21, 2024 00:08
For convenient extraction of zstd archives
#!/bin/bash
source="$1"
if [[ "$source" == "" ]]; then
echo "Error: No source provided!"
exit 1
fi
if ! [[ -e "$source" ]]; then
@shmerl
shmerl / wine_new_prefix.sh
Last active June 11, 2025 01:33
For creating a new Wine prefix without mime associations clutter and shell folder symlinks
#!/bin/bash
#
# Notes:
#
# Requires WINEPREFIX to be set
# Uses wine_env.sh which sets the environment (without it will use default wine)
# relies on ripgrep (rg)
#
@shmerl
shmerl / gog_captain_blood_extract_ogg.sh
Last active May 9, 2025 21:43
For extracting GOG Captain Blood Ogg audio files
#!/bin/bash
# Rough script for extracting Ogg/Vorbis audio files from *.ssb sound banks
# in Captain Blood found in <game_dir>/resource/sounds
#
# Usage: gog_captain_blood_extract_ogg.sh <bank_file>.ssb
#
# Uses ripgrep (rg)
# Notes: