Skip to content

Instantly share code, notes, and snippets.

@cccheng
cccheng / prettyping.sh
Last active January 1, 2016 11:59
PrettyPing
#!/bin/bash
#
# Written by Denilson Figueiredo de Sá <denilsonsa@gmail.com>
# MIT license
#
# Requirements:
# * bash (tested on 4.20, should work on older versions too)
# * awk (works with GNU awk, nawk, busybox awk, mawk)
# * ping (from iputils)
#
@cccheng
cccheng / diskchecker.pl
Created September 8, 2022 02:19 — forked from bradfitz/diskchecker.pl
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
qemu-system-x86_64 \
-nographic -enable-kvm -m size=4G \
-cpu host -smp cpus=4,sockets=1,dies=1,cores=4,threads=1 \
-machine type=q35,usb=off,dump-guest-core=off,hpet=off,accel=kvm \
-device virtio-net,netdev=vmnic -netdev bridge,br=virbr0,id=vmnic \
-device virtio-balloon-pci,id=balloon0,bus=pcie.0,addr=0x4 \
-device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0,addr=0x1c \
-object rng-random,id=objrng0,filename=/dev/urandom \
-append "console=ttyS0 root=/dev/vda earlyprintk=serial net.ifnames=0" \
-kernel "$img_kernel" \