Skip to content

Instantly share code, notes, and snippets.

View dselans's full-sized avatar

Daniel Selans dselans

View GitHub Profile
#!/usr/bin/env python
#
# Simple timeshift script
#
import re
import sys
import time
import operator

Keybase proof

I hereby claim:

  • I am dselans on github.
  • I am dselans (https://keybase.io/dselans) on keybase.
  • I have a public key whose fingerprint is C2C7 727C 16CC 3B5D FFB8 E92F 3902 9B2D A5F2 B7A5

To claim this, I am signing this object:

// example reverse proxy
package main
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
)
@dselans
dselans / sometal.py
Created March 7, 2019 20:54
#metal metalinjection rss script
#!/usr/bin/env python
#
import re
import sys
import pickle
import pprint
import feedparser
from slackclient import SlackClient
@dselans
dselans / cassandra-stress.md
Created July 1, 2019 05:04
cassandra-stress notes

I wasn't able to find any concrete examples of folks running cassandra-stress against TLS + auth enabled cassandra clusters; this gist hopefully fulfills that.

Setup

  • 3 node C* setup w/ lucene running on instaclustr
  • TLS Enabled
  • Auth Enabled

Run

@dselans
dselans / bumpme
Last active July 26, 2019 19:43
bumpme
Fri Jul 26 19:43:13 UTC 2019
// Launches 100 goroutines to mass delete keys that match certain criteria.
//
// Current results: ~3,600 keys/s (~193,000 keys/minute)
package main
import (
"fmt"
"os"
"time"
@dselans
dselans / main.go
Created January 20, 2020 04:26
RabbitMQ header exchange publisher and consumer example in Go
// Quick example of using the headers exchange with the streadway/amqp lib.
//
// NOTE: I couldn't find any examples of this anywhere, so maybe this will help
// someone else.
//
// Run consumer in one terminal: $ go run main.go
// Run publisher in another terminal: $ go run main.go -action publisher
//
// The consumer should have received a message.
//
@dselans
dselans / docker-compose.yaml
Created August 12, 2022 19:50
Docker minecraft fabric better minecraft
# Took a good hour+ to get this going as there's a lack of docs on how to do this (and/or I don't know where to look)
#
# Download the better mc server pack zip file from curseforge. Move that to /root/minecraft/ggf-fabric-bmc/pack.
# Reference the zip file in GENERIC_PACK.
# docker-compose up -d and watch the logs. There will be lots of errors due to better mc using ~200 mods but it should start
# nevertheless.
bt-minecraft:
image: itzg/minecraft-server
container_name: ggf-fabric-bmc-fixed
@dselans
dselans / pulsar-notes.md
Last active April 26, 2023 23:01
Notes about Pulsar

I compiled these while learning about running Apache Pulsar. The notes are written from the perspective of a Go developer that interfaces primarily with Kafka, RabbitMQ and NATS. Something may not be entirely correct. Sorry!

  1. Concept of “bundles”
  2. Each broker is in charge of certain bundles
  3. A bundle represents multiple topics
  4. Pulsar has a tunable automatic load shedder
  5. Possible to configure to auto shed bundles to less loaded brokers
  6. Bundles are automatically split when under heavy load
  7. Bundle is split into more bundles