Skip to content

Instantly share code, notes, and snippets.

View iaGuoZhi's full-sized avatar
🗺️
active

iaGuoZhi

🗺️
active
View GitHub Profile
@huytd
huytd / wordle.md
Last active March 26, 2026 21:25
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@stdrc
stdrc / CMakeLists.txt
Created February 25, 2021 01:23 — forked from baiwfg2/CMakeLists.txt
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@schulace
schulace / .nvimrc
Last active May 7, 2023 14:54
vimrc using CoC for language server
call plug#begin('~/.vim/plugged')
" file-browser inside of Vim
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] }
" on-demand loaded syntax highlighters for many languages
Plug 'sheerun/vim-polyglot'
" fuzzy file find
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
@stdrc
stdrc / commands.md
Last active September 19, 2022 02:46
常用命令

常用小命令

SSH 相关

打开 sock5 代理:

ssh -D 1337 -q -C -N remote-hostname
# -D sock5 代理端口
# -q 不输出任何内容
@nrdmn
nrdmn / vsock-notes.md
Last active March 30, 2026 04:00
vsock notes

vsock notes

about vsocks

Vsocks are a means of providing socket communication (either stream or datagram) directly between VMs and their host operating system. The host and each VM have a 32 bit CID (Context IDentifier) and may connect or bind to a 32 bit port number. Ports < 1024 are privileged ports.

@Einstrasse
Einstrasse / bits-stdc++.h
Created December 3, 2019 14:52
bits/stdc++.h header file
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
@billti
billti / arm64-on-Win10.md
Last active January 1, 2026 03:17
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
@sameo
sameo / vfio.md
Last active October 11, 2025 07:55

VFIO

Not KVM bound. The VFIO API deconstructs a device into regions, irqs, etc. The userspace application (QEMU, cloud-hypervisor, etc..) is responsible for reconstructing it into a device for e.g. a guest VM to consume.

Boot with intel_iommu=on.

IOMMU groups

Devices are bound together for isolation, IOMMU capabilities and platform topology reasons. It is not configurable.

Proxmox GPU Passthrough

Config :

  • Motherboard : ASUS PRIME B450M-A
  • CPU : AMD Ryzen 7 2700x
  • GPU : EVGA AMD RADEON R9 380 Series
  • Ram : DDR4 2133 MHz

Setting it all up

Update packages

@HugoPoi
HugoPoi / Resize virtual machine partition.md
Last active March 8, 2026 15:42
How to resize virtual machine partition after extend the disk

Resize a VM system disk

Introduction

  • You have a VM with small disk
  • You have GPT partition table
  • You NOT USE LVM (you should)
  • You need to extend a partition on the main drive
  • You use Debian 8.x aka Jessie

Extend the disk