Skip to content

Instantly share code, notes, and snippets.

@valadan
valadan / readme.md
Created January 22, 2019 21:18 — forked from ubergesundheit/readme.md
systemd traefik.service

systemd Service Unit for Traefik

Adapted from traefik systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@valadan
valadan / jhipster-log-filebeat-conf
Created January 18, 2019 01:56 — forked from shudarshon/jhipster-log-filebeat-conf
this filebeat configuration in used for jhipster app parsing in logstash server
################### Filebeat Configuration Example #########################
############################# Filebeat ######################################
filebeat:
# List of prospectors to fetch data.
prospectors:
# Each - is a prospector. Below are the prospector specific configurations
-
# Paths that should be crawled and fetched. Glob based paths.
# To fetch all ".log" files from a specific level of subdirectories
@valadan
valadan / README.md
Created May 5, 2017 11:11 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@valadan
valadan / keytool.rb
Created January 31, 2017 03:02 — forked from lusis/keytool.rb
recipe for adding certs to keytool
keystore = "/etc/java-6-sun/security/cacerts"
keystore_pass = "foobar"
# you'll need foo.cert et. al. in files/default
certs = %w{foo bar bang}
certs.each do |cert|
cookbook_file "#{Chef::Config[:file_cache_path]}/#{cert}.cert" do
source "#{cert}.cert"
end
@valadan
valadan / DockerSpringBootLoggingUsingSyslogAndLogstash.md
Created January 12, 2017 15:47 — forked from jamescookie/DockerSpringBootLoggingUsingSyslogAndLogstash.md
Centralised logging for Docker containers running Spring Boot applications

Centralised logging for Docker containers running Spring Boot applications

Log flow through the system

Log flow

About

We have a bunch of Spring Boot apps running in various Docker containers and wanted a centralised place to view the logs

@valadan
valadan / inventory_vpcs.py
Created December 18, 2016 14:51 — forked from jezhumble/inventory_vpcs.py
List EC2 and RDS instances, grouped by VPC
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse, sys, boto3, pprint
def count(my_list, my_key):
if my_key not in my_list:
return '0'
else:
return str(len(my_list[my_key]))

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@valadan
valadan / RunningMerge.scala
Created January 29, 2016 23:42 — forked from robinp/RunningMerge.scala
scala running merge of streams
object merging {
// Note: Tail-recursive stream functions should always be defined on objects, not traits.
// see http://stackoverflow.com/questions/12486762/scala-tail-recursive-stream-processor-function-defined-in-trait-holds-reference
/**
* Merges two ordered streams. The elements can be of different
* types, but they need a mapping to a common type C.
*
* The mapped streams must be ordered ascending.
@valadan
valadan / jargon.md
Last active January 27, 2016 11:03 — forked from cb372/jargon.md
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@valadan
valadan / TReader.scala
Created October 19, 2012 11:42 — forked from tonymorris/TReader.scala
Reader monad in Scala
case class T() // your data type that you want to "implicitly" thread through
case class TReader[+A](run: T => A) {
def map[B](f: A => B): TReader[B] =
sys.error("VFJlYWRlcihmIGNvbXBvc2UgcnVuKQ==")
def flatMap[B](f: A => TReader[B]): TReader[B] =
sys.error("VFJlYWRlcih0ID0+IGYocnVuKHQpKSBydW4gdCk=")
def &&&[B](x: TReader[B]): TReader[(A, B)] =