Skip to content

Instantly share code, notes, and snippets.

View midi1996's full-sized avatar

Midi midi1996

View GitHub Profile
@shamil
shamil / mount_qcow2.md
Last active June 5, 2026 10:42
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
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@KarthikNayak
KarthikNayak / a.md
Last active February 2, 2025 08:22
Installing Arch with LVM
@StefanoBelli
StefanoBelli / disable_gpe6F.service
Last active May 6, 2026 03:50
Temporary fix for ACPI (GPE iinterrupts) failure , disable GPE6f interrupts, probably motherboard faulty ACPI implementation (reflash/update BIOS) [[!!You should take action!!]]. Install this in /usr/lib/systemd/system and run systemctl enable disable_gpe6F
[Unit]
Description=Disable GPE6F interrupts
[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo disable > /sys/firmware/acpi/interrupts/gpe6F"
[Install]
WantedBy=multi-user.target
@varhub
varhub / Android - Enable ADB from recovery.md
Created December 23, 2016 17:54
Android - Enable ADB from recovery

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

DefinitionBlock ("", "SSDT", 1, "APPLE ", "Debug", 0x00001000)
{
/*
* Many OEM ACPI implementations have a ADBG function which is used for
* debug logging. In almost all cases, this function calls MDBG, which is
* supposed to be defined in a ACPI debug SSDT (but is usually missing).
* This should make ADBG functional.
*/
Method (MDBG, 1, NotSerialized)
{
@mcastelino
mcastelino / VFIO_nested.md
Last active June 18, 2024 22:25
QEMU VFIO in Nested VM vIOMMU

How to use VFIO to assign a device to nested VM

  • Here the vfio-pci device is passed in into the L1 VM
  • The L1 VM is setup with kernel_irqchip=split
  • The L0 exposes a virtual IOMMU to the L1 VM
qemu-system-x86_64 \
    -machine q35,accel=kvm,kernel_irqchip=split \
    -enable-kvm \
@Kautenja
Kautenja / tar-progress.md
Last active December 29, 2025 14:51
one-liners for using tar with gzip and pv for a progress bar

Compress

tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>

where:

  • `` is the root-mounted (i.e. starts with /) path to the files
@pjobson
pjobson / openwrt-on-x86_64.md
Last active May 26, 2026 15:53
OpenWRT on x86_64

OpenWRT on x86_64

This is a very brief tutorial on getting OpenWRT installed on a regular computer, it assumes you know your way around Linux. If you find this and need additional details, please like, subscribe, and comm... oh wait this isn't youtube, just comment.

Updated: Current version is 22.03.5, this was originally written for 18.6.x in 2019.

What You'll Need

  • 1 USB Stick
  • Linux Live ISO
@lac5
lac5 / youtube-anti-anti-afk.meta.js
Last active June 17, 2024 15:04
Stops YouTube from automatically pausing the video.
// ==UserScript==
// @name YouTube - Anti-Anti-AFK
// @namespace larryc5
// @version 1.0
// @description Stops YouTube from automatically pausing the video.
// @author Larry Costigan
// @include /^https?:\/\/(?:[^\/?#]*\.)?youtube.com\/.*$/
// @downloadURL https://gist.githubusercontent.com/larryc5/95c3ae2abbd37b35e2a35ac2c49d9996/raw/youtube-anti-anti-afk.user.js
// @updateURL https://gist.githubusercontent.com/larryc5/95c3ae2abbd37b35e2a35ac2c49d9996/raw/youtube-anti-anti-afk.meta.js
// ==/UserScript==