Skip to content

Instantly share code, notes, and snippets.

Martin Kleppmann ept

Block or report user

Report or block ept

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ept
ept / TestUnionEvolution.java
Created Dec 14, 2015
Adding a new branch to an Avro union
View TestUnionEvolution.java
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
import org.apache.avro.generic.GenericDatumReader;
import org.apache.avro.generic.GenericDatumWriter;
import org.apache.avro.generic.GenericRecordBuilder;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.BinaryEncoder;
import org.apache.avro.io.DatumReader;
@ept
ept / transactions-refs.md
Last active Sep 30, 2015
References from my talk “Transactions: Myths, Surprises and Opportunities”
View transactions-refs.md

Transactions: Myths, Surprises and Opportunities

References

  1. Atul Adya: “Weak Consistency: A Generalized Theory and Optimistic Implementations for Distributed Transactions,” PhD thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, March 1999.
  2. Hagit Attiya, Faith Ellen, and Adam Morrison: “Limitations of Highly-Available Eventually-Consistent Data Stores,” at ACM Symposium on Principles of Distributed Computing (PODC), July 2015.
  3. Peter Bailis, Alan Fekete, Ali Ghodsi, Joseph M Hellerstein, and Ion Stoica: “HAT, not CAP: Towards Highly Available Transactions,” at 14th USENIX Workshop on Hot Topics in Operating Systems (HotOS), May 2013.
  4. Peter Bailis, Ali Ghodsi, Joseph M Hellerstein, and Ion Stoica: “[Bolt-on Causal Consistency](http://db.cs.be
@ept
ept / transactions-refs.md
Created Sep 30, 2015
References from my talk “Transactions: Myths, Surprises and Opportunities”
View transactions-refs.md

Transactions: Myths, Surprises and Opportunities

References

Atul Adya: “Weak Consistency: A Generalized Theory and Optimistic Implementations for Distributed Transactions,” PhD thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, March 1999. http://pmg.csail.mit.edu/papers/adya-phd.pdf Hagit Attiya, Faith Ellen, and Adam Morrison: “Limitations of Highly-Available Eventually-Consistent Data Stores,” at ACM Symposium on Principles of Distributed Computing (PODC), July 2015. http://www.cs.technion.ac.il/people/mad/online-publications/podc2015-replds.pdf Peter Bailis, Alan Fekete, Ali Ghodsi, Joseph M Hellerstein, and Ion Stoica: “HAT, not CAP: Towards Highly Available Transactions,” at 14th USENIX Workshop on Hot Topics in Operating Systems (HotOS), May 2013. http://www.bailis.org/papers/hat-hotos2013.pdf Peter Bailis, Ali Ghodsi, Joseph M Hellerstein, and Ion Stoica: “Bolt-on Causal Consistency,” at ACM International Conference on Manag

View pipeline.sh
awk '{print $7}' access.log | # Split by whitespace, 7th field is request path
sort | # Make occurrences of the same URL appear consecutively in file
uniq -c | # Replace consecutive occurrences of the same URL with a count
sort -rn | # Sort by number of occurrences, descending
head -n 5 # Output top 5 URLs
View nullmsg.c
#include <librdkafka/rdkafka.h>
#include <string.h>
#include <stdio.h>
/* If this is zero, the message is produced correctly. Other values cause problems. */
#define LENGTH_FOR_NULL_KEY 5
#define ERROR_LEN 512
#define TOPIC "foo"
#define MSG_KEY "hello"
View keybase.md

Keybase proof

I hereby claim:

  • I am ept on github.
  • I am martinkl (https://keybase.io/martinkl) on keybase.
  • I have a public key whose fingerprint is 4DF9 7732 6AF8 33A8 21AF E443 ED78 F8F5 352D 8EDF

To claim this, I am signing this object:

@ept
ept / gist:8464174
Created Jan 16, 2014
25 second RTT
View gist:8464174
$ ping google.com
PING google.com (173.194.34.104): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
64 bytes from 173.194.34.104: icmp_seq=0 ttl=47 time=5277.419 ms
64 bytes from 173.194.34.104: icmp_seq=1 ttl=47 time=5967.947 ms
Request timeout for icmp_seq 7
@ept
ept / gist:4475995
Last active May 19, 2019
Syntax highlighting code for PowerPoint (Mac OS)
View gist:4475995

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

@ept
ept / gist:3091205
Created Jul 11, 2012
Minimal shell script for launching Zookeeper
View gist:3091205
#!/bin/bash -e
export JAVA_HOME="/usr/lib/jvm/java-6-openjdk-amd64"
export ZOOBINDIR="/home/zookeeper/current/bin"
export JMXFLAGS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false"
export ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain"
export ZOOCFGDIR="/home/zookeeper/config"
export ZOO_LOG_DIR="/home/zookeeper/log"
export ZOO_LOG4J_PROP="INFO,ROLLINGFILE"
. $ZOOBINDIR/zkEnv.sh
View gist:3056389
Giveaway of old computing equipment! Everything still works, as far as I know.
If you want anything, let me know ASAP (@martinkl on Twitter), otherwise
it's going for recycling. You can pick it up in Kingston upon Thames
(south-west London). Everything free, the sooner it's gone the better.
Desktop computers
-----------------
You can’t perform that action at this time.