Skip to content

Instantly share code, notes, and snippets.

View FlorianHeigl's full-sized avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@stfp
stfp / install-image-in-lvm.py
Created January 8, 2011 11:27
installs an open nebula image from the repository to a new lvm volume in each host
#!/usr/bin/python
import os, sys
import logging
import hashlib
from xmlrpclib import ServerProxy
import xml2obj
ONE_SERVER="http://localhost:2633/RPC2"
ONE_USER="oneadmin"
@fnichol
fnichol / README.md
Created March 30, 2011 21:17
Chef Bootstrapper For SuSE/SLES

Chef Bootstrapper For SuSE/SLES

Installation

Note: Run this script as the root user (no sudo calls are used in the script).

You will need the curl package installed, though I would have no idea why it wouldn't be installed by default:

zypper --non-interactive install curl

@whatvn
whatvn / mfsmonitor.py
Created February 14, 2012 03:17
Nagios script for Moosefs monitoring
#!/usr/bin/env python
# Nagios monitoring script for moosefs master server
# Based on mfscgiserv from moosefs author
# hungnv 13022012
import socket
import struct
import sys
@jacobsandlund
jacobsandlund / split_opts.sh
Created March 27, 2012 23:17
Split combined short shell options
#!/bin/sh
# This shows how to handle combined short options along with
# other long and short options. It does so by splitting them
# apart (e.g. 'tar -xvzf ...' -> 'tar -x -v -z -f ...')
while test $# -gt 0
do
case $1 in
@despens
despens / geo-torrent-checksums.pl
Created April 2, 2012 12:50
Automatic completion of geocities.archiveteam.torrent
#!/usr/bin/perl
our $VERSION = 1.00;
=pod
This script compares checksums of local files belonging to the Archive Team's
Geocities Torrent with checksums published on archive.org. It can generate
shell scripts that complete an aborted torrent download by getting
missing/broken parts from archive.org
@mat813
mat813 / fb-update.vcl
Last active March 23, 2017 15:35
Varnish configuration for freebsd-update proxy
vcl 4.0;
import std;
import directors;
import saintmode;
# dig +noall +answer +short srv _http._tcp.update.freebsd.org | sort -k 2,2nr | while read priority weight port target; do printf "backend %s {\n\t.host = \"%s\";\n\t.port = \"80\";\n}\n" ${target//.*} $target; done
backend update5 {
.host = "update5.freebsd.org.";
.port = "80";
}
backend update6 {
@feist
feist / gist:2697640
Created May 14, 2012 21:58
Sample PCS configuration session
Run the following commands on all three nodes in the cluster (nodes are named f1, f2 and f3). This will create the corosync.conf files for the cluster.
[root@f1 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3
[root@f2 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3
[root@f3 pcs]# ./pcs cluster configure my_cluster_name f1 f2 f3
Then run the following command on all three nodes in the cluster, to start corosync and pacemaker.
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@geraldh
geraldh / blocksync.py
Created August 8, 2012 16:47 — forked from rcoup/blocksync.py
Block device sync between remote hosts. Based off http://www.bouncybouncy.net/programs/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started:
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'