Skip to content

Instantly share code, notes, and snippets.

@ntwk
ntwk / mount_qcow2.md
Created May 4, 2023 13:42 — forked from shamil/mount_qcow2.md
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
@ntwk
ntwk / win_xp_logon_classic_appearance.reg
Created November 11, 2017 21:58
Give Windows XP logon a "classic" theme
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Control Panel\Colors]
"ActiveBorder"="212 208 200"
"ActiveTitle"="10 36 106"
"AppWorkSpace"="128 128 128"
"Background"="48 48 48"
"ButtonAlternateFace"="181 181 181"
"ButtonDkShadow"="64 64 64"
"ButtonFace"="212 208 200"
@ntwk
ntwk / tmux-launch-ugly
Created May 26, 2015 05:17
An uglier, slightly faster version of tmux-launch
#!/bin/sh
#
# tmux-launch-ugly - an uglier, slightly faster version of tmux-launch
# dependencies: tmux, rxvt-unicode, wmctrl
#
# Does not currently support invocation inside a TMUX session.
# The on really notable speed difference relative to tmux-launch is in
# the case that neither a target terminal nor a target session exists.
@ntwk
ntwk / print_rand_filename.sh
Last active August 29, 2015 14:21
Echo the name of a file in current directory, chosen at random
#!/bin/bash
# echo the name of a file in current directory, chosen at random
FILES=$(ls -1)
echo "$FILES" | head -$(( $RANDOM % $(echo "$FILES" | wc -l) + 1 )) | tail -1