Skip to content

Instantly share code, notes, and snippets.

@rgl
rgl / qemu-qmp.md
Last active June 21, 2024 17:45
qemu qmp

QEMU Machine Protocol (QMP) socket

Start QEMU with QMP UNIX socket and connect:

qemu-system-x86_64 -qmp unix:test.socket,server,nowait ...
nc -U test.socket
qmp-shell test.socket    # use the raw qmp interface. see https://github.com/0xef53/qmp-shell
qmp-shell -H test.socket # use the human interface.   see https://github.com/0xef53/qmp-shell
@fnky
fnky / ANSI.md
Last active September 20, 2024 07:57
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active September 19, 2024 18:26
set -e, -u, -o, -x pipefail explanation
@mildred
mildred / README.md
Last active June 20, 2022 13:17
Build a fedora kernel rpm using docker and git checkouted sources instead of a src.rpm

Build a fedora kernel rpm

Rationale:

  • I need a custom kernel (because sound won't work with vanilla)
  • I want to use Fedora Atomic Host
  • The only way to override the kernel with Fedora Atomic Host is to install a kernel package using ostree-rpm
  • I have a metered network connection and want to avoid downloading the kernel sources too many times
  • The powerful machine that can build the kernel is nor running Fedora or Red-hat based system with rpmbuild available
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active August 11, 2024 00:55
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@mcastelino
mcastelino / Simple vsock setup for QEMU.md
Last active September 4, 2024 08:10
using qemu with vsock

Simple vsock setup for QEMU

Configuration

Host Kernel: rawhide 4.13.0-0.rc6.git4.2.fc28.x86_64 (on Fedora 24)

QEMU is mainline built from sources: QEMU emulator version 2.10.50 (v2.10.0-105-g223cd0e)

Guest: clear-17460-kvm.img (which has vsock support)

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active September 17, 2024 22:50
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@blabber
blabber / reduce.g
Created June 13, 2016 21:07
GVPR script to extract subgraphs
BEGIN{
if (ARGC != 2) {
print("This script takes exactly two parameter. 1: name of node, 2: number of hops");
exit(1);
}
void reduce_in(graph_t _g, node_t _n, edge_t _e, int _d){
_e = fstin(_n);
while (_e != NULL) {
clone(_g, _e);
@t-mart
t-mart / netrw quick reference.md
Last active July 31, 2024 09:04
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@jesslilly
jesslilly / README.md
Last active March 22, 2024 14:16
Deluxe Cron Job Wrapper

Cron Job Wrapper Wish List

I want a script that will give me:

  1. Logging
  2. Log purging!
  3. Email errors!
  4. Prevent duplicate processes! (flock)
  5. Source an environment file!
  6. Anything else?