Skip to content

Instantly share code, notes, and snippets.

View Glucy-2's full-sized avatar

Glucy2 Glucy-2

View GitHub Profile
@ctlllll
ctlllll / longest_chinese_tokens_gpt4o.py
Created May 13, 2024 19:53
Longest Chinese tokens in gpt4o
import tiktoken
import langdetect
T = tiktoken.get_encoding("o200k_base")
length_dict = {}
for i in range(T.n_vocab):
try:
length_dict[i] = len(T.decode([i]))
except:
@RigoLigoRLC
RigoLigoRLC / template.svg
Created April 13, 2024 07:33
红色电音极地大冲击模板 (CC BY-NC 4.0)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Mount Volumes into Proxmox VMs with Virtio-fs

Part of collection: Hyper-converged Homelab with Proxmox

15-04-2025: Seems Proxmox added this now to the GUI; see Using VirtioFS backed by CephFS for bind mounts how to use it.

Virtio-fs is a shared file system that lets virtual machines access a directory tree on the host. Unlike existing approaches, it is designed to offer local file system semantics and performance. The new virtiofsd-rs Rust daemon Proxmox 8 uses, is receiving the most attention for new feature development.

Performance is very good (while testing, almost the same as on the Proxmox host)

@lzghzr
lzghzr / 544+ flr 解锁56G直连.md
Last active April 17, 2025 02:51
544+ flr 解锁56G直连
@layou233
layou233 / mcping.c
Last active February 24, 2023 02:24
MCPing for Windows
/*
This code was written in pure C.
Build it with: (Windows only)
gcc ./mcping.c -o mcping.exe -lws2_32 -O2
MCPing v0.1.1
By Launium 2023. GitHub @layou233.
License: CC-BY-SA 3.0
*/

scenario: you have a windows vm failing to boot with INACCESSIBLE_BOOT_DEVICE and changing the disk type to ide or something else causes another bsod. how to you get it to boot up again without a physical machine?

download the stable virtio drivers from here, in iso form: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso

add the iso to your qemu/virt manager config as a cd/dvd drive

windows should send you to the recovery mode screen, but if it doesn't you might have to run a windows install iso to get to it.

@trenutoo
trenutoo / migrate-pterodactyl.md
Last active April 21, 2025 07:39
Pterodactyl panel and wings migration

Pterodactyl Migration

Migrating panel

  1. Backup your hidden .env file containing the decryption APP_KEY from /var/www/pterodactyl

  1. Export the database, in this case ours is named panel
@jamesmacwhite
jamesmacwhite / README.md
Last active October 27, 2024 21:27
An example and overview of mwan3 IPv6 configuration with NAT6 (sorry anti IPv6 NAT people)

Deploying mwan3 with IPv6 (using NAT6)

I'm a user of mwan3 and contribute to its development in a small way by mainly providing feedback with my multi WAN setup and maintaining the beast of it's documentation on the OpenWrt wiki (feedback and contributors welcome).

This setup ultimately requires the use of a NAT6 firewall script. NAT6 is currently broke with fw3 and LuCI, so this is an important helper script to workaround this current limitation.

The NAT6 configuration requirements are explained in more detail on the OpenWrt wiki.

This gist is aims to document my configuration for others.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 21, 2025 16:19
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@bmaupin
bmaupin / en_SE
Last active March 17, 2025 18:17
en_SE locale
escape_char /
comment_char %
% This file was generated by taking the LC_TIME section from en_US and
% replacing date/time representation with that of sv_SE from the glibc
% locale sources
% (http://sourceware.org/git/?p=glibc.git;a=tree;f=localedata/locales;hb=HEAD)
% (https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html)
% This file is part of the GNU C Library and contains locale data.