Skip to content

Instantly share code, notes, and snippets.

View lehins's full-sized avatar

Alexey Kuleshevich lehins

View GitHub Profile
@lehins
lehins / credstash_setup.tf
Created August 16, 2017 19:16
Three terraform modules that should be applied individually
provider "aws" {
region = "us-east-1"
}
terraform {
backend "s3" {
bucket = "example-tfstate"
key = "remote-tfstate/credstash/terraform.tfstate"
region = "us-east-1"
encrypt = true
}
@lehins
lehins / Lib.hs
Last active June 27, 2018 13:54
Make QuickCheck instances optional, but part of the library.
{-# LANGUAGE CPP #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Lib
( someFunc
, Foo(..)
) where
-- In practice instead of CPP possibly use a separate module for optional instances
#ifdef QuickCheck_Instances
import Test.QuickCheck
@lehins
lehins / change.tf
Last active March 13, 2018 17:20
ELK ELB/ALB switch
# elasticsearch_external_alb = "${module.kibana-elasticsearch-alb.alb}"
elasticsearch_external_alb = {
"security_group_id" = "${aws_security_group.es-external-lb.id}"
"deploy_elb" = true
"deploy_elb_internal" = false
"certificate_arn" = "${data.aws_acm_certificate.wildcard-cert.arn}"
}
@lehins
lehins / encodeOctal.hs
Last active January 18, 2018 18:59
encodeOctal Benchmark
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveGeneric #-}
module Main where
import Control.Monad.Catch
import Criterion.Main
import Data.ByteString (ByteString)
import qualified Data.ByteString as S
import Data.ByteString.Builder
import Data.Monoid

Development with minikube

Among many guides on how to start with Kubernetes and Minikube here is most consise one I'd recommend: https://github.com/dysinger/learn-minikube

Disclaimer: This guide was tested with minikube 0.16.0 and due to this issue getting volume mounting with KVM was impossible. Althoug it was tested with development version at the time and above issue was no longer was a problem, so it should be fixed by now.

@lehins
lehins / keybase.md
Created May 25, 2017 15:25
My Keybase Identity

Keybase proof

I hereby claim:

  • I am lehins on github.
  • I am lehins (https://keybase.io/lehins) on keybase.
  • I have a public key ASB26veyqfKNn9oBIuPQTetZRc2e2R5TX1cLnm7K7gXXgwo

To claim this, I am signing this object:

@lehins
lehins / array.hs
Last active March 29, 2017 08:49
Explicit array fusion
#!/usr/bin/env stack
-- stack --resolver lts-8.3 exec --package vector --package criterion -- ghc -O2
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Control.Monad.ST (ST)
import Criterion.Main
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as MVU
#!/usr/bin/env stack
-- stack --install-ghc --resolver lts-7.7 runghc
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.List as List
import Data.Monoid
import Text.Printf
-- | Social Security Number. Commonly used as a unique identification number of a