Skip to content

Instantly share code, notes, and snippets.

@alismx
alismx / qemu-img.md
Created February 20, 2026 19:40 — forked from startergo/qemu-img.md
How to: Use qemu-img command to convert between vmdk, raw, qcow2, vdi, vhd, vhdx formats/disk images (qemu-img create, snapshot, resize etc.)
  • First we need to have qemu installed on the system, for most of Linux systems, we can install “qemu-utils” for Windows we can download QEMU disk image utility from here

  • Other related questions

How to open raw disk from VMware
How to open qcow2 disk from VMware
How to open vdi disk from VMware
How to open raw disk from Hyper-V
How to open qcow2 disk from Hyper-V
How to open vdi disk from Hyper-V
@alismx
alismx / ARMonQEMUforDebianUbuntu.md
Created March 8, 2025 18:07 — forked from luk6xff/ARMonQEMUforDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@alismx
alismx / preseed.cfg
Created March 6, 2025 18:01 — forked from olivierlambert/preseed.cfg
Debian 12 preseed file
# Locale Setup
d-i debian-installer/language string en
d-i debian-installer/country string US
d-i debian-installer/locale string en_US.UTF-8
# Keyboard Setup
d-i keyboard-configuration/xkb-keymap select us
# Clock Setup
d-i time/zone string US/Eastern
#!/bin/bash
# Install Docker
echo "post-install"
apt-get update
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
### Keybase proof
I hereby claim:
* I am alismx on github.
* I am alismxwll (https://keybase.io/alismxwll) on keybase.
* I have a public key ASBsdpZnOphGCBP595QPS3T1B-jLjyhaSPVTkxeS6dPZFAo
To claim this, I am signing this object:
@alismx
alismx / markdown.md
Last active June 13, 2023 17:10
Hidden content in markdown

Demo

Hidden Content

My hidden text

```bash
echo "code block"
@alismx
alismx / lock.sh
Created April 8, 2023 20:14
This creates a lock based on the existence of a file
#!/bin/bash
LOCK_FILE="/var/lock/s3cmd.lock"
# Check if another instance is already running
if [[ -e $LOCK_FILE ]]; then
echo "Another instance of the script is already running. Exiting..."
exit 1
else
touch $LOCK_FILE
@alismx
alismx / s3cmd_sync.sh
Last active April 8, 2023 20:08
This is a script to sync to s3 compatible tools (AWS S3, Digital Ocean Spaces)
# Add these variables to your environment or define them in the script
# export BUCKET_URL=s3://your-bucket-name/path-to-files/
# export LOCAL_DIR=/path/to/local/dir/
#!/bin/bash
function file_sync() {
local operation=$1
local source=$2
local destination=$3
@alismx
alismx / python_fake_data.py
Last active April 7, 2023 20:29
Python script to generate fake data
# `pip install faker`
# OR
# specify fake in your requirements.txt file
# then run `pip install -r requirements.txt`
#!/usr/bin/python3
from faker import Faker
import csv
fake = Faker()
@alismx
alismx / gradle_liquibase_actions.sh
Last active April 7, 2023 20:33
Script to handle some liquibase commands related to checksums and rollbacks
#!/bin/bash
# Pick and set one of these environmet variables
tag="$LIQUIBASE_ROLLBACK_TAG"
count="$LIQUIBASE_ROLLBACK_COUNT"
clear="$LIQUIBASE_CLEAR_CHECKSUMS"
if [ "${clear}" = "true" ]; then
echo "Clearing checksums..."
gradle liquibaseClearCheckSums