Skip to content

Instantly share code, notes, and snippets.

View lockness-Ko's full-sized avatar
🕵️‍♂️
skill issue

Lockness lockness-Ko

🕵️‍♂️
skill issue
View GitHub Profile
@shamil
shamil / mount_qcow2.md
Last active November 14, 2024 09:14
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
@kevincennis
kevincennis / markov.js
Last active April 7, 2023 17:44
Quick and dirty Markov chain text generator
// basic usage: new Markov(lotsOfText).generate()
// markov chain constructor
//
// @string input {example text}
// @integer len {optional # of words to output}
// @integer stateSize {optional chain order}
function Markov( input, len, stateSize ){
this.cache = Object.create(null)
this.words = input.split(/\s/)