Skip to content

Instantly share code, notes, and snippets.

Simone Scarduzio sscarduzio

Block or report user

Report or block sscarduzio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sscarduzio / docker-compose.yml
Created Sep 18, 2017
Try XPACK with kibana
View docker-compose.yml
version: "2.0"
- "9200:9200"
- "9300:9300"
- discovery.type single-node
sscarduzio /
Created May 15, 2017
Current LDAP docs

LDAP connector

In this example, users credentials are validate via LDAP. The groups associated to each validated users are resolved using the same LDAP server.

Simpler: authentication and authorization in one rule

    enable: true
sscarduzio / Missing class Error
Created Nov 11, 2016
Readonlyrest SBT Elasticsearch plugin
View Missing class Error
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Des.path.home=/me/elasticsearch-readonlyrest-plugin/src/test/eshome -Didea.launcher.port=7533 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA" -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0
sscarduzio / validated.scala
Last active May 31, 2016
Cannot find |@| ( using "org.typelevel" %% "cats" % "0.6.0")
View validated.scala
import{Validated, Xor}
import cats.syntax.apply._ // For |@| syntax
import cats.std.list._ // For semigroup (append) on List
object ValidatedExample {
import Xor.{left, right}
import Validated.{invalid, valid}
// We are going to compare the behaviour of Xor and Validated. First we
// define some instances. Then we combine them using flatMap
sscarduzio / Main.scala
Created May 15, 2016
Cats Free Monad. One algebra, many interpreters.
View Main.scala
* Created by sscarduzio on 15/05/2016.
package free
object Main extends App {
// Algebra
sealed trait KVStoreA[A]
sscarduzio / SearchService.scala
Created Jan 27, 2016
Refactor ensime-server indexer (excerpt)
View SearchService.scala
// Proposed code
override def receive: Receive = {
// ... snip ...
for {
indexed <- Future.sequence( {
case (_, f) =>
if (!f.exists()) Future.successful(f -> Nil)
else searchService.extractSymbolsFromClassOrJar(f).map(f ->)
.recoverWith { case t: Throwable => log.error(s"failed to index batch of ${batch.size} files", t); Future.failed(t)}
sscarduzio / GenericMonadTransformer.scala
Last active Dec 21, 2015
Daniel's transformer won't work with future
View GenericMonadTransformer.scala
package test
import scala.util.Try
import scalaz._
import scalaz.std.option._
import scalaz.std.list._
sealed trait CoPConst {
type Point[A]
sscarduzio / pom.xml
Created Dec 19, 2015
Maven configuration for enabling Elasticsearch integration tests (took me 2 hours)
View pom.xml
sscarduzio /
Last active Jul 13, 2016 — forked from alvinj/
A shell script to create an SBT project directory structure
# Name: sbtmkdirs
# Purpose: Create an SBT project directory structure with a few simple options.
# Author: Alvin Alexander,
# Info:
# License: Creative Commons Attribution-ShareAlike 2.5 Generic
sscarduzio / AWS Lambda Python ZIP packager
Last active Feb 16, 2018
When your python script has dependencies, you need to make a ZIP to upload in AWS Lambda.
View AWS Lambda Python ZIP packager
### NB: This script assumes you have set up your project in virtualenv!
# Configure here your python script with dependencies
WORKDIR=`mktemp -d --suffix $WORKDIR_SUFFIX`
You can’t perform that action at this time.