Skip to content

Instantly share code, notes, and snippets.

@dragomirr
dragomirr / increase-replication-factor.js
Created October 14, 2020 13:47 — forked from ducas/increase-replication-factor.js
Increase Replication Factor for Kafka Topics
/*
* This script reads the existing partition assignments in JSON (exported using kafka-reassign-partitions.sh) and generates
* the appropriate reassignment JSON file for input to kafka-reassign-partitions.sh.
*
*/
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
@dragomirr
dragomirr / cli.md
Created September 17, 2019 14:27 — forked from phrawzty/2serv.py
simple http server to dump request headers
$ curl -s -H "X-Something: yeah" localhost:8000 > /dev/null
$ python serv.py
ERROR:root:User-Agent: curl/7.37.1
Host: localhost:8000
Accept: */*
X-Something: yeah
@dragomirr
dragomirr / vimdiff.md
Created April 18, 2018 09:27 — forked from mattratleph/vimdiff.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@dragomirr
dragomirr / sysctl.conf
Created February 24, 2018 12:35 — forked from kgriffs/sysctl.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1