Skip to content

Instantly share code, notes, and snippets.

View jochenchrist's full-sized avatar

Jochen Christ jochenchrist

View GitHub Profile
@jochenchrist
jochenchrist / docker-copy-certificates.sh
Last active November 28, 2020 10:23
Copy Certificates from Docker server to local machine
# On the Mac
mkdir -p ~/.docker/
scp ubuntu@DOCKER_SERVER:/etc/docker/certs/{ca,key,cert}.pem ~/.docker/
@jochenchrist
jochenchrist / systemd-docker-tls.conf
Last active November 28, 2020 10:43
systemd Docker Host with TLS
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H=fd:// -H=unix:///var/run/docker.sock --tlsverify --tlscacert=/etc/docker/certs/ca.pem --tlscert=/etc/docker/certs/server-cert.pem --tlskey=/etc/docker/certs/server-key.pem -H=0.0.0.0:2376
@jochenchrist
jochenchrist / docker-ubuntu-create-certificates.sh
Created November 28, 2020 09:50
Create TLS certificates for Docker
# Run as root
sudo -i
# Resolve hostname and IP addresses for server certificate.
MY_HOSTNAME=`hostname` && \
MY_PRIVATE_IP=`hostname -i` && \
MY_PUBLIC_IP=`curl -s ifconfig.me/ip`
# Create CA key and certificate
mkdir -p /etc/docker/certs && cd /etc/docker/certs && \
@jochenchrist
jochenchrist / docker-ubuntu-install.sh
Last active November 28, 2020 09:47
Install Docker on Ubuntu 20
sudo apt update && \
DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" sudo apt install -y tzdata && \
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" && \
sudo apt update && \
sudo apt install -y docker-ce && \
docker --version
@jochenchrist
jochenchrist / arquillian.xml
Created November 29, 2017 15:42
WLP arquillian.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<engine>
<property name="deploymentExportPath">target/</property>
</engine>
<container qualifier="websphere" default="true">
@jochenchrist
jochenchrist / pom.xml
Created November 29, 2017 15:42
WLP Arquillian pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.datev</groupId>
<artifactId>scheduling1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
@jochenchrist
jochenchrist / pom.xml
Created November 20, 2017 12:51
Plain Java EE 7 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.jochenchrist</groupId>
<artifactId>artifactname</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
@jochenchrist
jochenchrist / server.xml
Created November 20, 2017 12:50
Libery server.xml with derby dataSource
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. -->
<!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an
encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element.
@jochenchrist
jochenchrist / pom.xml
Created December 11, 2015 08:05
pom.xml with arquillian and wildfly embedded container
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.thi.cocktails</groupId>
<artifactId>cocktails</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax</groupId>
@jochenchrist
jochenchrist / faces-config.xml
Last active September 14, 2015 15:06
Empty faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
</faces-config>