Skip to content

Instantly share code, notes, and snippets.

Avatar
✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com

Francois-Guillaume Ribreau FGRibreau

✍️
writing "#NoBullshit Tech-Lead" book https://getnobullshit.com
View GitHub Profile
View Knockd.md

On your server (ubuntu/debian)

apt-get update
# We want to make ensure to allow all established connections and on-going sessions through the firewall, otherwise, the firewall would block the current SSH session
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT

# Then use the following rule to block incoming port 22 (SSH)
iptables -A INPUT -p tcp --destination-port 22 -j DROP
@FGRibreau
FGRibreau / 1_scylladb-benchmark.md
Created May 12, 2016
ScyllaDb benchmark on Docker
View 1_scylladb-benchmark.md
View scylla-bench-vm.txt
type, total ops, op/s, pk/s, row/s, mean, med, .95, .99, .999, max, time, stderr, errors, gc: #, max ms, sum ms, sdv ms, mb
total, 3691, 3691, 3691, 3691, 1.1, 0.7, 4.3, 8.5, 12.1, 14.2, 1.0, 0.00000, 0, 0, 0, 0, 0, 0
total, 8360, 4599, 4599, 4599, 0.9, 0.4, 3.3, 9.2, 15.1, 18.8, 2.0, 0.07740, 0, 0, 0, 0, 0, 0
total, 15809, 7387, 7387, 7387, 0.5, 0.3, 1.2, 6.5, 16.1, 23.9, 3.0, 0.17373, 0, 0, 0, 0, 0, 0
total, 26494, 10567, 10567, 10567, 0.4, 0.3, 0.7, 1.2, 10.4, 14.3, 4.0, 0.20454, 0, 0, 0, 0, 0, 0
total, 37227, 10631, 10631, 10631, 0.4, 0.3, 0.8, 1.2, 7.0, 10.2, 5.0, 0.17680, 0, 0, 0, 0, 0,
@FGRibreau
FGRibreau / test-scylla.sh
Last active Feb 29, 2016
Give a try to ScyllaDB (Cassandra in C++, ~10x faster) with two lines of docker http://blog.fgribreau.com/2016/02/give-try-and-bench-scylladb-cassandra.html
View test-scylla.sh
# start in one terminal scylla
docker run --rm -P -i -t --name=scylla scylladb/scylla
# start in another terminal cassandra-stress test
docker run --link scylla -it --rm joprice/scylla-tools cassandra-stress write -mode cql3 native -node $(docker inspect -f '{{ .NetworkSettings.IPAddress }}' scylla)
@FGRibreau
FGRibreau / kafka-docker-macosx.sh
Last active Jan 12, 2016
Setup a Kafka node for development with two lines of docker
View kafka-docker-macosx.sh
# tested with docker-machine on MacOSX
# start zookeeper
docker run -d --rm -it -p 2181:2181 digitalwonderland/zookeeper
# start kafka
docker run -d --rm -it -p 9000:9000 -e ZK_HOSTS="`docker-machine ip default`:2181" -e APPLICATION_SECRET=letmein sheepkiller/kafka-manager
@FGRibreau
FGRibreau / match-when.js
Created Dec 29, 2015
match-when - Pattern matching for modern JavaScript - https://github.com/FGRibreau/match-when
View match-when.js
const {match, when} = require('match-when');
function fact(n){
return match({
[when(0)]: 1,
[when()]: (n) => n * fact(n-1)
})(n);
}
fact(10); // 3628800
@FGRibreau
FGRibreau / match-when.js
Created Dec 29, 2015
match-when - Pattern matching for modern JavaScript - https://github.com/FGRibreau/match-when
View match-when.js
function length(list){
return match({
[when([])]: 0,
[when()]: ([head, ...tail]) => 1 + length(tail)
})(list);
}
length([1, 1, 1]); // 3
@FGRibreau
FGRibreau / match-when.js
Created Dec 29, 2015
match-when - Pattern matching for modern JavaScript - https://github.com/FGRibreau/match-when
View match-when.js
[2, 4, 1, 2].map(match({
[when(1)]: "one",
[when(2)]: "two",
[when()]: "many"
}));
// [ 'two', 'many', 'one', 'two' ]
View keybase.md

Keybase proof

I hereby claim:

  • I am fgribreau on github.
  • I am fgribreau (https://keybase.io/fgribreau) on keybase.
  • I have a public key whose fingerprint is 5979 F08D 8622 0A90 8A68 AA2B 33AF 768D F5E0 57AA

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am fgribreau on github.
  • I am fgribreau (https://keybase.io/fgribreau) on keybase.
  • I have a public key whose fingerprint is 8B23 A013 21BD 8FB0 A0E1 6095 55EE 155C 4B46 0AE2

To claim this, I am signing this object: