Skip to content

Instantly share code, notes, and snippets.

View raphaelpereira's full-sized avatar

Raphael Derosso Pereira raphaelpereira

View GitHub Profile
@KrustyHack
KrustyHack / doc.adoc
Last active April 6, 2024 00:19
proxmox-ubuntu-cloud-howto

Cloud-Init Support

Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network

@Vaiz
Vaiz / QBuildDateTime.cpp
Last active September 17, 2021 05:06
Build time in QDateTime
QDateTime buildDateTime()
{
QDateTime dateTime;
dateTime.setDate(QLocale("en_US").toDate(QString(__DATE__).simplified(), "MMM d yyyy"));
dateTime.setTime(QTime::fromString(__TIME__, "hh:mm:ss"));
return dateTime;
}
@cabal95
cabal95 / vm-backup.sh
Created July 25, 2015 17:53
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
@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach