Skip to content

Instantly share code, notes, and snippets.

@ongyx
ongyx / setup_rich_presence_relay.sh
Last active March 18, 2024 14:15
This script sets up a relay for Discord Rich Presence on WSL2 for https://github.com/andweeb/presence.nvim. Note that this has only been tested on Arch Linux which uses the systemd init system.
#!/bin/bash
EXE='npiperelay.exe'
export GOOS=windows
export GOARCH=amd64
GO_BIN="$(go env GOPATH)/bin/${GOOS}_${GOARCH}"
msg () {
@ongyx
ongyx / bsx.md
Last active May 16, 2023 07:56
Brightspace Extractor

bsx

Short script to correctly extract files from Brightspace zip files.

Prerequisites

bsx requires at least Python 3.9 and Beautiful Soup 4 to be installed. It should work on any of Windows/Linux/macOS, although I've only tested it on the first.

@ongyx
ongyx / unpck.py
Created September 2, 2022 16:03
unpack Unreal Engine .pck files into .wav
"""unpack Unreal Engine .pck audio packs and convert them into .wav
quickbms and vgmstream must be installed and available on your PATH as 'quickbms' and 'vgmstream-cli'.
If not, specify the paths using the '-q' and '-v' options:
unpck -q=<path to quickbms binary> -v=<path to vgmstream-cli> ...
known issues:
- vgmstream does not support Unicode filenames on Windows, so the WEM file will be renamed temporarily to use an ASCII filename if it contains Unicode characters.
"""
@ongyx
ongyx / xshell.sh
Last active October 26, 2021 07:20
[WSL2] Start a new bash shell that can run graphical apps (using VcXsrv or another X server). Your original shell will be restored when you exit xshell (script is isolated)
export DISPLAY=$(ip route | awk '/^default/{print $3; exit}'):0
export LIBGL_ALWAYS_INDIRECT=1
export GDK_DPI_SCALE=1.25
export QT_SCALE_FACTOR=1.25
log=/dev/null
/mnt/c/Program\ Files/VcXsrv/vcxsrv.exe -multiwindow -ac -wgl -dpi auto &> $log &
bash
@ongyx
ongyx / zebra_en_ud.sh
Created September 2, 2020 12:16
Add ‘English (Upside down) language to Zebra
#!/bin/bash
# Downloader for the 'English - Upside Down' language for Zebra.
# Have fun!
ZEBRA='/Applications/Zebra.app/en-UD.lproj'
if ! which curl >> /dev/null; then
echo 'curl is not installed, pls install :('
exit 1
@ongyx
ongyx / checkpollutants.py
Last active October 3, 2019 11:59
A script to check air pollution in Singapore.
"""
A script that gets the most current PM2.5 and
PSI (Pollutant Standards Index) levels from
data.gov.sg.
Licensed under the MIT License.
Copyright (c) 2019 sn3ksoftware
"""
import requests