Skip to content

Instantly share code, notes, and snippets.

View ghusta's full-sized avatar

Guillaume Husta ghusta

  • Toulouse, France
  • 01:48 (UTC +02:00)
  • X @ghusta
View GitHub Profile
@oliverdaff
oliverdaff / NexusArtifactCleanup.groovy
Created March 29, 2012 05:47
Clean up nexus artifacts with API
import groovyx.net.http.*;
import static groovyx.net.http.ContentType.*;
import static groovyx.net.http.Method.*;
class NexusArtifactCleanup {
/**
* Settings in which to run script.
*/
@thurloat
thurloat / example.java
Created April 27, 2012 17:08
Jackson JSON ignore on deserialize only
package com.thurloat.foo;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* In order to write a composite data property (stats) out to JSON without reading
* it back in, you need to explicitly ignore the property, as well as the setter and
* then apply the @JsonProperty annotation to the getter.
**/
@varunachar
varunachar / CacheBuster.java
Last active September 29, 2016 10:04
A cache buster for jsp. Meant for webapp sitting behind a Apache 2 server. Cache is busted by appending a file with it's last modified time and then including it in a JSP. Example : <script type="text/javascript" src="js/trelta-all.min.123345.js" ></script> You don't need to modify the actual name of the file on the hard disk, since we've define…
package com.trelta.commons.web;
import java.io.File;
import org.apache.commons.io.FilenameUtils;
import com.trelta.commons.utils.constants.Settings;
/**
* Cache Buster which appends the last modified time of a file to it's name
@rob-murray
rob-murray / add_intellij_launcer
Last active April 10, 2024 15:42
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@staltz
staltz / introrx.md
Last active April 15, 2024 10:24
The introduction to Reactive Programming you've been missing
CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder();
intentBuilder.setCloseButtonIcon(BitmapFactory.decodeResource(
getResources(), R.drawable.ic_arrow_back));
CustomTabActivityHelper.openCustomTab(
this, intentBuilder.build(), Uri.parse(url), new WebviewFallback());
@YuMS
YuMS / update-git.sh
Created June 29, 2016 09:28
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@ghusta
ghusta / Dockerfile
Last active August 12, 2022 20:39
Tomcat 8 + Docker : add custom directory in classpath (Method #1 : modify conf/catalina.properties)
FROM tomcat:8.5-jre8
# $CATALINA_HOME is defined in tomcat image
ADD target/my-webapp*.war $CATALINA_HOME/webapps/my-webapp.war
# Application config
RUN mkdir $CATALINA_HOME/app_conf/
ADD src/main/config/test.properties $CATALINA_HOME/app_conf/
# Modify property 'shared.loader' in catalina.properties
@ghusta
ghusta / Dockerfile
Last active February 6, 2019 18:19
Tomcat 8 + Docker : add custom directory in classpath (Method #2 : define CLASSPATH in bin/setenv.sh)
FROM tomcat:8.5-jre8
# $CATALINA_HOME is defined in tomcat image
ADD target/my-webapp*.war $CATALINA_HOME/webapps/my-webapp.war
# Application config
RUN mkdir $CATALINA_HOME/app_conf/
ADD src/main/config/test.properties $CATALINA_HOME/app_conf/
# Create "$CATALINA_HOME/bin/setenv.sh"
@SalmonKing72
SalmonKing72 / docker-machine-insecure-registry.md
Last active July 7, 2021 11:44
docker-machine: adding insecure registry configuration to an existing machine/VM

The issue

  • deployed a local docker registry container to a docker-machine VM
  • cannot push to local docker registry
  • get an error including a message similar to, "http: server gave HTTP response to HTTPS client"

The solution

  • in order to push to this local registry you need to make some modifications to your docker VM
  • open c:\users\<user-name>\.docker\machine\machines\default\config.json or ~/.docker/machine/machines/default/config.json in an editor
  • find the InsecureRegistry property and append "localhost:5000" to it
  • go to your docker terminal