Skip to content

Instantly share code, notes, and snippets.

@grahameger
grahameger / lads.c
Last active May 12, 2025 08:47
lsds.c – list block devices and selected metadata. C rewrite based on the Python utility by Tanel Poder <https://0x.tools>, 2025.
// SPDX-License-Identifier: GPL-2.0-or-later
// lsds.c – list block devices and selected metadata (C rewrite) with JSON output option
// Originally based on the Python utility by Tanel Poder <https://0x.tools>, 2025.
//
// Build: cc -Wall -Wextra -pedantic -std=c17 -D_POSIX_C_SOURCE=200809L -o lsds lsds.c
// Usage: ./lsds [-v] [-p] [-c COL1 COL2 …] [-a COL1,COL2,…] [-l]
// [-r] [-j]
// See --help for details.
//
// -------------------------------------------------------------
@limepanda
limepanda / kvm-migration.txt
Last active March 11, 2025 02:30
migrate qcow2 image to zfs volume
qemu-img convert -O raw <infile.(vdi|vmdk|$whatever)> /dev/zvol/rpool/data/<vmid>-disk0
@0xjac
0xjac / private_fork.md
Last active May 17, 2025 14:48
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@thbar
thbar / deploy.rb
Created September 7, 2010 18:18
Resque + god + capistrano recipe
# note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup
desc "Hot-reload God configuration for the Resque worker"
deploy.task :reload_god_config do
sudo "god stop resque"
sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}"
sudo "god start resque"
end
after 'deploy:update_code', 'deploy:update_shared_symlinks'