Skip to content

Instantly share code, notes, and snippets.

package com.tele2;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericRecord;
import org.apache.commons.lang3.NotImplementedException;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.io.FilePathFilter;
import org.apache.flink.api.java.DataSet;
package main
import (
"fmt"
"net/http"
)
func speakHandler(w http.ResponseWriter, req *http.Request) {
switch req.Method {
case "GET":
@ecerulm
ecerulm / buildvim.sh
Created May 5, 2017 10:04
script to build vim
#!/bin/bash
set -euxo pipefail
# e : fail as soon as a command fails, don't continue
# u : fail if nonexisting variable can't be expanded
# x : echo each line as it's executed
# -o pipefail: fail if a command in a pipe returns status != 0
make distclean
./configure \
--prefix=$HOME/.local/ \
install_rabbitmq:
pkg.installed:
- name: rabbitmq-server
@ecerulm
ecerulm / mac_example.c
Last active October 29, 2020 13:36
AES-CMAC using OpenSSL/libcrypto
// compile with
// cc `PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" pkg-config --cflags --libs openssl` mac_example.c -o mac_example
// cc -I/usr/local/Cellar/openssl@1.1/1.1.1h/include -L/usr/local/Cellar/openssl@1.1/1.1.1h/lib -lssl -lcrypto mac_example.c
#include <stdio.h>
#include <openssl/cmac.h>
void printBytes(unsigned char *buf, size_t len) {
for(int i=0; i<len; i++) {
printf("%02x ", buf[i]);
}
@ecerulm
ecerulm / ecerulm-1.cfg
Created November 25, 2014 12:55
Deb metapackage
# sudo apt-get install -y equivs gdebi
# equivs-build ecerulm-1.cfg # will generate the .deb file
# use sudo gdebi -n ecerulm*.deb # to install the package
Section: misc
Priority: optional
Standards-Version: 3.9.2
Package: ecerulm
Version: 1.2
Depends: vim-nox,build-essential,tmux,byobu,python,python-dev
Depends: linux-generic,linux-headers-generic,dkms,git,meld,silversearcher-ag,ncdu,curl,apt-file
@ecerulm
ecerulm / packages_to_install.sh
Last active December 1, 2016 15:55
Install a series of packages
#!/bin/sh
# curl -k https://gist.githubusercontent.com/ecerulm/be59ec62ad77178d61a5/raw | sh
PACKAGES=$(cat <<'EOF'
lua5.2-dev
docker.io
stow
tk-dev
exuberant-ctags
libssl-dev
@ecerulm
ecerulm / README.md
Last active August 29, 2015 14:01 — forked from mbostock/.block
d3 pack radius fail

Enclosure diagrams use containment to represent the hierarchy. Although circle packing is not as space-efficient as a treemap, it better reveals the hierarchy. Implementation based on work by Jeff Heer. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

See also this zoomable version.

Enclosure diagrams use containment to represent the hierarchy. Although circle packing is not as space-efficient as a treemap, it better reveals the hierarchy. Implementation based on work by Jeff Heer. Data shows the Flare class hierarchy, also courtesy Jeff Heer.

See also this zoomable version.

@ecerulm
ecerulm / Gemfile
Last active January 23, 2020 05:47
Minimal config for sinatra / guard / livereload
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem 'sinatra'
group :development, :test do
gem 'guard-livereload', require: false
gem 'rack-livereload'
gem 'guard'
end