This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 <[email protected]> | |
''' | |
import json | |
from os import listdir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the current UNIX Timestamp in nanoseconds | |
# | |
# Author: Wido den Hollander <[email protected]> | |
import time | |
now = int(round(time.time() * 1000000000)) | |
print(now) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For each running OSD query the BlueStore DB size and entries and calculate avg size per entry | |
# | |
# Author: Wido den Hollander <[email protected]> | |
# | |
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))" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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://[email protected]/owncloud' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |