Skip to content

Instantly share code, notes, and snippets.

@ooZberg
ooZberg / work-and-sleep.sh
Created November 12, 2017 18:51
Alternating 100% and 0% CPU load for simulating heavy computer usage
#!/bin/bash
for (( ; ; ))
do
echo "Working"
for i in $(seq 8)
do
shasum /dev/zero &
done
@ooZberg
ooZberg / vm-backup.sh
Last active August 23, 2019 07:41 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1