Skip to content

Instantly share code, notes, and snippets.

View burmanm's full-sized avatar

Michael Burman burmanm

  • DataStax
  • Finland
View GitHub Profile
@burmanm
burmanm / nginx-ingress.yaml
Created December 10, 2020 12:08
nginx-reaper-ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- http:
@burmanm
burmanm / X.sh
Created October 24, 2018 12:13
X.sh
# Use cvt <vertical> <horizontal> <refresh-rate> to create, ex. cvt 2560 1440 90
#xrandr --newmode "2560x1440_60.00" 311.83 2560 2744 3024 3488 1440 1441 1444 1490 -HSync +Vsync
#xrandr --addmode Virtual1 2560x1440_60.00
xrandr --newmode "2560x1440_144.00" 808.75 2560 2792 3072 3584 1440 1443 1448 1568 -hsync +vsync
xrandr --addmode Virtual1 2560x1440_144.00
#xrandr --newmode "2560x1440_90.00" 483.00 2560 2768 3048 3536 1440 1443 1448 1519 -hsync +vsync
#xrandr --addmode Virtual1 2560x1440_90.00
@burmanm
burmanm / BSTBench.java
Last active July 5, 2018 20:34
Bench for CASSANDRA-7282
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@burmanm
burmanm / read_write_test.go
Last active July 4, 2018 12:49
Test badger storage reload
func TestPersist(t *testing.T) {
dir, err := ioutil.TempDir("", "badgerTest")
assert.NoError(t, err)
p := func(t *testing.T, dir string, test func(t *testing.T, sw spanstore.Writer, sr spanstore.Reader)) {
f := NewFactory()
opts := NewOptions("badger")
v, command := config.Viperize(opts.AddFlags)
keyParam := fmt.Sprintf("--badger.directory-key=%s", dir)
@burmanm
burmanm / ZipfDistribution.java
Created June 13, 2018 12:52
Faster ZipfDistribution
static class ZipfDistribution
{
private ThreadLocalRandom random;
private double alpha;
private int elements;
private double constant;
private double[] sumsOfProbabilities;
public ZipfDistribution(double alpha, int elements)
@burmanm
burmanm / flame.sh
Created May 8, 2018 06:43
JMH Cassandra async-profiler script
#!/bin/sh
PARANOID=$(cat /proc/sys/kernel/perf_event_paranoid)
RESTRICT=$(cat /proc/sys/kernel/kptr_restrict)
if [ $PARANOID -gt 1 ]
then
echo "ERROR: echo 1 > /proc/sys/kernel/perf_event_paranoid"
exit -1
fi
@burmanm
burmanm / ColumnFamilyStoreUpdateBench.java
Created February 22, 2018 13:36
Measure Cassandra Memtable overhead
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@burmanm
burmanm / ByteBufOutput.java
Created July 11, 2017 15:50
Example Netty BitOutput with long words
/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@burmanm
burmanm / read.py
Last active October 31, 2016 14:51
Read Windows Performance Monitor CSV files and push them to Hawkular-Metrics
import re
import csv
import codecs
import time
from hawkular import metrics, HawkularMetricsClient
class PerfmonCSVParser:
def __init__(self):
self.c = HawkularMetricsClient(tenant_id='perfmon')