Skip to content

Instantly share code, notes, and snippets.

View ILMostro's full-sized avatar

Amel Hodzic ILMostro

View GitHub Profile
ILMostro /
Created April 16, 2022 21:36 — forked from shamil/
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
ILMostro /
Created April 12, 2022 13:38 — forked from emrekgn/
Collect system information (BIOS, CPU, GPU, installed packages, motherboard and more) in a cross-platform manner!
#!/usr/bin/env python
Print (and write to JSON file) system information in a cross-platform manner.
Output contains information about platform, BIOS, CPU, memory, disk, GPU, network, peripheral devices, installed
packages, motherboard and users.
This script heavily relies on psutil and some other bash/powershell commands. See requirements.txt for dependency list.
ILMostro /
Created December 16, 2019 09:12 — forked from citrusui/
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<summary>How do I dropdown?</summary>
This is how you dropdown.
ILMostro / lxc-arch2
Last active February 11, 2018 22:46 — forked from lilydjwg/lxc-arch2
lxc-arch2: a script to create a copy of my Arch Linux system in LXC for testing
#!/bin/zsh -e
cd ~/tmpfs
mkdir -p .lxc-root .lxc-data/etc .lxc-data/home/lilydjwg/{.vim,.cache} .lxc-work
sudo GDK_DPI_SCALE=$GDK_DPI_SCALE zsh -e - <<'EOF'
modprobe overlay
mountpoint .lxc-root || mount -t overlay -o lowerdir=/,upperdir=$PWD/.lxc-data,workdir=$PWD/.lxc-root overlayfs $PWD/.lxc-root
# .lxc-root/etc/resolv.conf is protected
ILMostro /
Created April 25, 2017 21:11 — forked from n0ts/
Get latest Oracle JDK package bash shell script
# You must accept the Oracle Binary Code License
# usage: <ext> <jdk_version>
# ext: rpm
# jdk_version: default 8
ILMostro /
Created April 1, 2017 21:08 — forked from kvnsmth/
A real world usage for git subtrees.

Let's say you have an iOS project, and you want to use some external library, like AFNetworking. How do you integrate it?

With submodules

Add the project to your repo:

git submodule add Vendor/AFNetworking

or something to that effect.

ILMostro /
Created March 24, 2017 16:11 — forked from mikkeloscar/
Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Simple way to setup an arm chroot for building packages for your arm devices. This is an alternative to cross-compiling where you are limited to only linking against the libs in your toolchain.

Setup chroot-fs

You can store the chroot wherever you like. I choose to store it in a disk-image which I mount to my filesystem.

ILMostro /
Created August 24, 2016 04:50
Patch & Install OpenVZ Kernel & Setup IPTables Rules
echo "Fetching OpenVZ Repo..."
cd /etc/yum.repos.d
ILMostro / Install Awesome in Centos 7 Guide
Last active March 31, 2020 13:55 — forked from melvincabatuan/Install Awesome in Centos 7 Guide
Install Awesome in Centos 7 Guide
Get the Release.key
rpm --import /tmp/Release.key
rpm --import
Enable the Fedora19 repo (NOTE: obsolete/archived)
vi /etc/yum.repos.d/f19.repo

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For