Skip to content

Instantly share code, notes, and snippets.

@shamil
shamil / mount_qcow2.md
Last active July 18, 2024 15:23
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
@yuanying
yuanying / vagrant-kvm.md
Last active April 17, 2024 08:12
How to use vagrant-kvm

Install Vagrant

sudo su
apt-get update && apt-get install -y libvirt-dev ruby-all-dev apparmor-utils
curl -O -L https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.5_x86_64.deb
dpkg -i vagrant_1.6.5_x86_64.deb 
aa-complain /usr/lib/libvirt/virt-aa-helper # workaround
exit

Install vagrant-kvm as user

# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@jugatsu
jugatsu / ansible-mikrotik-example.yml
Created January 10, 2018 14:13
ansible-mikrotik-example
---
# tasks file for ansible-role-mikrotik-ipsec
- name: Check RouterOS version.
raw: ":local varif [/system package update get installed-version]; :put \"$varif\""
args: { executable: False }
register: installed_version
changed_when: False
- name: Set custom fact for RouterOS version.
@CHERTS
CHERTS / generate-ru-locale-on-debian-linux.sh
Created October 8, 2019 14:33
Add ru_RU.UTF-8 locale on Debian
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
locale-gen ru_RU.UTF-8
dpkg-reconfigure locales
@mewforest
mewforest / Git help.md
Last active March 6, 2024 08:04
Шпаргалка по использованию git

Шпаргалка для работы с git

Проверка установки

git --help
git --version

Начальная настройка

@joseluisq
joseluisq / resize_disk_image.md
Last active July 12, 2024 14:00
How to resize a qcow2 disk image on Linux

How to resize a qcow2 disk image on Linux

This example takes olddisk.qcow2 and resizes it into newdisk.qcow2, extending one of the guest's partitions to fill the extra space.

1. qcow2 format

1.1. Verify the filesystems of olddisk.qcow2

@joeyv120
joeyv120 / qmk_c_json.txt
Created November 30, 2021 20:14
QMK commands for converting between json and c keymap files
qmk json2c2 C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.json
qmk c2json -km joeyv120 -kb keebio/iris/rev4 C:/Users/[USERSAME]/qmk_firmware/keyboards/keebio/iris/keymaps/joeyv120/keymap.c
qmk c2json -km JoeNAO -kb jnao C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.c --no-cpp
@onegreyonewhite
onegreyonewhite / readme.md
Last active April 6, 2024 17:52
Example of script inventory

Example of script inventory

This is an example script for implementing dynamic inventory in Ansible. It could have been written in bash, but python is much easier to read.

How to use

  1. Copy inventory script to any path like $HOME/test_inventroy.py
  2. Make file executable: chmod +x $HOME/test_inventroy.py
  3. Change store to your needs.
#EXTM3U url-tvg="https://iptvx.one/EPG"
#EXTINF:-1 group-title="Общие", Первый канал HD
http://live-okkotv.cdnvideo.ru/okkotv/1tv.smil/tracks-v1a1/mono.m3u8
#EXTINF:-1 group-title="Общие" tvg-id="pervy", Первый канал HD (Для зарубежья)
http://109.200.135.130:8080/ort_hd/index.m3u8
#EXTINF:-1 catchup="append" catchup-days="7" catchup-source="?offset=-${offset}&utcstart=${timestamp}" group-title="Общие" tvg-id="pervy", Первый канал (Архив)
#EXTVLCOPT:http-user-agent=WINK/1.40.1 (AndroidTV/9) HlsWinkPlayer
https://zabava-htlive.cdn.ngenix.net/hls/CH_1TVSD/variant.m3u8
#EXTINF:-1 group-title="Общие", Первый канал +2
http://213.59.128.165:8888/play/Pervij/index.m3u8