Skip to content

Instantly share code, notes, and snippets.

View sio's full-sized avatar

Vitaly Potyarkin sio

View GitHub Profile
@shamil
shamil / mount_qcow2.md
Last active May 10, 2024 21:37
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@sio
sio / minttycolor.py
Last active May 8, 2024 13:17
Helper functions for creating Mintty color scheme with Python
"""
Manipulate color schemes for mintty
For simplicity, support only "value = r, g, b" format with decimal values
Copyright 2017 Vitaly Potyarkin
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
@m13253
m13253 / init.sh
Last active February 19, 2024 11:31
Minimal working initramfs for BusyBox, with login
#!/bin/busybox sh
# 1) Download a prebuilt BusyBox binary here:
# https://busybox.net/downloads/binaries/
#
# 2) Prepare your kernel
# cp /boot/vmlinuz vmlinuz
#
# 3) Copy the files
# install -Dm0755 busybox-x86_64 initramfs/bin/busybox
@wolfv
wolfv / fetch.sh
Created September 8, 2021 13:08
Fetch from OCI registry (ghcr.io)
export TOKEN=$(curl --silent https://ghcr.io/token\?scope\=repository:wolfv/artifact:pull | jq -r .token)
curl \
--silent \
--request 'GET' \
--header "Authorization: Bearer $TOKEN" \
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
'https://ghcr.io/v2/wolfv/artifact/manifests/1.0'
echo "\n\nFetching image content now:\n\n"