Skip to content

Instantly share code, notes, and snippets.

View Syquel's full-sized avatar

Frederik Boster Syquel

View GitHub Profile
@Syquel
Syquel / 00-start-podman-env.sh
Created February 26, 2024 09:50
Rootless Podman-In-Podman
#!/usr/bin/env bash
set -eEuf -o pipefail
# Start the initial Podman environment
podman run \
-it --rm \
--userns host \
--cap-drop ALL --security-opt "label=disable" --security-opt no-new-privileges --security-opt "unmask=ALL" --security-opt "seccomp=unconfined" \
--cap-add CAP_SETFCAP,CAP_SETUID,CAP_SETGID,CAP_DAC_OVERRIDE,CAP_SYS_CHROOT \
--device /dev/fuse --device /dev/net/tun \
@Syquel
Syquel / deploy-webapp.sh
Last active May 2, 2023 10:42
Kubernetes Static Website Deployment with NginX
#!/usr/bin/env bash
set -eEuf -o pipefail
apk add --no-cache curl jq
readonly APP_DEPLOY_DIR="/app"
readonly LAST_MODIFIED_CACHE_FILE="${APP_DEPLOY_DIR}/.deploy_lastmodified"
readonly LOCAL_ARTIFACT_PATH="artifact.zip"
readonly GH_API_URL='https://api.github.com/repos/gchq/CyberChef/releases/latest'
echo "Reading cached last-modified"
@Syquel
Syquel / convert-to-dash.sh
Last active July 21, 2021 15:51
FFMPEG DASH Converter
#!/bin/bash
set -euf -o pipefail
#### Constants ####
declare -r FFMPEG_CMD="C:\Programs\ffmpeg\bin\ffmpeg.exe"
declare -r INPUT_FORMAT="hevc"
#### Functions ####
function log_info() {
local msg=${1}
@Syquel
Syquel / AbstractController.java
Last active November 19, 2020 12:54
Spring Data to Spring WebMVC HAL Integration
package de.syquel.spring.web.hal.controller;
import java.io.Serializable;
import java.net.URI;
import java.util.List;
import java.util.function.Function;
import javax.validation.constraints.NotNull;
import de.syquel.spring.web.hal.dao.entity.AbstractEntity;
import de.syquel.spring.web.hal.exception.ResourceExistsException;
OpenSSL 1.1.1f 31 Mar 2020
built on: Tue Sep 15 17:04:36 2020 UTC
options:bn(64,64) rc4(char) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -Wa,--noexecstack -Wall -Wa,--noexecstack -g -O2 -fdebug-prefix-map=/build/openssl-VowUVY/openssl-1.1.1f=. -fstack-protector-strong -Wformat -Werror=format-security -DOPENSSL_TLS_SECURITY_LEVEL=2 -DOPENSSL_USE_NODELETE -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DVPAES_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM -DNDEBUG -Wdate-time -D_FORTIFY_SOURCE=2
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
md2 0.00 0.00 0.00 0.00 0.00 0.00
mdc2 0.00 0.00 0.00 0.00 0.00 0.00
md4 29367.93k 93705.32k 231446.78k 366087.85k 439653.72k 446540.46k
md5 44360
package de.syquel.core.entity;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
@Syquel
Syquel / unbound_block_list_generator.sh
Created May 3, 2020 17:22
Block List Generator for Unbound DNS Server
#!/bin/bash
set -euf -o pipefail
# readonly LAST_MODIFIED_MARKER_SUFFIX=".lastmodified"
readonly AWK_HOSTS_BUILDER_BASE=$(cat <<"EOT"
BEGIN { split(WHITELIST, whitelist); for (i in whitelist) whitedict[tolower(whitelist[i])]++ }
{ sub(/\r$/, "", $NF); $2 = tolower($2) }
NF==2 && $2 && !/^#/ && !($2 in whitedict) && !visited[$2]++
EOT
)
@Syquel
Syquel / !simple_ini_parser.sh
Last active April 22, 2020 11:46
A simple INI file parser library written in Bash
#!/bin/bash
set -euf -o pipefail
SCRIPT_PATH=$(dirname "${BASH_SOURCE[0]}")
# shellcheck source=./script_base.sh
source "${SCRIPT_PATH}/script_base.sh"
#### Include-Guard
## This module must only be loaded once in another script
if [ "${p_SimpleIniParser_Imported+defined}" = "defined" ]; then
@Syquel
Syquel / certbot-ecdsa.sh
Created August 6, 2019 20:34
A script to setup ECC / ECDSA certificates with Certbot including automatic renewal support.
#!/bin/bash
set -euf -o pipefail
## Prerequisites
# This script assumes lexicon-dns to be installed and configured for your specific DNS provider
# for the Let's Encrypt DNS-challenge.
# Further it is assumed that the lexicon-dns certbot-hook is installed under ${CONF_BASE_PATH}/renewal-hooks/manual/lexicon.sh .
# The lexicon-dns hook for certbot can be downloaded from https://github.com/AnalogJ/lexicon/blob/master/examples/certbot.default.sh .
# Make sure to adjust the variables in the section "Configuration" according to your installation.