Skip to content

Instantly share code, notes, and snippets.

View tristone13th's full-sized avatar
🎯
Focusing

Leinux tristone13th

🎯
Focusing
  • Shanghai
View GitHub Profile
@JonathonReinhart
JonathonReinhart / kvm_emulate.md
Created July 27, 2022 04:14
KVM Emulate Flowchart

When does Linux KVM emulate instructions?

Flow Chart

graph LR

x86_emulate_instruction --> x86_emulate_insn
emulate_instruction --> x86_emulate_instruction
@nrdmn
nrdmn / vsock-notes.md
Last active April 26, 2024 14:51
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.

@RRethy
RRethy / gist:ad8a9a3b1112a48226ec3336fa981224
Last active May 19, 2024 10:48
Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Neovim and Vim both come bundled with a standard plugin called Netrw. Netrw acts a file explorer (similar to NERDTree), but more importantly has the ability to work with scp (as well as sftp, rcp, ftp, and lots of others :h netrw-nread) to let you edit files and browse directories that are hosted on a remote machine, inside of your local Vim instance.

This is useful since you are able to use your Vim setup and plugins without copying over your dotfiles to the remote machine. As well, since the file is copied to your local machine, there will be no delay when typing.

Setup

This is optional for Vim, but required for Neovim (check this Neovim issue explaining why).

@elmarco
elmarco / .clang-format
Created August 29, 2017 15:51
qemu .clang-format
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
@mishurov
mishurov / syntax.s
Last active May 14, 2024 15:26
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code