Skip to content

Instantly share code, notes, and snippets.

@wankdanker
wankdanker / ksmstat
Created September 9, 2011 18:12
bash script to calculate ksm stats in kb
#!/bin/bash
if [ "$1" != "" ]; then
echo "
----------------------------------------------------------------------------
http://www.kernel.org/doc/Documentation/vm/ksm.txt :
The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/:

Introduction

Sometimes you may want to use a DNS server for specific domain requests and another DNS server for all other requests. This is helpful, for instance, when connected to a VPN. For hosts behind that VPN you want to use the VPN's DNS server but all other hosts you want to use Google's public DNS. This is called "DNS splitting."

Here, we run dnsmasq as a background service on macOS. The dnsmasq configuration described below implements DNS splitting.

Install

brew install dnsmasq
@rkeiii
rkeiii / gist:0fe05fdcee6f520c208280acbf2b49ea
Created September 10, 2022 23:20
Hack fix script for volumes suffering ZFS encryption bug
#!/usr/bin/env bash
#
# This script attempts to recover a ZFS filesystem afflicted by the bug described in
# the following GitHub issues:
#
# * https://github.com/openzfs/zfs/issues/13859
# * https://github.com/openzfs/zfs/issues/13521
# * https://github.com/openzfs/zfs/issues/13709
#