Skip to content

Instantly share code, notes, and snippets.

@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
#include <iostream>
#include <fstream>
#include <memory>
#include <string>
#include <algorithm>
void process_crypt_table(unsigned *crypt_table)
{
for (auto i = 0; i < 227; i++)
{
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active November 3, 2024 22:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@Mike15678
Mike15678 / err.md
Last active July 10, 2023 16:30
bfCL OpenCL errors

bfCL OpenCL errors

Name of actual identifier Displayed error Error exit code Suggested troubleshooting steps
CL_OUT_OF_RESOURCES error: out of resources -5 Run bfCL in reduced work size mode (in the future, with an updated script)
CL_PLATFORM_NOT_FOUND_KHR error: platform not found -1001 This error means that no ICD's for any compute device were found. If applicable, disable Nvidia SLI / AMD Crossfire and reboot your computer. If the error persists and you have Windows, update your graphics card drivers since you most likely don't have your graphics card's OpenCL ICD; otherwise if you have Linux, make sure you download a compatible OpenCL ICD for your graphics card through your package manager (OpenCL ICD Loader by itself is not enough!). If the error still persists regardless of your operating system, you most likely don't have have an OpenCL 1.2 compatible graphics card.
N/A no OpenCL capable GPU found -1 (Warning: this ex
@fworks
fworks / install-zsh-windows-git-bash.md
Last active November 8, 2024 05:43
Zsh / Oh-my-zsh on Windows Git Bash
@hakonhagland
hakonhagland / kvm-copy-paste.md
Last active May 25, 2024 16:22
How to make copy&paste work between Ubuntu host and Windows 10 guest for a KVM virtual machine?
@soulmachine
soulmachine / nfs-proxmox.md
Last active November 14, 2024 09:13
Launch a NFS server on Proxmox

Method 1: NFS server on LXC container

Create a priviledged LXC container with:

mount=nfs,nesting=1

apt update

apt install nfs-kernel-server

@b0o
b0o / popup-detect.js
Last active March 21, 2024 01:12
Sway browser pop-up window float hack
// ==UserScript==
// @name Sway Popup Window Detector
// @namespace https://maddison.io/
// @version 0.1
// @description Detect "pop-up" windows because for some reason Wayland doesn't have a built-in way to do it??!
// @author Maddison Hellstrom <github.com/b0o>
// @include /^.*$/
// @grant none
// @run-at document-start
// ==/UserScript==
@notudope
notudope / answerfile
Created August 4, 2021 14:14 — forked from oofnikj/answerfile
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"