Skip to content

Instantly share code, notes, and snippets.

View marcelo-ochoa's full-sized avatar

Marcelo Ochoa marcelo-ochoa

View GitHub Profile
@marcelo-ochoa
marcelo-ochoa / docker-compose.yml
Last active August 25, 2023 16:28
Traefik plus Portainer stack
version: "3.6"
services:
whoami:
image: traefik/whoami:v1.6.0
deploy:
mode: replicated
replicas: 1
labels:
- traefik.enable=true
@marcelo-ochoa
marcelo-ochoa / docker-compose-registry.yml
Created October 17, 2020 19:53
Sample docker-compose.yml using S3FS Docker volume plugin and Oracle Object Storage
version: '3.6'
services:
  registry:
    image: registry:2
    hostname: registry.mydomain.com
    networks:
      - lb_network
    volumes:
      - data:/var/lib/registry
@marcelo-ochoa
marcelo-ochoa / create-lb-certs.sh
Created October 14, 2020 18:47
Register a LetsEncrypt cert at the Oracle Cloud Load Balancer
#!/bin/bash
cd /etc/letsencrypt
cert_number=$(ls csr/|tail -1|sed s/_.*//)
cert_name=$RENEWED_DOMAINS-$cert_number
echo $cert_name
/root/bin/oci lb certificate create --load-balancer-id $OCID --certificate-name $cert_name --public-certificate-file /etc/letsencrypt/live/$RENEWED_DOMAINS/cert.pem --private-key-file /etc/letsencrypt/live/$RENEWED_DOMAINS/privkey.pem
sleep 30
/root/bin/oci lb listener update --force --listener-name lb_ssl --default-backend-set-name bs_default --port 443 --protocol HTTP --load-balancer-id $OCID --ssl-certificate-name $cert_name
@marcelo-ochoa
marcelo-ochoa / renew-certs.sh
Created October 14, 2020 18:42
LetsEncrypt CertBot execution
#!/bin/bash
# Start nginx en background
/etc/init.d/nginx start
sleep 10s
cd /opt/letsencrypt/
# ./certbot-auto --no-bootstrap --standalone renew
./letsencrypt-auto certonly --force-renewal --authenticator webroot --webroot-path /var/www/letsencrypt --post-hook /create-lb-certs.sh -d $RENEWED_DOMAINS
cd /etc/letsencrypt
@marcelo-ochoa
marcelo-ochoa / docker-compose-letsencrypt.yml
Created October 14, 2020 18:22
Docker Swarm stack for LetsEncrypt CertBot and Oracle OCI registration
version: '3.6'
volumes:
certs-repo:
driver: s3fs
name: "certs"
services:
nginx:
image: registry.mydomain.com/letsencrypt:1.19.3
@marcelo-ochoa
marcelo-ochoa / Dockerfile
Created October 14, 2020 18:09
Dockerfile to use LetsEncrypt CertBot and Oracle OCI tool
ARG VERSION=1.19.3
FROM nginx:$VERSION
RUN apt-get update \
&& apt-get install -y -q --no-install-recommends \
ca-certificates \
wget \
git \
vim \
openssh-client \
&& curl -L -s https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh -o /root/install.sh \
@marcelo-ochoa
marcelo-ochoa / docker-compose-traefik.yml
Last active January 30, 2021 22:03
Traefik docker-compose.yml stack definition
version: '3.6'
services:
whoami:
image: traefik/whoami:v1.6.0
deploy:
mode: replicated
replicas: 1
labels:
- traefik.enable=true
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SwingBenchConfiguration xmlns="http://www.dominicgiles.com/swingbench/config">
<Name>Stress Test</Name>
<Comment>Simple relational CRUD workload test</Comment>
<Connection>
<UserName>soe</UserName>
<Password>enc(cw4Xx9RgsQA=)</Password>
<ConnectString>//oraclelinux/DOM102</ConnectString>
<DriverType>Oracle10g Type IV jdbc driver (thin)</DriverType>
<Properties>
package com.dom.benchmarking.swingbench.testcollection;
import com.dom.benchmarking.swingbench.event.JdbcTaskEvent;
import com.dom.benchmarking.swingbench.kernel.SwingBenchException;
import com.dom.benchmarking.swingbench.kernel.SwingBenchTask;
import com.dom.util.RandomUtilities;
import java.sql.Connection;
import java.sql.PreparedStatement;
package com.dom.benchmarking.swingbench.testcollection;
import com.dom.benchmarking.swingbench.event.JdbcTaskEvent;
import com.dom.benchmarking.swingbench.kernel.SwingBenchException;
import com.dom.benchmarking.swingbench.kernel.SwingBenchTask;
import com.dom.util.RandomUtilities;
import java.sql.Connection;
import java.sql.PreparedStatement;