Skip to content

Instantly share code, notes, and snippets.

@holser
holser / galera-test.sh
Last active December 13, 2016 15:25
Test galera for ccp
#!/bin/bash
TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"`
#trap "cleanup; exit 1" 2
function prepare_topology() {
cat <<EOF > ~/.ccp.yaml
builder:
push: True
no_cache: true
#!/bin/bash
FORMULA=$1
if [ "$FORMULA" != "" ]; then
rsync -rv --rsync-path "sudo rsync" ~/Work/salt-formula-${FORMULA}/ 172.16.10.100:/root/salt-formula-${FORMULA}/
fi
rsync -rv --rsync-path "sudo rsync" ~/Work/test-salt-formula.sh 172.16.10.100:/root/test-salt-formula.sh
@holser
holser / fanotify-example.c
Created January 8, 2018 14:22 — forked from jaypeche/fanotify-example.c
fanotify example
/*
* File: fanotify-example.c
* Date: Fri Nov 15 14:55:49 2013
* Author: Aleksander Morgado <aleksander@lanedo.com>
*
* A simple tester of fanotify in the Linux kernel.
*
* This program is released in the Public Domain.
*
* Compile with:
@holser
holser / .virsh_env
Last active September 5, 2018 07:06
Basic wrappers for virsh
#!/usr/bin/env bash
#
# Basic wrappers for virsh
#######################################
# Creates snapshots of running domains
#
# Globals:
# LL
# Arguments:
-- Install SpoonInstall spoon first
hs.alert.show("hammerspoon is initialized")
local hyper = {'ctrl', 'alt', 'cmd'}
local hyperShift = {'ctrl', 'alt', 'cmd', 'shift'}
-- Install spoons
hs.loadSpoon("SpoonInstall")
spoon.use_syncinstall = true
spoon.SpoonInstall:andUse("ReloadConfiguration")
@holser
holser / mount_qcow2.md
Created July 15, 2020 22:22 — 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