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.
@StevenACoffman
StevenACoffman / fluent-filebeat-comparison.md
Last active April 2, 2024 22:34
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@atmb4u
atmb4u / timeit.scala
Created December 29, 2016 20:24
timeit for scala
// http://stackoverflow.com/questions/9160001/how-to-profile-methods-in-scala
def time[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
val t1 = System.nanoTime()
println("Elapsed time: " + (t1 - t0) + "ns")
result
}
@yashpatil
yashpatil / JolokiaCommands.md
Last active January 6, 2023 14:59
Jolokia URLs for quick access to A-MQ statistics

This is a quick reference to get to Jolokia statistics urls for JBoss Fuse or JBoss A-MQ statistics. Sometimes, when you are interested in very specific attributes, it's easier to keep monitoring a specific url rather than loading the full Hawtio console.

@rklaehn
rklaehn / Proxy.scala
Created January 31, 2015 16:29
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@fancellu
fancellu / ShapelessCoproduct.scala
Last active February 20, 2023 10:02
Examples with Shapeless 2.0, easier to understand from examples. Taken from docs, more examples/comments added etc
// Coproduct is extension of Either concept, to N multually exlusive choices
type ISB = Int :+: String :+: Boolean :+: CNil
val isb = Coproduct[ISB]("foo") //> isb : qaaz.ISB = foo
isb.select[Int] //> res0: Option[Int] = None
isb.select[String] //> res1: Option[String] = Some(foo)
@mortezaadi
mortezaadi / persistence.xml
Last active March 13, 2023 10:54
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
"""
An XPUB/XSUB broker that forwards subscriptions
"""
import os
import string
import sys
import time
from random import randint
from threading import Thread
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n