Skip to content

Instantly share code, notes, and snippets.

View JonasGroeger's full-sized avatar
🏠
Working from home

Jonas Gröger JonasGroeger

🏠
Working from home
View GitHub Profile
@JonasGroeger
JonasGroeger / proxy.jsh
Created December 2, 2021 16:59
JVM HTTP / HTTPS proxy configuration using jshell
import java.net.http.*;
import java.io.*;
var httpClient = HttpClient.newHttpClient();
var httpProxyHost = System.getProperty("http.proxyHost");
var httpProxyPort = System.getProperty("http.proxyPort");
var httpsProxyHost = System.getProperty("https.proxyHost");
var httpsProxyPort = System.getProperty("https.proxyPort");
@JonasGroeger
JonasGroeger / template.sh
Created October 4, 2021 09:13
Bash script template
#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR=$(python -c "import os, sys; print(os.path.dirname(os.path.realpath('${BASH_SOURCE[0]}')))")
echo "Hi!"
@JonasGroeger
JonasGroeger / SSH-Key.md
Created September 28, 2021 17:05
Erstellen eines SSH Keys

Erstellen eines SSH Keys

$ ssh-keygen -t ed25519 -C "[email protected]"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/root/.ssh/id_ed25519): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_ed25519
Your public key has been saved in /root/.ssh/id_ed25519.pub
@JonasGroeger
JonasGroeger / wkr243.md
Last active September 4, 2021 19:58
Direktkandidaten Fürth / Landkreis Fürth zur Bundestagswahl 2021 (Wahlkreis 243)
@JonasGroeger
JonasGroeger / app.py
Created August 10, 2021 14:11
mergeconf
from flask import Flask
import requests
import yaml
app = Flask(__name__)
def combine(a, b):
a = dict(a)
b = dict(b)
@JonasGroeger
JonasGroeger / PGP-Key.md
Last active June 10, 2025 16:33
Erstellen eines GPG Keys

Erstellen eines GPG Keys

$ gpg --expert --full-gen-key
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (7) DSA (set your own capabilities)
   (8) RSA (set your own capabilities)
openapi: 3.0.0
info:
title: Example
version: 1.0.0
paths:
/p:
get:
responses:
'200':
description: Get Person
# iOS: https://apps.apple.com/de/app/vlc-for-mobile/id650377962
# Usage
# 1. Put into Scope (.bashrc or equivalent)
# 2. Enable "Sharing via WiFi" in VLC
# 3. $ upload2vlc 192.168.178.84 test.mp3
upload2vlc() {
local UPLOAD_HOST="$1"
local UPLOAD_FILE="$2"
@JonasGroeger
JonasGroeger / OAuth2GrantTypes.java
Last active April 29, 2020 06:55
OAuth 2 grant types enum for Spring apps
public enum OAuth2GrantTypes {
// See https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/oauth2/core/AuthorizationGrantType.html
AUTHORIZATION_CODE("authorization_code"),
IMPLICIT("implicit"),
PASSWORD("password"),
CLIENT_CREDENTIALS("client_credentials"),
REFRESH_TOKEN("refresh_token");
@JonasGroeger
JonasGroeger / SpringCronExpressionTester.java
Last active July 3, 2024 01:21
Spring Cron Expression Tester (Junit 5)
package de.jonasgroeger;
import org.junit.jupiter.api.Test;
import org.springframework.scheduling.support.CronExpression;
import java.time.LocalDateTime;
import java.time.ZoneId;
class SpringCronExpressionTester {