Skip to content

Instantly share code, notes, and snippets.

Wido den Hollander wido

Block or report user

Report or block wido

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wido
wido / ceph-mon-reinstall.sh
Last active Jul 25, 2019
ceph-mon database re-initialize
View ceph-mon-reinstall.sh
#!/bin/bash
set -e
#
# Re-install and re-initialize ceph-mon database
#
# Useful to go from LevelDB to RocksDB kv_backend
#
# LevelDB was the old backend used up until Jewel and
# newer versions use RocksDB
@wido
wido / qemu-ga.sh
Created Jul 11, 2019
Qemu Guest Agent cheatsheet
View qemu-ga.sh
#!/bin/bash
#
# Talk to a Virtual Machine through the Qemu Guest Agent
#
# See:
# - https://wiki.qemu.org/Features/GuestAgent
# - https://wiki.libvirt.org/page/Qemu_guest_agent
#
# Author: Wido den Hollander <wido@denhollander.io>
#
@wido
wido / create-vxlan-vni.sh
Created May 6, 2019
Create EVPN+VXLAN+BGP VNI on Linux
View create-vxlan-vni.sh
#!/bin/bash
#
# Author: Wido den Hollander <wido@denhollander.io>
#
# Also see: https://vincent.bernat.ch/en/blog/2017-vxlan-bgp-evpn
VNI=100
LOCAL=10.255.255.5
ip link add vxlan${VNI} type vxlan id ${VNI} dstport 4789 local ${LOCAL} nolearning
@wido
wido / mgmt-vrf.sh
Last active Apr 20, 2019
Cumulus Linux Services in Management VRF
View mgmt-vrf.sh
#!/bin/bash
#
# Configure the Management services in Cumulus Linux to only run in the management VRF
#
# Author: Wido den Hollander <wido@denhollander.io>
#
# https://docs.cumulusnetworks.com/display/DOCS/Management+VRF
for SERVICE in ssh ntp snmpd; do
systemctl stop ${SERVICE}.service
View gist:9f136130352b2685c9709bc2d282fc6d
#!/bin/bash
#
# Fetch the amount of shards a Ceph RADOS Gateway bucket has
#
# Author: Wido den Hollander <wido@denhollander.io>
#
BUCKET=$1
ID=$(radosgw-admin bucket stats --bucket=${BUCKET}|jq -r '.id')
@wido
wido / IPv6.java
Created Jan 16, 2019
Check if IPv6 Address is EUI-64 in Java
View IPv6.java
import com.googlecode.ipv6.IPv6Address;
/*
Replace the IPv6 address with anything you like, Link Local or Global, based on the 'ff:fe' in the address
this code will tell you if the address is EUI-64
Author: Wido den Hollander <wido@widodh.nl>
*/
public class IPv6 {
@wido
wido / haproxy.cfg
Created Jan 14, 2019
Ceph Mgr Dash HAProxy configuration
View haproxy.cfg
global
log 127.0.0.1 local1
log 127.0.0.1 local2 notice
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
@wido
wido / radosgw-gc-bucket-indexes.sh
Created Nov 15, 2018
Ceph RADOS Gateway bucket index garbage collection
View radosgw-gc-bucket-indexes.sh
#!/bin/bash
#
# Find orphaned bucket index objects in the RGW bucket index pool
# and clean them up if they do not belong to a bucket
#
# Author: Wido den Hollander <wido@42on.com>
#
INDEX_POOL=$1
@wido
wido / cloudstack-multicast.sh
Created Nov 14, 2018
Calculate CloudStack VXLAN VNI Multicast Group
View cloudstack-multicast.sh
#!/bin/bash
#
# Calculate the IPv4 Multicast Group that Apache CloudStack will use
# for a VNI
#
# Also see modifyvxlan.sh in CloudStack repository
#
# Author: Wido den Hollander <wido@widodh.nl>
#
@wido
wido / ceph-osd-ssd-set-backfills.sh
Created Nov 14, 2018
Ceph tell all SSD OSDs to change max backfills
View ceph-osd-ssd-set-backfills.sh
#!/bin/sh
ceph osd tree|grep osd|grep ssd|awk '{print $1}'|sort -n|xargs -I{} -n 1 ceph tell osd.{} config set osd_max_backfills 3
You can’t perform that action at this time.