Skip to content

Instantly share code, notes, and snippets.

View ahndmal's full-sized avatar
😔
stand with my homeland Ukraine

Andrii Maliuta ahndmal

😔
stand with my homeland Ukraine
View GitHub Profile
@ahndmal
ahndmal / java-web-server-with-socket.java
Last active December 27, 2021 12:50
java-web-server-with-socket
package test
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
r2dbc:
url: r2dbc:postgresql://Hostname:port/dbname?schema=public
username: xxxx
password: xxx
properties:
sslMode: REQUIRE
pool:
enabled: true
initial-size: 22
max-size: 30
#
# Create a custom JLink runtime
#
FROM adoptopenjdk:16 AS builder
RUN cd /usr/local && \
curl -O https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \
tar xfvz apache-maven-3.6.3-bin.tar.gz && \
rm apache-maven-3.6.3-bin.tar.gz
COPY . /root
RUN export PATH=$PATH:/usr/local/apache-maven-3.6.3/bin && \
@ahndmal
ahndmal / docker-compose-micros3.yml
Last active December 1, 2021 10:52
3 spring boot apps as microservices
version: '3'
services:
micro1-db:
image: sb-micro-1:0.0.1
container_name: sb-micro-1
environment:
- DB_URL=
- R2_USERNAME=
- R2_PASSWORD=
networks:
apiVersion: v1
kind: Secret
metadata:
name: testsecret-tls
namespace: default
data:
tls.crt: base64 encoded cert
tls.key: base64 encoded key
type: kubernetes.io/tls
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-wildcard-host
spec:
rules:
- host: "andmal.cyou"
http:
paths:
- pathType: Prefix
### INGRESS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: http-ingress
spec:
rules:
- http:
paths:
- path: /
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minimal-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
# GraphQL
# Type queries into this side of the screen, and you will
# see intelligent typeaheads aware of the current GraphQL type schema,
# live syntax, and validation errors highlighted within the text.
# We'll get you started with a simple query showing your username!
query {
user(login: "AndriiMaliuta") {
# fetch only owner repos & not forks
repositories(ownerAffiliations: OWNER, isFork: false, first: 100) {