Skip to content

Instantly share code, notes, and snippets.

@danielstgt
danielstgt / php2shell-triage.sh
Last active October 22, 2026 08:34
PHP2Shell (CVE-2026-109618/109619) read-only triage for Laravel/Forge servers: finds all sites (incl. isolated users, zero-downtime). Hardened fork of gist.github.com/Sairahcaz/2c22b4a68fd5b75e410c7f9f69f485a0
#!/usr/bin/env bash
#
# php2shell-triage.sh
# Read-only triage for PHP2Shell (CVE-2026-109618 / CVE-2026-109619).
# It checks whether your PHP build was in the vulnerable range and looks for
# the few signals an exploitation attempt tends to leave behind.
#
# It never changes anything on the system. It only reads logs and lists files.
# Run as root (or via sudo) so it can read FPM and auth logs:
# sudo bash php2shell-triage.sh [WEBROOT...]
@danielstgt
danielstgt / update.md
Last active April 14, 2025 09:55
Upgrade ImageMagick and Imagick PHP extension

Upgrade ImageMagick Version to 7 with the Imagick PHP extension

Tested on Laravel Forge provisioned server with Ubuntu 22, PHP 8.3 and 8.4

Check the output of the current version, if it's already on v7 then you're done

php -r 'print_r(Imagick::getVersion());'
php8.3 -r 'print_r(Imagick::getVersion());'
php8.4 -r 'print_r(Imagick::getVersion());'
@danielstgt
danielstgt / convert.sh
Last active April 8, 2025 13:56
Convert JPG and PNG to AVIF
setopt extended_glob
for img in *.(#i)(jpg|jpeg|png)
do
if [ -f "$img" ]; then
name="${img%.*}"
if magick "$img" -strip -quality 60 -define heic:avif-speed=0 -define heic:subsample=420 "${name}.avif"
then
echo "🌇 Converted: $img -> ${name}.avif"
@danielstgt
danielstgt / MIGRATION.md
Last active January 7, 2025 11:48
Use Discord for Laravel Error Logging without 3rd party packages

Migration Guide

1) Get the webhook URL for your channel on Discord

Click on the channel settings icon and select integrations.

2) Create a new entry in your .env

LOG_DISCORD_WEBHOOK_URL=<insert-the-webhook-url-here>
@danielstgt
danielstgt / deploy.sh
Created December 18, 2024 00:23
bun install with frozen lockfile (recommended for production)
bun install --frozen-lockfile && bun run build
@danielstgt
danielstgt / README.md
Last active February 20, 2025 16:24
Umami installation/deployment and proxy

Proxy settings for the umami installation

    location / {
        proxy_pass http://127.0.0.1:3000;

        proxy_read_timeout     120;
        proxy_connect_timeout  40;
        proxy_redirect         off;
<template>
<svg>
<use :href="symbolId" />
</svg>
</template>
<script>
export default {
props: ['icon'],
<template>
<svg v-bind="svgAttributes" v-html="svgContent"></svg>
</template>
<script>
export default {
props: ['icon'],
data() {
return {
<template>
<svg
v-bind="svgAttributes"
v-html="svgContent"
>
</svg>
</template>
<script>
export default {
@danielstgt
danielstgt / app.css
Created February 11, 2022 09:22
CSS Home Bar Padding (Tailwind CSS)
@layer utilities {
.pb-safe {
padding-bottom: env(safe-area-inset-bottom);
}
}