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
#include <iostream> | |
#include <cassert> | |
using RequestHandler = void (*)(void); | |
struct RequestHandlers { | |
static constexpr size_t MAX_REQ_TYPE_CNT = 255; | |
enum EFlags { | |
IsExisting = 0x01, | |
}; |
from PySide2.QtCore import QTimer, QObject, SIGNAL | |
from PySide2.QtGui import QResizeEvent | |
from PySide2.QtWidgets import QApplication, QWidget, QLabel, QMainWindow | |
from PySide2.QtSvg import QSvgWidget | |
import sys | |
class AppWindow(QMainWindow): | |
def __init__(self, parent=None): | |
super(AppWindow, self).__init__(parent) |
sudo apt install autoconf build-essential bison flex git texinfo help2man gawk libtool libncurses5-dev python3-dev python3-distutils | |
git clone http://github.com/crosstool-ng/crosstool-ng | |
cd crosstool-ng | |
./bootstrap | |
./configure --enable-local | |
DEFCONFIG=samples/.../crosstool.config ./ct-ng defconfig | |
./ct-ng build |
import os.path | |
from PyPDF2 import PdfFileReader, PdfFileWriter | |
# chunk_size, path = sys.argv[1], sys.argv[2] | |
chunk_size, path = 50, '/home/serg/print/auto/fluent.pdf' # '/home/serg/Documents/sicp.pdf' | |
pdf = PdfFileReader(str(path)) | |
cnt = pdf.getNumPages() | |
ranges = [range(i, i+chunk_size) for i in range(0, cnt, chunk_size)] |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
void main() { | |
runApp(StartupApplication()); | |
} | |
enum Page { screenDashboard, screenProfile, screenSearch } |
#include <iostream> | |
#include <memory> | |
#include <cxxabi.h> // <-- gcc header | |
template <typename type> std::unique_ptr<const char*> type_name(const type *addr) | |
{ return std::make_unique<const char *>(abi::__cxa_demangle(typeid(*addr).name(), 0, 0, NULL)); } | |
template<typename T> struct MyTest { | |
MyTest(T _data) : data(_data) { } |
#include <iostream> | |
template <typename T> constexpr | |
void print_type() { | |
std::cerr << __PRETTY_FUNCTION__ << std::endl; | |
} | |
enum ETypes { | |
type1, | |
type2 |
#include <stdio.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <fcntl.h> | |
#include <malloc.h> |