Skip to content

Instantly share code, notes, and snippets.

@Bryan2333
Bryan2333 / night-color.lua
Created September 12, 2024 06:47
mpv控制KDE夜间颜色脚本
-- mpv script to manage the state of night color
-- Based On following gist
-- https://gist.github.com/Zharkan/5f65ff9b1da85b2a2c79b777ed9e6199
-- Global variable to store the initial state of night color
local night_color_was_enabled = false
-- Function to execute shell commands and capture output
function execute_command(cmd)
local handle = io.popen(cmd)
@Bryan2333
Bryan2333 / clash-tproxy
Last active August 28, 2024 10:38
clash tproxy脚本
#!/usr/bin/env bash
if [[ "$EUID" -ne 0 ]]
then
echo "This script must be run as root!"
exit 1
fi
## 默认的网关设备
INTERFACE="$(ip route show default | awk '/default/ {print $5}')"
@Bryan2333
Bryan2333 / checksum
Created July 7, 2024 12:41
ISO目录 checksum b2sum
011aebc796e91581198a8ec01f9dd0a850b3949e04aed647ebb929a1c33990bb0b326b930da207dcf16c7755add9d7c9f452dd29bc759422a5133f8446cdfe1f ThinPC_110415_EVAL_x86fre.iso
c32bbff769efe4843b7b49db909f75ab897150f11478c86239e76339903a4740a2638d8e85da00ad3e96b1b444e098d7766b4cddf89373794b9281acd14e1a68 tiny10 23h1 x64.iso
3cbbd496ee78cb971104954764e3785669c46976a661c7556221445b124aca70911a26185b5a950b6fcb391e6a53c2b34be7b652a6c36dc000adf487b8ad3004 zh-hans_windows_xp_professional_with_service_pack_3_x86_cd_vl_x14-74070.iso
@Bryan2333
Bryan2333 / linuxqq
Last active August 6, 2024 16:19
为LinuxQQ提供固定的MAC地址
#!/usr/bin/env bash
# 修改自:https://alampy.com/2024/05/15/fix-mac-for-linux-qq/
QQ_MAC_FILE="$HOME/.cache/qq_mac"
for cmd in slirp4netns socat nsenter unshare linuxqq
do
if ! command -v "$cmd" &>/dev/null
then
@Bryan2333
Bryan2333 / sign-uki
Created June 9, 2024 15:03
给UKI签名
#!/usr/bin/env fish
set uki "$argv[3]"
if test -z "$uki"
exit 0
end
set keypairs "/root/.secureboot/MOK.key" "/root/.secureboot/MOK.crt"
@Bryan2333
Bryan2333 / proxy.fish
Created April 15, 2024 15:05
fish shell proxy function
# Defined in /home/bryan/.config/fish/functions/proxy.fish @ line 1
function proxy
set -l DEFAULT_PROXY "http://127.0.0.1:7890"
set -l PROXY_URL_FORMAT "^(http|https|socks5|socks5h)://[a-zA-Z0-9.-]+:[0-9]+\$"
function __set_proxy
set -gx HTTP_PROXY $argv[1]
set -gx http_proxy $HTTP_PROXY
set -gx HTTPS_PROXY $HTTP_PROXY
@Bryan2333
Bryan2333 / pkgsizesort
Last active June 22, 2024 07:35
pkgstatus and pkgsizesort
function pkgsizesort
if test (count $argv) -eq 0 || test -z $argv
echo "用法: pkgsizesort 关键字或正则表达式"
return 1
end
set packages $(pacman -Qq | rg -e $argv)
if test (count $packages) -eq 0
echo "不存在符合条件的软件包"
@Bryan2333
Bryan2333 / launch.json
Created March 10, 2024 08:18
VSCode CodeLLDB Cpp Config
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "C调试",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"cwd": "${workspaceFolder}",
@Bryan2333
Bryan2333 / checksum
Created March 8, 2024 15:58
ttf mswin11
64bff9f3461fc688d3c959f6085a4d90d6516a13a0c9742b6632568b708e5953 ttf-ms-win11-10.0.22631.2506-1-any.pkg.tar.zst
7e2dd103fb5f2a52d2a91f9737b7424299250dcc41adf12355ff64f4ffeeac85 ttf-ms-win11-zh_cn-10.0.22631.2506-1-any.pkg.tar.zst
@Bryan2333
Bryan2333 / OneDark.conf
Last active March 9, 2024 03:45
Kitty terminal OneDark theme
#: OneDark Theme {{{
foreground #ABB2BF
background #282C34
# Black
color0 #3F4451
color8 #4d5564
# Red