Skip to content

Instantly share code, notes, and snippets.

View szepeviktor's full-sized avatar
🍓
Guess I'm the lone ranger keeping it all running.

Viktor Szépe szepeviktor

🍓
Guess I'm the lone ranger keeping it all running.
View GitHub Profile
@szepeviktor
szepeviktor / science-songs.md
Created July 20, 2026 22:34
Miért ritkák a tudományos ténydalok? - Why Are Songs About Scientific Facts So Rare?

Szerintem nem azért ritka, mert ne lehetne jó, hanem mert a dalírás és a tudományos pontosság eltérő irányba húz.

A fő okok

1. A dal általában érzelmet akar kiváltani, nem információt átadni. A legtöbb hallgató kapcsolatokról, veszteségről, vágyról, identitásról akar dalt hallani. Egy plagioklász összetétele önmagában kevés embernek személyesen fontos.

2. A tudományos állítások rosszul tűrik a dalszöveges tömörítést. Egy szerelmes mondatot húszféleképpen át lehet fogalmazni. Egy ásvány képletét vagy egy fizikai törvényt nem. Ha a rím vagy a ritmus kedvéért módosítják, könnyen hamis lesz.

@szepeviktor
szepeviktor / fix-rest-batch.php
Last active July 25, 2026 00:46
Temporary mitigation for chained RCE in WordPress core: CVE-2026-60137 and CVE-2026-63030
<?php
/*
* Plugin Name: Fix REST Batch
* Description: Rejects malformed REST batch paths before affected WordPress core versions process them.
*/
declare(strict_types=1);
namespace SzepeViktor\FixRestBatch;
@szepeviktor
szepeviktor / lsb-base-logging.sh
Last active July 18, 2026 04:08
PHP-FPM: Suppress the normal "Reopening PHP FastCGI Process Manager logs" message
# /etc/lsb-base-logging.sh
log_daemon_msg_pre()
{
# Suppress the normal "Reopening PHP FastCGI Process Manager logs" message
case "${1:-}:${2:-}" in
Reopening*logs:php-fpm*)
/usr/bin/logger -p daemon.notice -t "$2" -- "$1"
exec >/dev/null
;;
esac
@szepeviktor
szepeviktor / cf7-robot-trap.php
Last active May 15, 2026 11:42
Contact Form 7 Robot Trap
<?php
/*
* Plugin Name: Contact Form 7 Robot Trap
* Description: Adds a hidden trap field to Contact Form 7.
* Version: 0.6.0
* Plugin URI: https://wdmarket.com/
* Author: WD Market
* Requires PHP: 7.4
* Requires at least: 6.7
@szepeviktor
szepeviktor / apache.conf
Created May 1, 2026 22:13
WordPress deserves no CSP policy
# CSP policy
<LocationMatch "^/olm/wp-admin/">
Header always set Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data: blob: https://ps.w.org https://secure.gravatar.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; form-action 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; report-uri /csp-report.php"
</LocationMatch>
@szepeviktor
szepeviktor / shortcoder.php
Last active March 29, 2026 21:58
Indent WordPress shortcodes - useful for inspecting page builder post_content
#!/usr/bin/env php
<?php
$skeletonOnly = in_array('--skeleton', $argv, true);
$input = stream_get_contents(STDIN);
preg_match_all('/\[(\/?)([a-zA-Z_][\w-]*)([^\]]*?)(\/?)\]/', $input, $shortcodeMatches, PREG_OFFSET_CAPTURE);
function extractAttributeNames($attributeText) {
preg_match_all('/([a-zA-Z_][\w:-]*)\s*=\s*(?:"[^"]*"|\'[^\']*\'|[^\s\]]+)|([a-zA-Z_][\w:-]*)/', $attributeText, $attributeMatches);
@szepeviktor
szepeviktor / billingo-attacher.py
Created March 11, 2026 12:42
Attach Billingo.hu PDF invoices, to be used in an email pipe
#!/usr/bin/env python3
import sys
import re
import copy
import syslog
import gzip
import zlib
import subprocess
import urllib.request
@szepeviktor
szepeviktor / chatgpt-prompt.txt
Last active January 11, 2026 13:18
TVB News összefoglaló ChatGPT-vel https://www.youtube.com/@tvbnewsofficial
Feladat: TVB News screenshot képeken azonosítsd és olvasd le a subtitle-ot, majd készíts hírösszefoglalót.
Módszer: KIZÁRÓLAG belső látás, OCR-t/telepítést/extra szoftvert TILOS használni. Tilos zoom-olni, már eleve tökéletesek a képek.
INPUT:
- minden egyes képen: contact_sheet 3×40 subtitle kép, csak a videó I-frame-jeiből készült.
CÉL: Minél kevesebb “próbálkozással” dolgozz:
1) Előszűrés: van contact_sheet, AZT használd elsőként arra, hogy gyorsan kiszúrd, mely frame-eken van a keresett felirat.
2) Csak ezeket a frame-eket olvasd el részletesen; minden mást azonnal SKIP-eld.
swagger: "2.0"
info:
description: |
This is the contract for Vies on-the-Web endpoints. The checkVat service supports exact and approximate matching at the same time.
In order to retrieve the requestIdentifier, the information about requesterMemberStateCode and requesterNumber have to be provided.
version: "1.0.0"
title: "Vies on-the-Web Endpoint"
produces:
- "application/json"
host: "ec.europa.eu"
@szepeviktor
szepeviktor / remove-debug.md
Last active December 5, 2025 16:29
Deletion of WordPress debug tools and log files

Deletion of WordPress debug tools and log files

How to clean up after debugging.

Dummy content

  • posts, pages
  • products
  • orders
  • users