Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / wordle.sh
Last active February 7, 2022 07:59
A simple version of Wordle game
#!/bin/bash
#
# Uses ripgrep (rg)
#
length=${length:-5}
tries=${tries:-6}
# All words of given length from a dictionary
@shmerl
shmerl / gog_extract_konami_collectors_series.sh
Last active January 22, 2024 06:35
For extracting GOG Konami Collector's Series
#!/bin/bash
# Extractor for game ROMs from Konami Collector's Series.
#
# Usage: gog_extract_konami_collectors_series.sh <path_to>/cc.exe
#
# Make sure you have xxd hexdump tool and dd installed.
#
# Games locations:
@shmerl
shmerl / wine_staging_build.sh
Last active May 5, 2024 20:00
For building Wine staging
#!/bin/bash
# Builds Wine-staging
# Notes:
# 1. Targeted for usage inside a VM (use shared directory $HOME/mnt/vmshare between host and guest).
# 2. You'd need to separately push the result on the host to whatever location you want (like to /opt).
# 3. Place any manual patches in ${HOME}/build/patches
# 4. Override arch to something else if you aren't using Ryzen.
#
@shmerl
shmerl / dxvk_build.sh
Last active October 22, 2023 21:53
For dxvk and vkd3d-proton building on Debian
#!/bin/bash
# Notes:
#
# For Debian build of dxvk and vkd3d-proton.
#
# 1. To build 64-bit and 32-bit dxvk:
#
# for bitness in 64 32; do project=dxvk bitness=$bitness dxvk_build.sh; done
#
@shmerl
shmerl / mesa_run.sh
Last active August 28, 2024 00:56
For launching programs with custom Mesa
#!/bin/bash
# Assumes Mesa libraries are installed in:
# /opt/${mesa}/<arch_dir>
# or in
# ${mesa_path}/<arch_dir>
# For explicit control of the run
mesa_run=${mesa_run:-true}
if ! $mesa_run; then
#!/bin/bash
# Configuration:
#
# WINEPREFIX what prefix to use (or will use the default).
# wine_path custom location of Wine if needed (custom variable for the script).
#
# Uses wine_env.sh
# Note, winetricks requires using WoW64 build of Wine.
@shmerl
shmerl / wine_run.sh
Last active November 3, 2023 05:16
Custom Wine running
#!/bin/bash
# Configuration (set through environment variables):
#
# WINEPREFIX - what prefix to use.
# wine_path - to use custom location of Wine (e.g. /opt/wine-main).
# wine - shortcut for the above, to assume /opt/$wine
#
# Notes: