Skip to content

Instantly share code, notes, and snippets.

@Bryan2333
Bryan2333 / nexttrace.fish
Created November 30, 2023 04:23
Fish shell completion for nexttrace
# Completion for https://github.com/nxtrace/NTrace-core
set -l DATA_PROVIDER 'IP.SB IPInfo IPInsight IP-API.com Ip2region IPInfoLocal CHUNZHEN disable-geoip'
set -l POW_PROVIDER 'api.leo.moe sakura'
set -l DOT_SERVER 'dnssb aliyun dnspod google cloudflare'
set -l LANGUAGE 'cn en'
complete -c nexttrace -s h -l help -d "Print help information"
complete -c nexttrace -s 4 -l ipv4 -d "Use IPv4 only"
complete -c nexttrace -s 6 -l ipv6 -d "Use IPv6 only"
@Bryan2333
Bryan2333 / tcping.fish
Created November 30, 2023 04:25
Fish shell completion for tcping
# Completion for https://github.com/pouriyajamshidi/tcping
complete -c tcping -s 4 -d "only use IPv4"
complete -c tcping -s 6 -d "only use IPv6"
complete -c tcping -s I -a "$(ls /sys/class/net/)" -x -d "Interface name to use for sending probes"
complete -c tcping -s c -d "stop after <n> probes, regardless of the result. by default, no limit will be applied"
complete -c tcping -l db -d "path and file name to store tcping output to sqlite database"
complete -c tcping -s i -d "interval between sending probes. The default is one second"
complete -c tcping -s j -d "output in JSON format"
complete -c tcping -l pretty -d "use indentation when using json output format. No effect without the '-j' flag"
@Bryan2333
Bryan2333 / wait-online.service
Last active March 14, 2024 15:51
Ping a server on the internet until it becomes reachable
[Unit]
Description=Ping a server on the internet until it becomes reachable
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c 'while ! ping -c1 223.5.5.5; do sleep 1; done'
TimeoutStartSec=900s
StandardOutput=null
@Bryan2333
Bryan2333 / btrfs-balance.service
Last active April 15, 2024 08:29
Btrfs Balance
[Unit]
Description=Balance Btrfs filesystem on nvme0n1
[Service]
Type=oneshot
ExecStart=/usr/bin/btrfs balance start -dusage=10 /
@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
@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 / 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 / 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 / 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 / localrepo
Last active June 29, 2024 16:20
本地仓库localrepo相关脚本
#!/usr/bin/env fish
if ! fish_is_root_user
echo "This script must be run as root!"
exit 1
end
if ! type -q rsync
echo "Please install rsync first!"
exit 1