Skip to content

Instantly share code, notes, and snippets.


Ducas Francis ducas

  • Readify
  • Sydney, Australia
View GitHub Profile
ducas / curl-check.yaml
Created Jun 7, 2019
DaemonSet that queries a web endpoint and prints out timing used for determining where latency may be introduced
View curl-check.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
name: curl-check
app: curl-check
ducas /
Created Jan 8, 2019
Upgrade single-node Rancher with data volume
now=`date +%Y%m%d-%H%M%S`
echo "Stop $2 ($1)"
docker stop $1
echo "Create new volume"
ducas / purge.json
Last active Jun 12, 2018
Purge an Azure resource group
View purge.json
"$schema": "",
"contentVersion": "",
"parameters": { },
"variables": { },
"resources": [ ],
"outputs": { }
ducas / Setup-VstsAgent.ps1
Last active May 23, 2017
Setting up a VS2017 Build Agent
View Setup-VstsAgent.ps1
$agentUrl = ''
$vstsUrl = '' # TODO: Set URL - e.g.
$pat = '' # TODO: set PAT generated using these instructions -
$pool = 'default'
iwr -UseBasicParsing | iex
# change this or add more steps below to install any other prerequisites
choco install -y `
visualstudio2017community `
ducas / increase-replication-factor.js
Last active Oct 14, 2020
Increase Replication Factor for Kafka Topics
View increase-replication-factor.js
* This script reads the existing partition assignments in JSON (exported using and generates
* the appropriate reassignment JSON file for input to
var usage = `
Usage: node increase-replication-factory.js (brokers) (replication factor) (current assignment file) (output file) [-f]
* brokers: comma separated list of brokers
* replication factor: the new replication factor to use
ducas / kafka-run-class.bat
Created Apr 6, 2016
A working version of kafka-run-class.bat for confluent-1.0.1
View kafka-run-class.bat
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
ducas / Vagrantfile
Last active Feb 5, 2016
Vagrant machine for Confluent 2.0
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config| = "ubuntu/trusty64" "private_network", ip: ""
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
ducas / Get-References.ps1
Created May 12, 2015
Find project references and determine whether they're local or GAC
View Get-References.ps1
ls -Recurse -Filter *.csproj | %{
$filename = $_.FullName
$ns = @{ msbuild = "" }
#[xml]$proj = Get-Content $filename
$proj = Get-Content $filename | Out-String
Select-Xml -Xml $proj -XPath "//msbuild:Reference" -Namespace $ns | %{
$item = $_.Node.Include
$hintPath = $_.Node.HintPath
$isGac = $hintPath -eq $null
ducas / Configure-UrlRewriteRules.ps1
Last active Jan 10, 2021
Common configuration for IIS sites behind a load balancer to propagate HTTPS flag and avoid ports in generated URLs
View Configure-UrlRewriteRules.ps1
$SiteName = "Default Web Site"
Import-Module WebAdministration
Write-Host "Getting allowed server variables..."
$allowedServerVariables = Get-WebConfigurationProperty -PSPath "MACHINE/WEBROOT/APPHOST" -filter "system.webServer/rewrite/allowedServerVariables/add" -Name name
Write-Host "Found $($allowedServerVariables.Length)..."
if ( ($allowedServerVariables -eq $null) -or ( $allowedServerVariables | ?{ $_.Value -eq "HTTPS" } ).Length -eq 0 ) {
#Configure IIS To Allow 'HTTPS' as a server variable - Must be done at a applicationhosts.config level
ducas / Set-TcpDefaults.ps1
Last active Aug 29, 2015
Set TCP properties in the Windows registry to avoid ephemeral port exhaustion
View Set-TcpDefaults.ps1
param (
[switch]$Fix = $false
function Set-RegistryProperty ($name, $value) {
$changed = $false