Skip to content

Instantly share code, notes, and snippets.

@MauriceBrg
MauriceBrg / Rocket_Chat_Send_Message.ps1
Created January 12, 2018 21:51
PowerShell-Script that sends any text to one or more Rocket.Chat Webhooks. Do with this what you like.
<#
.SYNOPSIS
Sends a message to one or more Rocket.Chat WebHooks.
.DESCRIPTION
This script can be called with parameters in order to send a message to one or more
Rocket.Chat webHooks. The text may contain any supported format keywords you can use
in the GUI.
@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
@baojie
baojie / hello_multiprocessing.py
Created July 21, 2013 07:04
Python multiprocessing hello world. Split a list and process sublists in different jobs
import multiprocessing
# split a list into evenly sized chunks
def chunks(l, n):
return [l[i:i+n] for i in range(0, len(l), n)]
def do_job(job_id, data_slice):
for item in data_slice:
print "job", job_id, item