Skip to content

Instantly share code, notes, and snippets.

View wwerner's full-sized avatar

Wolfgang Werner wwerner

View GitHub Profile
@wwerner
wwerner / Dockerfile.go.build
Last active March 27, 2024 12:12
Example multi stage docker file for go builds
FROM golang:1.11.2 as build-image
WORKDIR /go/src
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app app.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=build-image /go/src/app .
@wwerner
wwerner / grafana-postgres-datasource.yml
Created April 1, 2021 10:02
Example grafana datasource provisioning for postgreSQL
apiVersion: 1
datasources:
- name: Postgres
type: postgres
url: localhost:5432
database: grafana
user: grafana
secureJsonData:
password: "Password!"
@wwerner
wwerner / Dockerfile
Last active December 22, 2023 10:48
Enable heroku ps:exec in docker containers
FROM openjdk:8-jdk-alpine
VOLUME /tmp
# see https://devcenter.heroku.com/articles/exec#enabling-docker-support
RUN apk add --no-cache curl bash openssh python
ADD src/main/docker/heroku-exec.sh /app/.profile.d/heroku-exec.sh
RUN chmod a+x /app/.profile.d/heroku-exec.sh
ADD src/main/docker/sh-wrapper.sh /bin/sh-wrapper.sh
RUN chmod a+x /bin/sh-wrapper.sh
@wwerner
wwerner / callouts.md
Last active September 25, 2023 12:45
Github Callouts

Note

Highlights information that users should take into account, even when skimming.

More than one line also work.

Important

Crucial information necessary for users to succeed.

Warning

Critical content demanding immediate user attention due to potential risks.

transparent-proxy

Reproducer for gr3p1p3/transparent-proxy#21

  • run yarn
  • run node index.js
  • run curl --proxy localhost:8888 --insecure --proxy-insecure -F "foo=bar" -F"baz=qux" https:/httpbin.org/anything form another shell
  • verify the result contains the form fields foo and baz and their values
  • Comment index.js:L34 and un-comment index.js:L38
  • restart the server

GraphQL introspection query via curl

cat introspection_query.json

{ 
  "query": "query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
@wwerner
wwerner / db.changelog-master.xml
Last active November 20, 2022 09:28
Spring Security DB model w/ ACLs & OAuth2 as Liquibase Changeset. Works at least on H2 & Postgres.
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"
objectQuotingStrategy="QUOTE_ALL_OBJECTS">
<changeSet id="1" author="wwerner">
<comment>Spring Security Authentication - Users, Authorities and ACLs</comment>
@wwerner
wwerner / reading-list.adoc
Last active May 10, 2022 18:41
Reading list for young developers
Table of Contents

The Pragmatic Programmer

Straight from the programming trenches, The Pragmatic Programmer: From Journeyman to Master cuts through the increasing specialization and technicalities of modern software development to examine the core process—what do you do, as an individual and as a team, if you want to

@wwerner
wwerner / mermaid.md
Last active February 17, 2022 10:25
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
Monokai Pro Slack Theme
#2D2A2E,#121016,#FFD866,#2D2A2E,#272822,#D1D2D3,#A9DC76,#FF6188,#2D2A2E,#78DCE8