Skip to content

Instantly share code, notes, and snippets.

Avatar

Guillaume Husta ghusta

View GitHub Profile
@ghusta
ghusta / create_machine_docker-dev.cmd
Created Jan 17, 2018
Create a Docker Machine with Windows, VirtualBox and Boot2Docker with a customized shared folder
View create_machine_docker-dev.cmd
rem set MACHINE_STORAGE_PATH=D:\Dev\Docker\.docker\machine
docker-machine version
docker-machine ls
echo creation VM VirtualBox : Docker Machine (Help : docker-machine create --help)
rem var env (ex : proxy) : --engine-env
set VM_NAME=docker-dev
mkdir d:\Dev\Docker\.docker\machine\SharedFolders\%VM_NAME%
docker-machine create -d "virtualbox" --virtualbox-cpu-count "2" --virtualbox-disk-size "50000" --virtualbox-memory "2048" --virtualbox-share-folder "\\?\d:\Dev\Docker\.docker\machine\SharedFolders\%VM_NAME%:host-shared" %VM_NAME%
View Jenkinsfile
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com'
}
stages {
stage('Build with unit testing') {
@SalmonKing72
SalmonKing72 / docker-machine-insecure-registry.md
Last active Jul 7, 2021
docker-machine: adding insecure registry configuration to an existing machine/VM
View docker-machine-insecure-registry.md

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
@ghusta
ghusta / Dockerfile
Last active Feb 6, 2019
Tomcat 8 + Docker : add custom directory in classpath (Method #2 : define CLASSPATH in bin/setenv.sh)
View Dockerfile
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"
@ghusta
ghusta / Dockerfile
Last active Dec 4, 2020
Tomcat 8 + Docker : add custom directory in classpath (Method #1 : modify conf/catalina.properties)
View Dockerfile
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
@YuMS
YuMS / update-git.sh
Created Jun 29, 2016
Update git to latest version on Ubuntu
View update-git.sh
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
View Custom Tabs - Close Button
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());
@staltz
staltz / introrx.md
Last active Nov 27, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
@rob-murray
rob-murray / add_intellij_launcer
Last active Nov 15, 2021
Add Intellij launcher shortcut and icon for ubuntu
View add_intellij_launcer
// 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
@varunachar
varunachar / CacheBuster.java
Last active Sep 29, 2016
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…
View CacheBuster.java
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