Skip to content

Instantly share code, notes, and snippets.

View ILMostro's full-sized avatar
🎯
Focusing

ILMostro ILMostro

🎯
Focusing
View GitHub Profile
@ILMostro
ILMostro / mount_qcow2.md
Created April 16, 2022 21:36 — forked from shamil/mount_qcow2.md
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
ILMostro / collect-sysinfo.py
Created April 12, 2022 13:38 — forked from emrekgn/collect-sysinfo.py
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
ILMostro / dropdown.md
Created December 16, 2019 09:12 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@ILMostro
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
ILMostro / get_oracle_jdk_linux_x64.sh
Created April 25, 2017 21:11 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <ext> <jdk_version>
# ext: rpm
# jdk_version: default 8
ext=rpm
jdk_version=8
@ILMostro
ILMostro / example-subtree-usage.md
Created April 1, 2017 21:08 — forked from kvnsmth/example-subtree-usage.md
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 git@github.com:AFNetworking/AFNetworking.git Vendor/AFNetworking

or something to that effect.

@ILMostro
ILMostro / guide.md
Created March 24, 2017 16:11 — forked from mikkeloscar/guide.md
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
ILMostro / patch_kernel.sh
Created August 24, 2016 04:50
Patch & Install OpenVZ Kernel & Setup IPTables Rules
#!/bin/bash
el_version="6"
kernel_major="2.6.32"
kernel_minor="279.5.1"
vz_major="042stab061"
vz_minor=".2"
echo "Fetching OpenVZ Repo..."
cd /etc/yum.repos.d
@ILMostro
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
https://getfedora.org/keys/obsolete.html
rpm --import /tmp/Release.key
or
rpm --import https://getfedora.org/static/FB4B18E6.txt
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