Skip to content

Instantly share code, notes, and snippets.

View taoky's full-sized avatar
✍️
Working on a master’s thesis

taoky taoky

✍️
Working on a master’s thesis
  • University of Science and Technology of China
  • on USTC campus
  • 22:45 (UTC +08:00)
View GitHub Profile
@taoky
taoky / pytorch-releases-analyze.py
Last active January 31, 2025 04:03
download.pytorch.org file sizes (without nightly)
import json
import os
import requests
import re
import sys
import traceback
HREF_RE = re.compile(r'href="([^"]+)"')
with open("releases.json") as f:
@taoky
taoky / zfsarctop
Last active December 26, 2024 10:49
Show ZFS ARC hit/miss per process with Linux eBPF, modified from cachetop
#!/usr/bin/env python
# Code modified from bcc-tools cachetop
from __future__ import absolute_import
from __future__ import division
# Do not import unicode_literals until #623 is fixed
# from __future__ import unicode_literals
from __future__ import print_function
from bcc import BPF
@taoky
taoky / appinfo.py
Created December 20, 2024 07:36
Show Linux Desktop AppInfo with Gio
import gi
gi.require_version("Gio", "2.0")
from gi.repository import Gio
def main():
# Retrieve all applications using g_app_info_get_all()
app_infos = Gio.AppInfo.get_all()
# Print details for each application
for app_info in app_infos:
@taoky
taoky / wide.md
Created November 10, 2024 13:31
Wide character compatibility

Wide Character Compatibility on Windows, WINE and POSIX

Standard C

#include <stdio.h>
#include <wchar.h>
#include <locale.h>

int main() {
@taoky
taoky / Haruhikage.txt
Last active November 9, 2024 18:30
BeepPlay 2 DECPS
# Converted from https://musescore.com/user/76963843/scores/19868371
60 0
8 4 2
6 4 2
3 5 4
3 5 4
1 5 4
4 5 4
3 5 4
1 5 4
@taoky
taoky / Cargo.toml
Last active November 11, 2024 07:26
Simulate keyboard input in GNOME/KDE Wayland
[package]
name = "keyboardsim"
version = "0.1.0"
edition = "2021"
[dependencies]
ashpd = "0.10.2"
keycode = "0.4.0"
tokio = { version = "1.41.1", features = ["full"] }
@taoky
taoky / main.js
Created October 25, 2024 05:49
Electron wayland tray activation bug
// Modules to control application life and create native browser window
const { app, BrowserWindow, Notification, Tray, Menu } = require('electron')
const path = require('node:path')
let tray;
let mainWindow;
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
@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)")