Skip to content

Instantly share code, notes, and snippets.

View taoky's full-sized avatar
🔬
Revising thesis proposal

taoky taoky

🔬
Revising thesis proposal
  • University of Science and Technology of China
  • on USTC campus
  • 03:05 (UTC +08:00)
View GitHub Profile
@taoky
taoky / Program.cs
Created June 16, 2024 18:15
Read osu realm and get audio/bg hashes
// CollectionDowngrader.LazerSchema from https://github.com/ookiineko/CollectionDowngrader/tree/main/LazerSchema
using CollectionDowngrader.LazerSchema;
using Realms;
// Console.WriteLine($"cwd: {Environment.CurrentDirectory}");
const int LazerSchemaVersion = 41;
string realmFile = Path.GetFullPath("./client.realm");
RealmConfiguration config = new(realmFile)
{
IsReadOnly = true,
@taoky
taoky / update.sh
Created May 22, 2024 15:08
autocorrect-bin AUR update
#!/bin/bash -e
version=2.10.0
rm -f autocorrect-linux-amd64.tar.gz.sha256
wget https://github.com/huacnlee/autocorrect/releases/download/v$version/autocorrect-linux-amd64.tar.gz.sha256
rm -f autocorrect-linux-arm64.tar.gz.sha256
wget https://github.com/huacnlee/autocorrect/releases/download/v$version/autocorrect-linux-arm64.tar.gz.sha256
sed -i "s/^pkgver=.*/pkgver=$version/" PKGBUILD
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=('$(cat autocorrect-linux-amd64.tar.gz.sha256)')/" PKGBUILD
sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=('$(cat autocorrect-linux-arm64.tar.gz.sha256)')/" PKGBUILD
@taoky
taoky / NOTE
Last active April 11, 2024 11:36
/proc/mdstat logic (Linux 6.7)
# md_seq_show
- printf("%s: %sactive", dev, active ? "" : "in")
- if active
- if rdonly then printf(" (read-only)")
- if autoread then printf(" (auto-read-only)")
- printf(" %s", raidtype)
- for each dev
- printf(" %pg[%d]", dev, nr)
- * NOTE: %pg is a special format that prints the device name
- if writemostly then printf("(W)")
@taoky
taoky / Cargo.toml
Last active March 28, 2024 18:17
wl_registry_add_listener example (Rust)
[package]
name = "globals"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
log = "0.4.21"
simple_logger = "4.3.3"
@taoky
taoky / psi-io-cg.sh
Created March 20, 2024 13:14
Show I/O PSI of cgroups
#!/bin/bash
CGROUP_PATH="/sys/fs/cgroup"
# Function to show IO PSI if avg10 is not 0 for a given cgroup
show_io_psi_if_needed() {
local cgroup_path=$1
local psi_file="${cgroup_path}/io.pressure"
if [ -f "${psi_file}" ]; then
@taoky
taoky / bluepause.py
Created December 7, 2023 08:23
Auto pause players when bluetooth headphones disconnect
#!/usr/bin/env python3
import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gi.repository.GLib as glib
import os
def device_removed_callback(object_, interfaces):
if interfaces[-1] != "org.bluez.MediaPlayer1":
return
@taoky
taoky / dark.css
Created October 20, 2023 11:38
whiteglass theme dark CSS by darkreader
/*
_______
/ \
.==. .==.
(( ))==(( ))
/ "==" "=="\
/____|| || ||___\
________ ____ ________ ___ ___
| ___ \ / \ | ___ \ | | / /
| | \ \ / /\ \ | | \ \| |_/ /
@taoky
taoky / 41454b52dcb232a10b1af52e939798332cb415ed
Last active September 25, 2023 04:55
journalctl debugging
Considering root directory '/run/log/journal'.
Root directory /run/log/journal added.
Considering root directory '/var/log/journal'.
Root directory /var/log/journal added.
Considering directory '/var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394'.
Directory /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394 added.
Journal effective settings seal=no keyed_hash=yes compress=ZSTD compress_threshold_bytes=8B
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/system@22316234162f4e16a4208558d2318feb-0000000000af220d-0005fb7ebd5b49dc.journal added.
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/user-1000@5c9d6a903213438bbcfebd81e0c430d5-0000000000ae7364-0005fb7e9183b5da.journal added.
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/system@22316234162f4e16a4208558d2318feb-0000000000b2a9ea-0005fbb495eac39b.journal added.
@taoky
taoky / output
Created September 21, 2023 18:01
journalctl bug 2
> SYSTEMD_LOG_LEVEL=debug journalctl -b -1
Considering root directory '/run/log/journal'.
Root directory /run/log/journal added.
Considering root directory '/var/log/journal'.
Root directory /var/log/journal added.
Considering directory '/var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394'.
Directory /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394 added.
Journal effective settings seal=no keyed_hash=yes compress=ZSTD compress_threshold_bytes=8B
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/system@22316234162f4e16a4208558d2318feb-0000000000af220d-0005fb7ebd5b49dc.journal added.
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/user-1000@5c9d6a903213438bbcfebd81e0c430d5-0000000000ae7364-0005fb7e9183b5da.journal added.
@taoky
taoky / output
Created September 12, 2023 06:04
journalctl assertion
> SYSTEMD_LOG_LEVEL=debug journalctl -b -1
Considering root directory '/run/log/journal'.
Root directory /run/log/journal added.
Considering root directory '/var/log/journal'.
Root directory /var/log/journal added.
Considering directory '/var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394'.
Directory /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394 added.
Journal effective settings seal=no keyed_hash=yes compress=ZSTD compress_threshold_bytes=8B
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/system@22316234162f4e16a4208558d2318feb-00000000009fd362-0005fa2ea9e08fff.journal added.
File /var/log/journal/16d4ba3e7960484ca6a7dda49d8e5394/system@22316234162f4e16a4208558d2318feb-00000000009fdab9-0005fa2eaab216f6.journal added.