View varnish-rgw-auth-pcre.vcl
import std;
#
# When using Varnish in front of Ceph's RADOS Gateway you might want to log the access keys doing a request
# and they are a part of the Authorization HTTP header
#
# Using regsub and PCRE we can fetch just that part from the header and log it to the VCL Log which we can pick up with varnishncsa
#
sub vcl_recv {
View ceph-bluestore-overhead.py
#!/usr/bin/env python
'''
Talk to local Ceph OSDs running with BlueStore and calculate the overhead
per object in the RocksDB database from BlueStore.
Author: Wido den Hollander <wido@42on.com>
'''
import json
from os import listdir
View nanotime.py
# Get the current UNIX Timestamp in nanoseconds
#
# Author: Wido den Hollander <wido@widodh.nl>
import time
now = int(round(time.time() * 1000000000))
print(now)
View cloudstack-build-deb.sh
#!/bin/bash
apt-get update
apt-get install -y python-software-properties software-properties-common
add-apt-repository -y ppa:openjdk-r/ppa
apt-get update
apt-get install -y openjdk-8-jdk openjdk-8-jre wget dpkg-dev devscripts debhelper genisoimage python-mysql.connector maven dh-systemd python-setuptools
View set-ipv6-security-group-rules.py
#!/usr/bin/env python3
import uuid
import mysql.connector
MYSQL_PASS = 'XXXXXXXXX'
cnx = mysql.connector.connect(password=MYSQL_PASS, user='root', database='cloud')
cursor = cnx.cursor()
View crushmap.txt
# begin crush map
tunable choose_local_tries 0
tunable choose_local_fallback_tries 0
tunable choose_total_tries 50
tunable chooseleaf_descend_once 1
tunable chooseleaf_vary_r 1
tunable chooseleaf_stable 1
tunable straw_calc_version 1
tunable allowed_bucket_algs 54
View ceph-bluestore-db-size.sh
#!/bin/bash
# For each running OSD query the BlueStore DB size and entries and calculate avg size per entry
#
# Author: Wido den Hollander <wido@widodh.nl>
#
for OSD_ID in $(find /var/run/ceph -name 'ceph-osd.*.asok' -type s -printf "%f\n"|cut -d '.' -f 2); do
DB_USED_BYTES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluefs.db_used_bytes')
BLUESTORE_ONODES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluestore.bluestore_onodes')
echo "osd.$OSD_ID: db_used_bytes=$DB_USED_BYTES bluestore_onodes=$BLUESTORE_ONODES db_entry_size=$(($DB_USED_BYTES / BLUESTORE_ONODES))"
View ceph-umount-and-wipe.sh
#!/bin/bash
set -e
systemctl stop ceph-osd.target
for ID in $(df -P|grep "/var/lib/ceph/osd"|awk '{print $6}'|cut -d '-' -f 2); do
DEVICE=$(df -P /var/lib/ceph/osd/ceph-$ID|awk '{print $1}'|tail -1|sed 's/.$//'|cut -d '/' -f 3)
ROTATIONAL=$(cat /sys/block/$DEVICE/queue/rotational)
View duply.conf
# Duply configuration I use to backup my ownCloud server to PCextreme's Aurora Mammoth: https://www.pcextreme.com/aurora/mammoth
#
# Uses SSH/SFTP to store data
#
# Yes, I disabled GPG on purpose
#
# File: /root/.duply/owncloud/conf
#
GPG_KEY='disabled'
TARGET='rsync://XXXXXXXX@store01.ams01.auroramammoth.eu/owncloud'
View fizzbuzz.py
#!/usr/bin/env python3
for i in range(1, 100 + 1):
buf = str()
if (i % 3) == 0:
buf += "Fizz"
if (i % 5) == 0:
buf += "Buzz"