Skip to content

Instantly share code, notes, and snippets.

View Blayung's full-sized avatar

Tea Master Blayung

  • Poland
  • 07:49 (UTC +01:00)
View GitHub Profile
@Blayung
Blayung / convert.py
Last active October 19, 2025 12:58
A python script that converts normal english text into my own phonetic latin-based english writing system. All phonemes are represented by digraphs and the only diacritics are optional and used to inform about stress and places where digraphs are actually pronounced separately. Example text: érlij tuw bed and érlij tuw rajz mejks a maen hélthij,…
#!/bin/python
from big_phoney import BigPhoney, preprocessors
from os import devnull
from tqdm import tqdm
from contextlib import redirect_stdout
from unicodedata import normalize
phonemeMap = {
# Vowels
"aa": "aa",
@Blayung
Blayung / latin_cyrillic_custom
Last active October 13, 2025 22:59
My custom X11 keyboard layout with support for latin (polish, german, english) and cyrillic (russian, ukrainian, serbian, belarussian) writing, based on qwerty. To be put in /usr/share/xkeyboard-config-2/symbols
default partial alphanumeric_keys
xkb_symbols "basic" {
include "latin"
name[1] = "Latin";
key <TLDE> { [ grave, asciitilde, doublelowquotemark, rightdoublequotemark ] };
key <AE01> { [ 1, exclam, notequal, exclamdown ] };
key <AE02> { [ 2, at, twosuperior, questiondown ] };
key <AE04> { [ 4, dollar, EuroSign, sterling ] };
@Blayung
Blayung / update-discord.py
Created August 1, 2025 13:13
Automatic updating of the broken discord package on arch linux.
#!/bin/python3
import os, requests, io, tarfile, shutil
if os.geteuid() != 0:
print("This script needs to be run as root!")
exit()
tarfile.open(fileobj = io.BytesIO(requests.get("https://discord.com/api/download?platform=linux&format=tar.gz").content)).extractall(filter = "data")
shutil.rmtree("/opt/discord", ignore_errors = True)
shutil.move("Discord", "/opt/discord")
@Blayung
Blayung / polishToCyrillic.py
Last active July 6, 2025 09:59
Polish to cyrillic text converter
#!/bin/python3
mainMap = {
"a": "а",
"ą": "ѧ",
"b": "б",
"c": "ц",
"ć": "ть",
"d": "д",
"e": "э",
"ę": "ѫ",
@Blayung
Blayung / gpu-usage.py
Last active February 1, 2025 16:22
Nvidia gpu usage python script for i3blocks
#!/bin/python3
import bs4
import subprocess
xmlData = bs4.BeautifulSoup(subprocess.check_output(["nvidia-smi", "-q", "-x"]), "xml")
print(f"{xmlData.find('gpu_util').string[:-2]}%, {xmlData.find('memory_util').string[:-2]}%")
@Blayung
Blayung / extract.sh
Last active February 1, 2025 16:23
A simple bash script to extract the most common archive types
#!/bin/bash
if [ -z "$1" ]; then
echo "No file name was specified."
exit
elif ! [ -z "$2" ]; then
echo "Usage: extract.sh <filename>"
exit
elif ! [ -f "$1" ]; then
echo "This file does not exist."
exit