Skip to content

Instantly share code, notes, and snippets.

View tommysdk's full-sized avatar

Tommy Tynjä tommysdk

View GitHub Profile
@tommysdk
tommysdk / minikube_ssl.sh
Created September 4, 2018 09:22
minikube ssl: add certificate to pull docker images from private docker registry
minikube ssh
docker pull internal.docker.registry/my-image # Error response from daemon: Get https://internal.docker.registry/v2/: x509: certificate signed by unknown authority
sudo mkdir -p /etc/docker/certs.d/internal.docker.registry
sudo cp /etc/ssl/my-cert.crt /etc/docker/certs.d/internal.docker.registry/
docker pull internal.docker.registry/my-image # Status: Downloaded newer image for internal.docker.registry/my-image
@tommysdk
tommysdk / select_java_version
Last active April 2, 2024 02:48
Change default Java version on Mac OS X using Fish shell
# Based on https://stackoverflow.com/a/26252993/1665539
# Show all installed Java versions
/usr/libexec/java_home -V
# Select major version (if unique, otherwise specify full name e.g. 1.8.0_131)
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8)
# Verify
java -version
@tommysdk
tommysdk / org.jenkinsci.plugins.workflow.libs.GlobalLibraries.xml
Created July 25, 2017 15:20
XML configuration for Jenkins pipeline shared groovy libraries
<org.jenkinsci.plugins.workflow.libs.GlobalLibraries plugin="workflow-cps-global-lib@2.8">
<libraries>
<org.jenkinsci.plugins.workflow.libs.LibraryConfiguration>
<name>my-shared-library</name>
<retriever class="org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever">
<scm class="jenkins.plugins.git.GitSCMSource" plugin="git@3.4.1">
<id>7356ba0d-a25f-4f61-8c56-b3c565a39929</id>
<remote>ssh://git@github.com:Diabol/jenkins-pipeline-shared-library-template.git</remote>
<credentialsId>ssh</credentialsId>
<traits>
@tommysdk
tommysdk / gist:3706436
Created September 12, 2012 13:00
ShrinkWrap: How to replace a file in an artifact resolved with MavenDependencyResolver.
public static WebArchive getTestPreparedArchive() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "service.war")
.addClasses(MyClass1.class, MyClass2.class); // add classes needed for the test
// Resolve the needed dependency independently, so we can replace the production persistence.xml inside the archive
Collection<JavaArchive> archives = DependencyResolvers.use(MavenDependencyResolver.class)
.artifact("se.diabol.persistence:Persistence_Framework:jar:0.1-SNAPSHOT").resolveAs(JavaArchive.class);
// Resolve the actual archive
JavaArchive p = null;