Skip to content

Instantly share code, notes, and snippets.

View Schm1tz1's full-sized avatar
🇺🇦
#StandWithUkraine

Roman Schmitz Schm1tz1

🇺🇦
#StandWithUkraine
View GitHub Profile
@Schm1tz1
Schm1tz1 / WireGuard-site-to-site.md
Created May 2, 2024 20:10
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@Schm1tz1
Schm1tz1 / README.md
Created August 9, 2023 14:36 — forked from christophschubert/README.md
Docker compose environment to start Confluent REST Proxy and produce some message using JSON

Docker compose environment with Confluent REST Proxy and Control Center

Usage

docker compose up -d 
# please be patient...
@Schm1tz1
Schm1tz1 / protobuf-serialization.md
Created June 30, 2023 14:10 — forked from kchristidis/protobuf-serialization.md
Notes on protocol buffers and deterministic serialization (or lack thereof)

There doesn't seem to be a good resource online describing the issues with protocol buffers and deterministic serialization (or lack thereof). This is a collection of links on the subject.

Protocol Buffers v3.0.0. release notes:

The deterministic serialization is, however, NOT canonical across languages; it is also unstable across different builds with schema changes due to unknown fields.

Maps documentation:

Wire format ordering and map iteration ordering of map values is undefined, so you cannot rely on your map items being in a particular order.

@Schm1tz1
Schm1tz1 / Caddyfile
Last active June 23, 2023 10:43
Local Docker Registry with UI and Reverse Proxy
(auth) {
basicauth {
docker $2a$14$YzNJVypCD8tl3PidqRs.N.qI1pVMIAGDyAEAnJ/Kwb.bRCId1Hdrq
}
}
https:// {
import auth
reverse_proxy registry-ui:80
tls /etc/caddy/docker-registry.pem /etc/caddy/docker-registry.key
@Schm1tz1
Schm1tz1 / dnsmasq.conf
Created June 23, 2023 06:30 — forked from NAR8789/dnsmasq.conf
wildcard dns for docker-compose using dnsmasq
# explicitly define host-ip mappings
address=/myapp.local/172.16.1.2
# dnsmasq entries are always wildcard entries, so this maps both myapp.local and *.myapp.local
# (yes, it's fine for this to be your entire dnsmasq config. the defaults are pretty sensible)
@Schm1tz1
Schm1tz1 / Postman-to-Insomnia.md
Last active August 10, 2023 12:41
Migrating from Postman to Insomnia

Migration from Postman to Insomnia

This describes the steps I performed for my Migration from Postman to Insomnia which I did for several reasons (open vs. closed source, UI and handling, usage of proxies in corporate environments...)

Postman Export

  • You need to export each collection / environemnt on its onw. Please select a version that is supported by Insomnia (currently v2). Currently there is no tool for batch-conversion of the dumps so you need to perform this step.

Conversion of Environment Exports

  • Postman exports enviroments with quite some metadata - e.g.:
@Schm1tz1
Schm1tz1 / Postman-Insomnia-Proxy-SSH-Tunnel.md
Last active June 21, 2023 09:07
Postman / Insomnia with Proxy based on SSH-tunnel

Postman / Insomnia with Proxy based on SSH-tunnel

In general, ssh is a powerful tool when it comes to tunneling and (reverse) proxying. All proxy functionalities offered by dynamic port formwarding with -D (or the reverse -R) are limited to SOCKS proxies.

Postman

Postman only supports HTTP proxies. One way to solve this is using https://github.com/oyyd/http-proxy-to-socks.

  • Installation and example usage:
@Schm1tz1
Schm1tz1 / download_julieops_latest.sh
Last active May 11, 2023 06:38
Download latest version of JulieOps
#!/usr/bin/env bash
echo "Downloading latest release of Julie Ops..."
curl -s https://api.github.com/repos/kafka-ops/julie/releases/latest \
| grep -e "browser_download_url.*FAT.jar.zip" \
| cut -d ":" -f2,3 | tr -d \" \
| wget -q --show-progress -O julie-ops.jar -i -
@Schm1tz1
Schm1tz1 / README.md
Last active June 7, 2023 06:12
Maven POM examples to create a (fat) JAR with all dependencies for an example project as well as a directory of dependencies (examples here: Sentry for log4J v1 and a custom connector in Clojars Artifactory)

Maven Examples for fat JARs

Maven POM examples to create a (fat) JAR that will pull all dependencies for example projects. It will also create a directory of dependencies.

Examples here: Sentry for log4J v1 and a custom connector in Clojars Artifactory

Usage Example

Run Maven:

mvn package --file pom-clojars.xml
@Schm1tz1
Schm1tz1 / args_script_template.sh
Created April 4, 2023 07:13 — forked from rragundez/args_script_template.sh
Template of bash script with mandatory and optional arguments
#!/bin/bash
set -e
usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS]
Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml
where:
-h show this help text
-i google cloud project id
-v name of instance/virtual machine
-p python path