Skip to content

Instantly share code, notes, and snippets.

View guizmaii's full-sized avatar
🏄‍♂️

Jules Ivanic guizmaii

🏄‍♂️
View GitHub Profile
import cats.instances.future._
import cats.instances.option._
import cats.syntax.traverse._
import cats.syntax.cartesian._
import scala.concurrent.Future
trait Guizmaii {
import scala.concurrent.ExecutionContext.Implicits.global
// How to install it:
// ------------------
//
// 1. Copy this function into your .zshrc or .bashrc file
// 2. Done!
//
// How to use it:
// --------------
//
// You want to merge `develop` branch in your `my_functionnality` branch.
@guizmaii
guizmaii / infra-secret-management-overview.md
Created May 10, 2017 16:45 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@guizmaii
guizmaii / ExecutionContextMonitor.scala
Created June 2, 2017 11:11 — forked from atamborrino/ExecutionContextMonitor.scala
Monitor Scala's ExecutionContext / Akka Dispatcher lag (number of tasks in waiting queues)
import java.util.concurrent._
import akka.dispatch.{Dispatcher, ExecutorServiceDelegate}
import config.Config
import helpers.ScalaLogger
class ExecutionContextMonitor()(implicit metricsService: MetricsClient, config: Config) {
private val log = ScalaLogger.get(this.getClass)
private val scheduler = Executors.newSingleThreadScheduledExecutor()
@guizmaii
guizmaii / ExecutionContextMonitor.scala
Created June 2, 2017 11:11 — forked from atamborrino/ExecutionContextMonitor.scala
Monitor Scala's ExecutionContext / Akka Dispatcher lag (number of tasks in waiting queues)
import java.util.concurrent._
import akka.dispatch.{Dispatcher, ExecutorServiceDelegate}
import config.Config
import helpers.ScalaLogger
class ExecutionContextMonitor()(implicit metricsService: MetricsClient, config: Config) {
private val log = ScalaLogger.get(this.getClass)
private val scheduler = Executors.newSingleThreadScheduledExecutor()
@guizmaii
guizmaii / amifind.sh
Created August 10, 2017 11:23 — forked from vancluever/amifind.sh
Find the most recent Ubuntu AMI using aws-cli (or any other AMI for that matter)
#!/bin/sh
# Use AWS CLI to get the most recent version of an AMI that
# matches certain criteria. Has obvious uses. Made possible via
# --query, --output text, and the fact that RFC3339 datetime
# fields are easily sortable.
export AWS_DEFAULT_REGION=us-east-1
aws ec2 describe-images \
@guizmaii
guizmaii / amifind.sh
Created August 10, 2017 11:23 — forked from vancluever/amifind.sh
Find the most recent Ubuntu AMI using aws-cli (or any other AMI for that matter)
#!/bin/sh
# Use AWS CLI to get the most recent version of an AMI that
# matches certain criteria. Has obvious uses. Made possible via
# --query, --output text, and the fact that RFC3339 datetime
# fields are easily sortable.
export AWS_DEFAULT_REGION=us-east-1
aws ec2 describe-images \
@guizmaii
guizmaii / integer.rb
Created August 29, 2017 08:16 — forked from pithyless/integer.rb
Ruby Integer::MAX and Integer::MIN
class Integer
N_BYTES = [42].pack('i').size
N_BITS = N_BYTES * 16
MAX = 2 ** (N_BITS - 2) - 1
MIN = -MAX - 1
end
p Integer::MAX #=> 4611686018427387903
p Integer::MAX.class #=> Fixnum
p (Integer::MAX + 1).class #=> Bignum
@guizmaii
guizmaii / empty_cognito_user_pool.sc
Last active September 29, 2017 15:02
Ammonite (http://ammonite.io/) script to remove all identities in a AWS Cognito Identity Pool
#!/usr/local/bin/amm
import sys.process._
import collection.mutable
import ammonite.ops._
import ammonite.ops.ImplicitWd._
import $ivy.`com.amazonaws:aws-java-sdk:1.11.204`
import com.amazonaws.services.cognitoidp._
import java.nio.file.{Files, Paths}
import play.api.http.{HeaderNames, Writeable}
import play.api.libs.Files.TemporaryFile
import play.api.mvc.MultipartFormData.FilePart
import play.api.mvc.{AnyContentAsMultipartFormData, Codec, MultipartFormData}
/**
* More infos:
* https://groups.google.com/forum/#!topic/play-framework/9wP9dx7bYSo