Skip to content

Instantly share code, notes, and snippets.

View ppatierno's full-sized avatar
🏠
Working from home

Paolo Patierno ppatierno

🏠
Working from home
View GitHub Profile
@ppatierno
ppatierno / 3scale_routing_url_rewriting_workaround.json
Last active July 5, 2019 13:44
3scale policy chain with routing policy + URL rewriting with workaround
"policy_chain":[
{
"name":"default_credentials",
"version":"builtin",
"configuration":{
"auth_type":"user_key",
"user_key":"83009ff737e5d800a32044e23f46ebe7"
}
},
{
@ppatierno
ppatierno / travis_maven_3.3.x.yml
Last active May 14, 2017 03:44
Install Maven 3.3.x manually on Travis
In order to install Maven 3.3.x manually on Travis (doesn't supported yet)
before_install:
- wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip
- unzip -qq apache-maven-3.3.9-bin.zip
- export M2_HOME=$PWD/apache-maven-3.3.9
- export PATH=$M2_HOME/bin:$PATH
@ppatierno
ppatierno / intellij_gradle3_scala.txt
Created January 17, 2017 11:22
How to have Gradle 3.3 and Scala working in IntelliJ IDEA
Using IntelliJ IDEA and Gradle 3.3, the following error can be raised importing a Scala based project (i.e. Apache Kafka) with Gradle :
Unable to build Scala project configuration
Details: groovy.lang.MissingPropertyException: No such property: daemonServer for class: org.gradle.api.tasks.scala.ScalaCompileOptions
To fix it, you can add following lines to the build.gradle file
ScalaCompileOptions.metaClass.daemonServer = true
ScalaCompileOptions.metaClass.fork = true
ScalaCompileOptions.metaClass.useAnt = false
@ppatierno
ppatierno / openshift_docker_insecure_registry.txt
Created December 2, 2016 13:44
How to specify --insecure-registry needed for OpenShift "cluster up"
It could happen that with your Docker installation you don't have the following configuration file :
/etc/sysconfig/docker
Without it, the Docker daemon started as a service (i.e. with systemd so using "sudo systemctl start docker" or
"sudo systemctl enable docker" to start at OS startup) gets the configuration from following file :
/usr/lib/systemd/system/docker.service
You can ovveride this configuration in the following way :
@ppatierno
ppatierno / scala_to_json.scala
Last active February 17, 2021 17:23
Creating JSON with simple values and collections in Scala
package org.ppatierno
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.node.{ArrayNode, ObjectNode}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
/**
* Created by ppatiern on 02/08/16.
*/
object JsonTest {
@ppatierno
ppatierno / maven_package_exec_fat_jar.txt
Created March 31, 2016 12:23
Packaging an executable fat JAR with Apache Maven
Three ways to create an executable and fat JAR with Maven :
maven-jar-plugin (it doesn't add dependencies inside the final JAR, they have to be in the classpath)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
@ppatierno
ppatierno / eclipse.desktop
Created March 28, 2016 15:48
Eclipse .desktop file for integration in Gnome shell
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/icon.xpm
Exec=/opt/eclipse/eclipse
Terminal=false
Categories=Development;IDE;Java