Skip to content

Instantly share code, notes, and snippets.

View wido's full-sized avatar

Wido den Hollander wido

View GitHub Profile
@wido
wido / nginx-radosgw.conf
Created August 26, 2015 09:42
Nginx proxy for Ceph RADOS Gateway with Civetweb
server {
listen 80;
listen [::]:80;
server_name localhost;
client_max_body_size 0;
proxy_buffering off;
proxy_set_header Host $host;
@wido
wido / ceph-mirror.vcl
Last active September 22, 2015 10:36
Varnish VCL EU Ceph mirror
vcl 4.0;
import std;
backend download {
.host = "download.ceph.com";
.port = "80";
.connect_timeout = 5s;
.first_byte_timeout = 5s;
.probe = {
@wido
wido / GuestAgent.java
Last active November 9, 2015 12:45
libvirt-java Qemu Guest Agent
import org.libvirt.Connect;
import org.libvirt.Domain;
import org.libvirt.LibvirtException;
public class GuestAgent {
public static void main(String argv[]) {
Connect conn = null;
try {
conn = new Connect("qemu+tcp://[::1]/system");
Domain testDomain = conn.domainLookupByName("guest-agent");
@wido
wido / ceph-health.py
Last active June 16, 2020 07:42
Ceph Health in Python in a loop
#!/usr/bin/env python
import time
import rados
import json
def get_cluster_health(r):
cmd = {"prefix":"status", "format":"json"}
ret, buf, errs = r.mon_command(json.dumps(cmd), b'', timeout=5)
result = json.loads(buf)
@wido
wido / salt-unbound-dns.py
Created November 25, 2015 08:01
Use Local Salt client to populate DNS
#!/usr/bin/env python
"""
Fetch all IPv6 addresses of Minions and generate local
unbound data based on the output
"""
import json
import salt.client
import salt.output.json_out
local = salt.client.LocalClient()
@wido
wido / libvirt-network-filter.xml
Created January 6, 2016 15:03
Simple Network Filter for libvirt
<filter name='network_filter_1' chain='ipv4' priority='-700'>
<uuid>64b80046-9a9d-40c2-8782-ed5878146262</uuid>
<rule action='drop' direction='out' priority='500'>
<mac match='no' srcmacaddr='52:54:00:01:ad:9d'/>
</rule>
<rule action='return' direction='out' priority='500'>
<ip srcipaddr='192.168.100.101'/>
</rule>
@wido
wido / keybase.md
Created February 5, 2016 12:04
keybase.md

Keybase proof

I hereby claim:

  • I am wido on github.
  • I am widodh (https://keybase.io/widodh) on keybase.
  • I have a public key whose fingerprint is 3E6B 72CD D59B 1182 20C1 83F7 7DC6 F238 3B4C EEDA

To claim this, I am signing this object:

@wido
wido / kea.json
Last active February 5, 2016 16:05
ISC Kea DHCPv6 server
{
"Dhcp6": {
"renew-timer": 1000,
"rebind-timer": 2000,
"preferred-lifetime": 3000,
"valid-lifetime": 4000,
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/tmp/kea-leases6.csv",
@wido
wido / docker-ipv6
Last active March 10, 2016 11:39
Docker DHCPv6 Prefix Degelation hook
#!/bin/bash
#
# DHCPv6 hook for Docker
#
# This hook will configure Docker to use the first /80 IPv6 subnet
# from the Prefix we got through DHCPv6 Prefix Delegation
#
# A /80 subnet is large enough for Docker. 80 + 48 bits (MAC) equals 128-bits.
#
# dhclient will run this hook after it obtains the lease
@wido
wido / zabbix-ceph-mon.py
Created March 22, 2016 09:34
Zabbix Ceph Monitor Cron
#!/usr/bin/env python
'''
Script to send Zabbix Agent active data to the Zabbix Server.
It runs the ceph command locally to get information from the running
OSDs and send the aggegrated data back to Zabbix.
'''
import sys
import subprocess