Skip to content

Instantly share code, notes, and snippets.

View SIMULATAN's full-sized avatar
🐳
dockerized my brain (forgot to expose the ports tho..)

Jakob Hofer SIMULATAN

🐳
dockerized my brain (forgot to expose the ports tho..)
View GitHub Profile
@SIMULATAN
SIMULATAN / fuck-you-quarkus.md
Last active March 31, 2024 20:16
quarkus sucks, here's why

Introduction

Yes, I know, a lot of these problems may not be caused by quarkus but rather other tools in the stack. However, I still cound them here since quarkus makes it extra hard to fix them.

Problems

reactive everything

Reactive as a concept sounds quite appealing. Yay, performance, am i right? In practice however, this rarely is worth the hassle. Just look at this abomination of a function.

monitor=eDP-1,auto,auto,1
# XDG
env = XDG_SESSION_TYPE,wayland
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_DESKTOP,Hyprland
# Toolkit Backend
env = SDL_VIDEODRIVER,wayland
env = GDK_BACKEND,wayland,x11
@SIMULATAN
SIMULATAN / cached_store.ts
Created August 6, 2023 19:15
svelte store that has caching or something
import type { Options as BaseOptions } from './persisted_store'
import type {Unsubscriber, Updater, Writable} from "svelte/store";
import {persisted} from "./persisted_store";
export interface Options<T> extends BaseOptions<CachedState<T>>{
/** The time in milliseconds to cache the value for */
cacheTime: number,
/** The value getter function */
getter: () => Promise<T>
}
@SIMULATAN
SIMULATAN / docker-compose.yml
Created March 15, 2023 15:05
Node-Exporter in Docker
services:
node-exporter:
image: prom/node-exporter:latest
command:
- '--path.rootfs=/host'
pid: host
volumes:
- '/:/host:ro,rslave'
@SIMULATAN
SIMULATAN / show-restart-policies.sh
Created February 28, 2023 09:43
Show a list of docker container names and their respective restart policies
docker ps -a --format json | jq -r '.ID' | xargs -I {} 'docker' inspect {} | jq -r '.[] | "\(.Name[1:]): \(.HostConfig.RestartPolicy.Name)"'
@SIMULATAN
SIMULATAN / Dockerfile
Created January 26, 2023 11:16
Dockerized Firefox (shared X-Server)
FROM debian:bullseye-slim
COPY docker-entrypoint.sh .
RUN apt-get update && apt-get install -y firefox-esr xauth
ENTRYPOINT /docker-entrypoint.sh
@SIMULATAN
SIMULATAN / get-open-ports.sh
Created October 19, 2022 14:10
Get all ports you can access from inside of a network to the outside. Useful if ports are blocked by your sysadmin and you need to find out what ports you can put your services on to access them.
#!/bin/bash
function scan() {
# stdin will be parsed by the script
# stderr is just for debugging purposes and to see the process while running the script
curl "http://portquiz.net:$1" &>/dev/null && echo "$i" && echo "$i" >&2
}
function scanAll() {
for i in {0..69420}; do
@SIMULATAN
SIMULATAN / bool.rhai
Last active July 6, 2022 07:21
Dotter Blog Post
# add this to your .dotter/global.toml file:
# [helpers]
# bool = ".dotter/helpers/bool.rhai"
#
# use like this:
# bool my_condition
if params[0] == true || params[0] == "true" {
"true"
}
@SIMULATAN
SIMULATAN / install-docker.sh
Created February 28, 2022 12:03
A simple script that just performs the official debian installation commands from the docker website - START AS ROOT!
apt-get remove docker docker-engine docker.io containerd runc -y
apt-get update -y
apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
@SIMULATAN
SIMULATAN / BADGE.MD
Last active January 5, 2022 18:47
Discord Readme Badge

My Discord (505713760124665867)

This is how you make a permanent Link to your Discord User in any markdown file you want (as seen above)!

[![My Discord (YOURUSERID)](https://img.shields.io/badge/My-Discord-%235865F2.svg)](https://discord.com/users/YOURUSERID)

Explanation: a image link to a static shields.io badge with the "My Discord" description wrapped into a link to a discord url that opens your user in the app