Skip to content

Instantly share code, notes, and snippets.

View qguv's full-sized avatar
vibing

Quint Guvernator qguv

vibing
View GitHub Profile
#!/bin/sh
set -e
tr=tr
if hash gtr 2> /dev/null; then
tr=gtr
fi
if [ "$1" = -2 ]; then
shift
@qguv
qguv / vscode-wayland.md
Last active May 21, 2025 16:16
Visual Studio Code: Enable native Wayland support

Native wayland support is now working consistently for me in VSCode, giving much better text rendering. Unfortunately, it's still hidden behind some command-line flags.

By adding some files to /usr/local/*, you can ensure that VSCode always launches with these flags.

Adding launch flags to VSCode

Assuming that the VSCode launcher is /usr/bin/code-oss (as is the case in Arch):

  1. Create /usr/local/bin/code-oss with the following content:
@qguv
qguv / build-cargo-tar.sh
Last active April 2, 2025 09:19
Build a cargo project from a tar archive and write the output executable to a given path
#!/bin/sh
set -e
source_path="${1:?missing first argument: tar archive of cargo project}"
dest_path="${2:?missing second argument: path of output executable}"
rm -rf __proj
mkdir __proj
tar --strip-components=1 -xf "$source_path" -C __proj
cd __proj
@qguv
qguv / extract_stereo.sh
Last active March 17, 2025 14:19
Extract stereo audio from multi-channel 4i4 patched screen recording (3/4 out to 3/4 in)
ffmpeg -i in.mov -c:v copy -af 'pan=2c|c0=c4|c1=c5' out.mov
@qguv
qguv / GMSE01.ini
Created October 23, 2020 23:42
Dolphin Emulator settings for Super Mario Sunshine (GameCube, NTSC, USA)
# Dolphin game-specific settings for: Super Mario Sunshine (GameCube, NTSC, USA)
# https://wiki.dolphin-emu.org/index.php?title=Super_Mario_Sunshine
[Core]
# Avoids crashing after long periods of play
SyncGPU = True
[Video_Enhancements]
@qguv
qguv / functional_python.py
Created February 26, 2014 15:06
Simple examples of reduce, map, filter, lambda, and unpacking in Python 2
#!/usr/bin/env python2
# Functional Python: reduce, map, filter, lambda, *unpacking
# REDUCE EXAMPLE
add = lambda *nums: reduce(lambda x, y: x + y, nums)
def also_add(*nums):
'''Does the same thing as the lambda expression above.'''
def add_two_numbers(x, y):
@qguv
qguv / internet_uccs.md
Last active March 4, 2024 17:14
Automatic WPA Supplicant Configuration for GNU/Linux

Get a hard-wired ethernet connection

Disable all other network daemons

This is just an example; disable and stop all active daemons.

sudo systemctl stop dhcpcd
sudo systemctl disable dhcpcd
@qguv
qguv / ue5_sav.ksy
Created January 14, 2024 21:57
Parser for Unity Engine 5 save files (tested on Pseudoregalia saves)
meta:
id: pseudoregalia_save
endian: le
seq:
- id: magic
contents: GVAS
- id: unknown1
size: 22
- id: version
type: strn
@qguv
qguv / get_stickers.py
Last active January 6, 2024 14:01
Extract the most commonly used stickers from your Telegram chat history.
#!/usr/bin/env python3
'''
Extract the most commonly used stickers from your Telegram chat history as:
- a JSON obj mapping sticker paths to the number of times sent; or
- the above in text; or
- a simple webpage showing all the stickers.
'''
_epilog = '''\
To get your Telegram chat history:
@qguv
qguv / BashNP-Guide.txt
Created December 2, 2019 13:30
shudder's guide to network programming in bash (Mirror of broken http://shudder.daemonette.org/source/BashNP-Guide.txt)
shudder's guide to network programming in bash
==============================================
1. What's this?
I'm kind of a maniac when it's about doing nifty things with
tools not originally designed for that.that's why I wrote the "guide".
maybe there are some other resources that document this (not
counting the bash manual page) but I wanted to express my own
impressions on the possibilities of bash.