Skip to content

Instantly share code, notes, and snippets.

View whc2001's full-sized avatar
🐟
Fish-touching

whc2001

🐟
Fish-touching
View GitHub Profile
@whc2001
whc2001 / OpenWrtAlsaConfigAutoStart.sh
Created June 18, 2020 20:32
设置OpenWrt默认声卡和音量,丢到rc.local即可
# ====Sound card configuration====
DEFAULT_CARD=1
VOLUME=100
# Config default card
if ! grep -q "defaults.pcm.card" /etc/asound.conf; then
echo "defaults.pcm.card ${DEFAULT_CARD}" >> /etc/asound.conf
echo "defaults.ctl.card ${DEFAULT_CARD}" >> /etc/asound.conf
fi
[↑]RPC Request
{
"id":"$0",
"method":"$1",
"params":[
$2
],
"type":"rpc-request"
}
$0: Unknown UUID, can be an empty string
@whc2001
whc2001 / StartupSound.sh
Created August 9, 2019 04:07
OpenWRT startup beeping
# 高音
# /usr/bin/beep -f 2093 -l 246 -D 2 -n -f 1975 -l 240 -D 9 -n -f 1760 -l 372 -D 2 -n -f 1760 -l 372 -D 2 -n -f 1567 -l 247 -D 2 -n -f 1318 -l 372 -D 2 -n -f 1318 -l 372 -D 2 -n -f 1174 -l 247 -D 2 -n -f 1318 -l 1247 -D 2 -n -f 1567 -l 497 -D 2 -n -f 1318 -l 247 -D 2 -n -f 1174 -l 1247 -D 2 -n -f 1174 -l 122 -D 2 -n -f 1318 -l 122 -D 2 -n -f 1174 -l 247 -D 2 -n -f 1318 -l 247 -D 2 -n -f 1567 -l 1497 -D 2 -n -f 1975 -l 247 -D 2 -n -f 1760 -l 2747
# 低音
/usr/bin/beep -f 1046 -l 248 -D 1 -n -f 987 -l 241 -D 8 -n -f 880 -l 373 -D 1 -n -f 880 -l 373 -D 1 -n -f 783 -l 248 -D 1 -n -f 659 -l 373 -D 1 -n -f 659 -l 373 -D 1 -n -f 587 -l 248 -D 1 -n -f 659 -l 1248 -D 1 -n -f 783 -l 498 -D 1 -n -f 659 -l 248 -D 1 -n -f 587 -l 1248 -D 1 -n -f 587 -l 123 -D 1 -n -f 659 -l 123 -D 1 -n -f 587 -l 248 -D 1 -n -f 659 -l 248 -D 1 -n -f 783 -l 1498 -D 1 -n -f 987 -l 248 -D 1 -n -f 880 -l 2748
@whc2001
whc2001 / TinyminsCrypt.py
Created April 28, 2019 02:57
TinyminsCrypt
# https://weibo.com/ttarticle/p/show?id=2309404351816631464626
def Encrypt(str, encoding="utf-8"):
return [(byte + 0x0D) & 0xFF for byte in bytearray(str, encoding=encoding)]
def Decrypt(bytes, encoding="utf-8"):
return str(bytearray([(byte - 0x0D) & 0xFF for byte in bytes]), encoding)
import json
jsonData = json.loads(Decrypt(bytearray.fromhex("882F6E2F472FBFF5C6EAD3F3E1C22F392F732F473D392F7B2F472FC7D0C2D1E1F4C2F0DDEADCAF2F392F802F472FC3C4E4B7DDD4DFD32F392F602F472FC2F4DDD2DBF2D4052F392F812F473E423F3F3D4344403D458A"), "cp936"))
@whc2001
whc2001 / hiragana2katakana
Created August 9, 2016 13:37
C# Convert Hiragana To Katakana By Unicode
public string HiraganaToKatakana(string input)
{
byte[] unicodes = Encoding.GetEncoding("Unicode").GetBytes(input);
int i;
for (i = 0; i < unicodes.Length; i += 2) //Each 16 bits.
{
int _word = (unicodes[i + 1] << 8) | (unicodes[i] & 0xFF); //Two byte make a word.
if (_word >= 0x3041 && _word <= 0x30A0) //In hiragana area?
{
_word += 0x60; //Add difference.
@whc2001
whc2001 / api.txt
Last active July 19, 2016 08:38 — forked from dkwingsmt/api.txt
Touken Ranbu
{Legends}
[Un] : Unknown field.
{Data models}
<Sword Model>
serial_id: "1056506", # A unique number to mark each sword
sword_id: "93", # Sword code.Use it to inquire name or initialize a new sword.If value >= 100000 then it's an enemy sword.
symbol: "1", # Independent evolution flag.This evolution method does not change 'sword_id'.
rarity: "2", # Rarity.[1,5]
level: "27", # Level.