Skip to content

Instantly share code, notes, and snippets.

View mstaack's full-sized avatar
🎯
Focusing

Max mstaack

🎯
Focusing
View GitHub Profile
@mstaack
mstaack / agent.md
Created June 25, 2026 21:31 — forked from stevebauman/agent.md
My agent.md
  • Never use final classes or private methods/properties
  • Write all code as though it belongs in an official first-party Laravel package. Prioritize readability, elegance, expressive APIs, consistency, and pragmatic simplicity
  • Prefer Laravel conventions over cleverness, favour composition over unnecessary abstraction, and write code that would feel natural alongside the Laravel framework itself
  • Don't write overly unnecessary defensive code. Prefer exceptions to be thrown organically vs catching all possibilities and handling each individually
  • When explaining concepts and/or solutions to bugs, problems, or features, assume I have little or no prior knowledge of the topic unless I have demonstrated otherwise
  • When producing GitHub issue/pull-request titles and descriptions, frame it from the point of view of a developer who knows nothing about the bug/feature/system
@mstaack
mstaack / Caddyfile
Created May 3, 2026 06:23 — forked from devhammed/Caddyfile
Laravel Docker Setup (Caddy, Frankenphp, Queue Worker, Octane, Scheduler, Reverb)
{
{$CADDY_GLOBAL_OPTIONS}
admin {$CADDY_SERVER_ADMIN_HOST}:{$CADDY_SERVER_ADMIN_PORT}
frankenphp {
worker {
file "{$APP_PUBLIC_PATH}/frankenphp-worker.php"
{$CADDY_SERVER_WORKER_DIRECTIVE}
{$CADDY_SERVER_WATCH_DIRECTIVES}
@mstaack
mstaack / ralph-test.sh
Created January 11, 2026 11:32 — forked from mpociot/ralph-test.sh
Ralph for tests
set -e
if [ -z "$1" ]; then
echo "Usage: $0 <iterations>"
exit 1
fi
for ((i=1; i<=$1; i++)); do
echo "Iteration $i"
result=$(claude -p "@test-coverage-progress.txt \
@mstaack
mstaack / 60-sysctl.conf
Created November 25, 2025 16:15 — forked from bouroo/60-sysctl.conf
Kernel tuning for dedicated linux server. /etc/sysctl.d/60-sysctl.conf
# /etc/sysctl.d/60-sysctl.conf
# Generic Web + DB Server Tuning
# Based on original by Kawin Viriyaprasopsook <kawin.v@kkumail.com>
# Apply with: sysctl --system
########################
# Kernel & Memory
########################
# Reduce console noise from kernel messages
kernel.printk = 3 4 1 3
@mstaack
mstaack / deploy.sh
Last active October 27, 2025 11:27
laravel-forge-deploy
$CREATE_RELEASE()
cd $FORGE_RELEASE_DIRECTORY
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
$FORGE_PHP artisan optimize
$FORGE_PHP artisan storage:link
$FORGE_PHP artisan migrate --force
$FORGE_PHP artisan filament:optimize
@props([
'src',
'title' => null,
'alt' => null,
])
@php
preg_match('/.*\/embed\/([^?&\/]+)/m', $src, $matches);
$id = $matches[1];
$alt ??= $title ?? 'Embedded YouTube video';
@mstaack
mstaack / mailpit.sh
Last active August 4, 2025 10:39
install mailpit
#!/bin/bash
set -e
VERSION="v1.27.3"
ARCH="linux-amd64"
ARCHIVE_URL="https://github.com/axllent/mailpit/releases/download/${VERSION}/mailpit-${ARCH}.tar.gz"
TMP_DIR="/tmp/mailpit-install"
BIN_PATH="/usr/local/bin/mailpit"
SERVICE_FILE="/etc/systemd/system/mailpit.service"
@mstaack
mstaack / PVE-host-backup.md
Created April 17, 2025 18:07 — forked from mrpeardotnet/PVE-host-backup.md
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@mstaack
mstaack / print-headers-401.go
Created May 13, 2024 07:47 — forked from GauthamBanasandra/print-headers-401.go
A simple HTTP server in Golang which just prints all the headers
package main
import (
"net/http"
"fmt"
"time"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Printf("Request at %v\n", time.Now())