Skip to content

Instantly share code, notes, and snippets.

@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 / wine_build.sh
Last active May 5, 2024 19:59
For building Wine
#!/bin/bash
# Builds Wine
# 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
@shmerl
shmerl / wine_env.sh
Last active May 5, 2024 19:18
Environment setting for custom Wine usage
#!/bin/bash
# Helper script for wine_run.sh / winetricks_run.sh
# Sets environment. See wine_run.sh for details on
# configurable variables usage.
# $wine variable is a shortcut, setting /opt/$wine for $wine_path
# But explicitly set $wine_path takes priority.
if [[ "${wine+isset}" ]] && ! [[ "${wine_path+isset}" ]]; then
wine_path="/opt/${wine}"
@shmerl
shmerl / mesa_debian_build.sh
Last active March 10, 2024 19:35
For building Mesa on Debian
#!/bin/bash
# Notes:
#
# 1. Works for tags and specific hash commits too (override mesa_branch variable with needed value).
#
# 2. By default builds for /opt/mesa-<branch> and places the result in ${HOME}/mnt/vmshare/mesa-<branch>
# You can override the build deployment location by setting dest_dir. For example this should put it right away
# in /opt/mesa-<branch>
#
@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 / 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 / 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_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:
@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
#