Skip to content

Instantly share code, notes, and snippets.

View BoyanXu's full-sized avatar
🎣
Fishing

BoyanXu BoyanXu

🎣
Fishing
View GitHub Profile
### Keybase proof
I hereby claim:
* I am boyanxu on github.
* I am boyanxu (https://keybase.io/boyanxu) on keybase.
* I have a public key ASCCiJnQ5gsYA5Q8q4IcH-XR-YCUcMlE4IL427JQB9jj3Qo
To claim this, I am signing this object:
@BoyanXu
BoyanXu / extensions.json
Created September 14, 2023 15:23
VS Code workspace recommended extensions
{
"recommendations": [
"visualstudioexptteam.vscodeintellicode"
]
}
@BoyanXu
BoyanXu / pve_xtermjs_for_arch_vm.txt
Last active September 10, 2023 04:24 — forked from yuna0x0/pve_xtermjs_for_ubuntu_vm.txt
Proxmox VE xterm.js (Serial Terminal) for Arch Linux VM
1. Add a virtual serial port to the VM using PVE Web GUI and restart the VM
2. Config grub
When using GRUB with a generated grub.cfg, edit /etc/default/grub and enable serial input and output support:
/etc/default/grub
...
GRUB_TERMINAL_INPUT="console serial"
...
GRUB_TERMINAL_OUTPUT="gfxterm serial"
@BoyanXu
BoyanXu / kde-shortcut.kksrc
Created August 13, 2023 21:49
KDE Plasa Shortcuts
[ActivityManager][Global Shortcuts]
switch-to-activity-cbe4b85e-029f-4dbd-aff6-d4df740738a9=
[KDE Keyboard Layout Switcher][Global Shortcuts]
Switch to Next Keyboard Layout=Meta+Alt+K
[StandardShortcuts]
AboutApp=
AboutKDE=
Activate Next Tab=Ctrl+]; Ctrl+PgDown
@BoyanXu
BoyanXu / clean-sync-conflict.bash
Created July 4, 2023 02:22
Bash script to clean Syncthings syn conflict files
#!/bin/bash
# Go through each file with "sync-conflict" in its name
# -type f ensures we are only dealing with files (not directories)
find . -type f -name '*sync-conflict*' -print0 | while IFS= read -r -d '' file
do
# Check if file exists (it should, but let's be safe)
if [ -f "$file" ]; then
echo "Deleting $file"
rm "$file"
@BoyanXu
BoyanXu / PKGBUILD
Created June 8, 2023 17:31
RWKV-Runner AUR
pkgname=RWKV-Runner
pkgver=1.2.0
pkgrel=1
pkgdesc="RWKV Runner binary"
arch=('x86_64')
url="https://github.com/josStorer/RWKV-Runner"
license=('MIT')
depends=('python' 'python-pytorch' 'python-pydantic' 'python-psutil' 'python-fastapi' 'python-sse-starlette' 'python-gputil')
makedepends=('git')
source=("${pkgname}_linux_x64::https://github.com/josStorer/RWKV-Runner/releases/download/v$pkgver/RWKV-Runner_linux_x64")
#!/usr/bin/python3
import os, json, http.client, sys
from PyQt6.QtWidgets import QApplication, QMessageBox, QAbstractButton
from PyQt6.QtGui import QIcon, QPixmap, QClipboard
from PyQt6.QtCore import Qt
from pyperclip import paste, copy
from urllib.request import urlopen, Request
def deepl_api(text):
@BoyanXu
BoyanXu / homebrew-migration-check.fish
Last active May 24, 2023 11:07
Check how many binary files installed through /usr/local/bin/brew are x86-based
#!/usr/local/bin/fish
rm list-of-* 2> /dev/null
## Get list-of-bin, list-of-pkg
exa -al /usr/local/bin | grep Cellar | awk '{ print "/usr/local/bin/" $7}' | sort | uniq >> list-of-bin
exa -al /usr/local/bin | grep Cellar | awk '{ print $9}' | sort | uniq | awk -F'/Cellar/' '{split($2,a,"/"); print a[1]}' | sort | uniq >> list-of-pkg
## Get list-of-arch
while read -la file
@BoyanXu
BoyanXu / sol6.cpp
Created October 11, 2022 08:23
sol6.cpp
#include <iostream>
#include <unordered_set>
#include <utility>
using namespace std;
class Solution {
public:
vector<pair<int,int>> doubleCheck(vector<int> V) {
unordered_set<int> H;
@BoyanXu
BoyanXu / DHCP
Created October 7, 2022 05:57
DHCP
Server Client Server
(not selected) (selected)
v v v
| | |
| Begins initialization |
| | |
| _____________/|\____________ |
|/DHCPDISCOVER | DHCPDISCOVER \|
| | |