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
# Using these pry gems -- copy to your Gemfile | |
# group :development, :test do | |
# gem 'awesome_print' # pretty print ruby objects | |
# gem 'pry' # Console with powerful introspection capabilities | |
# # pick either: | |
# # using byebug, but has issues with Zeitwerk | |
# gem 'pry-byebug' # Integrates pry with byebug | |
# | |
# # using default ruby debuggger | |
# gem 'pry-stack_explorer' |
class Terramate < Formula | |
desc "Tool for managing multiple Terraform stacks" | |
homepage "https://github.com/mineiros-io/terramate" | |
# Disabled. No official release of Terramate yet. | |
# url "" | |
# sha256 "" | |
license "Apache-2.0" | |
head "https://github.com/mineiros-io/terramate.git", branch: "main" | |
# Disabled. No official release of Terramate yet. | |
# livecheck do |
>>> a = 975205316 | |
>>> b = 4096 | |
>>> (a + b) - (a % b) | |
975208448 | |
>>> ((a + b) - (a % b)) + 64 | |
975208512 | |
>>> 975208448 % 4096 | |
0 | |
>>> a + (b - 1) & ~(b - 1) | |
975208448 |
dtparam=i2c=off | |
dtparam=i2s=off | |
dtparam=spi=off | |
dtparam=uart0=off | |
dtparam=uart1=off | |
dtparam=audio=off | |
dtoverlay=disable-wifi |
ARG go_version=1.17 | |
ARG alpine_version=latest | |
FROM golang:${go_version}-alpine AS builder | |
ARG GOOS=linux | |
ARG GOARCH=amd64 | |
ENV GOOS=${GOOS} | |
ENV GOARCH=${GOARCH} |
coherent_pool=1M | |
8250.nr_uarts=1 | |
dwc_otg.fiq_fix_enable=1 | |
dwc_otg.lpm_enable=0 | |
dwc_otg.microframe_schedule=1 | |
dwc_otg.nak_holdoff_enable=1 | |
sdhci-bcm2708.missing_status=0 | |
snd_bcm2835.enable_compat_alsa=0 | |
snd_bcm2835.enable_hdmi=1 | |
bcm2708_fb.fbwidth=0 |
server_names = [ | |
'cloudflare', | |
'doh-crypto-sx', | |
'ams-doh-nl', | |
# Possible issues. | |
# 'faelix-ch-ipv4-doh', | |
'doh.ffmuc.net' | |
] | |
listen_addresses = [ |
#!/bin/bash | |
flag_iptables=true | |
flag_dry_run=true | |
while getopts ":nf" arg; do | |
case $arg in | |
n) # Dry-run - does not preserve iptables rules. | |
flag_dry_run=false | |
;; |