Skip to content

Instantly share code, notes, and snippets.

View rogeriojlle's full-sized avatar

Rogerio Machado rogeriojlle

  • Sao Francisco do Sul - SC
View GitHub Profile
@mudge
mudge / eventemitter.js
Last active August 14, 2024 14:25
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@shamil
shamil / mount_qcow2.md
Last active November 16, 2024 09:15
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