Skip to content

Instantly share code, notes, and snippets.

@mrbald
mrbald / example.sh
Last active January 20, 2021 15:26 — forked from tristanbes/example.sh
Install Graphite on a Debian Server
# Install graphite dependencies
apt-get install -y python3 python3-pip python3-cairo python3-django
apt-get install -y apache2 libapache2-mod-wsgi-py3
# Install graphite
pip3 install https://github.com/graphite-project/whisper/tarball/master
pip3 install https://github.com/graphite-project/carbon/tarball/master
pip3 install https://github.com/graphite-project/graphite-web/tarball/master
# Setup a vhost by grabbing the example the graphite team released on their repo.
@mrbald
mrbald / timeit.scala
Last active October 2, 2018 13:14 — forked from atmb4u/timeit.scala
timeit for scala
def timeit (warmups: Int, trials: Int) (block: => Unit): Unit = {
import Math.{min,max}
for (i <- 1 to warmups) block
var total = 0.0
var best = Long.MaxValue
var worst = Long.MinValue
for (i <- 1 to trials) {
val beg = System.nanoTime()