Skip to content

Instantly share code, notes, and snippets.

View stefanpejcic's full-sized avatar
:octocat:
Live long and may the source be with you

Stefan Pejcic stefanpejcic

:octocat:
Live long and may the source be with you
View GitHub Profile
@MrErikCodes
MrErikCodes / Dockerfile
Last active October 22, 2026 18:25
PHP2Shell (CVE-2026-109618, CVE-2026-109619): patch the PHP inside a container image before upstream rebuilds it
# Rebuilds an image's PHP from a newer upstream patch release, in place, for a PHP security release
# that lands before the image's maintainers rebuild (PHP2Shell, CVE-2026-109618 and CVE-2026-109619).
# Works on any docker-library based image (php, phpmyadmin, roundcube/roundcubemail, shinsenter/php):
# the image's own configure flags (`php-config --configure-options`), the source checked against
# php.net's SHA-256 and the release managers' GPG keys ($GPG_KEYS, set by the base image). A patch
# release keeps the extension API, so the image's own shared extensions and config load unchanged.
#
# podman build --build-arg BASE=<image> --build-arg PHP_NEW=<version> \
# --build-arg PHP_NEW_SHA256=<sha256 of php-<version>.tar.xz> -t <tag> .
#
@xeubie
xeubie / next-gen-sqlite.md
Last active October 31, 2026 19:01
The next-gen SQLite won't look like SQLite

SQLite was thought of as a toy for many years until we all realized it was actually nice to use a database as a library, even server-side. And yet...

  1. It's a big dependency, despite what you think. In no universe is 150,000 lines of C code "lightweight".
  2. Like with all SQL databases, you have an impedance mismatch: the way you store data in memory is completely different than the table structure a SQL database forces on you, leading to tons of glue code.
  3. It's mutable, so it can't undo or time travel, and it can't read while a write is happening (even in WAL mode...reads can't happen during checkpointing!).

To solve these problems, I'm building a database called xitdb:

  1. At only about 4,000 lines of code with no dependencies, xitdb is actually lightweight. You could reimplement it in another language pretty easily.
  2. It exposes rich data structures rather than a SQL interface, so the API is very similar to the in-memory data structures you already use in your program.
@leandronsp
leandronsp / 001-server.bash
Last active May 21, 2025 10:02
A complete yet simple Web server (with login & logout system) written in Shell Script
#!/bin/bash
## Create the response FIFO
rm -f response
mkfifo response
function handle_GET_home() {
RESPONSE=$(cat home.html | \
sed "s/{{$COOKIE_NAME}}/$COOKIE_VALUE/")
}
@revenkroz
revenkroz / download-geoipdb.sh
Last active December 18, 2025 20:35
Script to download MaxMind DB and extract it immediately
#!/bin/sh
export GEOIP_EDITION='GeoLite2-Country'
export GEOIP_LICENCE_KEY='secret_licence_key'
export GEOIP_TMP_FILE=geoip.tar.gz
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=${GEOIP_EDITION}&license_key=${GEOIP_LICENCE_KEY}&suffix=tar.gz" > $GEOIP_TMP_FILE && \
tar -xzf $GEOIP_TMP_FILE --wildcards "*/${GEOIP_EDITION}.mmdb" --strip=1 && \
rm $GEOIP_TMP_FILE
@stefanpejcic
stefanpejcic / check-websites.py
Created January 8, 2020 09:01
check status codes from a list: http://whois.wporb.com/
from bs4 import BeautifulSoup,SoupStrainer
import urllib.request
import colorama,re,queue,threading
from colorama import Fore
from urllib.parse import *
class check_link():
def __init__(self,address):
self.address=address
def check(self,address):
@chris124567
chris124567 / WHOIS server by TLD List
Last active June 10, 2021 14:26
I used this python script to download whois information for all TLDs from IANA whois server, then used text manipulation and grep to get the data into the format below
MITSUBISHI:whois.nic.gmo
XN--3BST00M:whois.gtld.knet.cn
PW:whois.nic.pw
MUSEUM:whois.nic.museum
AMERICANFAMILY:whois.nic.americanfamily
RMIT:whois.nic.rmit
MOTORCYCLES:whois.afilias-srs.net
PROPERTIES:whois.nic.properties
STUDY:whois.nic.study
LY:whois.nic.ly
@stefanpejcic
stefanpejcic / readme.txt
Created July 21, 2019 10:57
Default readme file for wordpress.org plugin
=== Plugin Name ===
Contributors: (this should be a list of wordpress.org userid's)
Donate link: https://example.com/
Tags: comments, spam
Requires at least: 4.8
Tested up to: 5.3
Stable tag: 5.2
Requires PHP: 5.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
/*global self, document, DOMException */
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
// Full polyfill for browsers with no classList support
if (!("classList" in document.createElement("_"))) {
(function (view) {
"use strict";
@tzhenghao
tzhenghao / my.html
Created January 14, 2019 03:14
SQ Scammer html script
<!DOCTYPE html>
<head>
<meta property="og:image" content="https://www.airlineratings.com/wp-content/uploads/uploads/singapore_airlines_logo-200x.jpg" />
<meta property="og:title" content="Singapore Airlines is giving away Free tickets to celebrate its 70th Anniversary" />
<script type="text/javascript" language="javascript">
var areYouReallySure = false;
var internalLink = false;
if (typeof window.orientation == 'undefined' && screen.width >= 1000){window.location.href = 'http://google.com'; areYouReallySure=true;}
@Bluscream
Bluscream / cloudflare_failover.py
Last active January 5, 2021 09:13
Cloudflare Failover System for free
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Origin: https://gist.github.com/Bluscream/c0f794186d0236e072b1826987c9390e
from json import dumps, loads
from requests import request
from random import choice
from socket import socket, AF_INET, SOCK_STREAM
domain = "" # Your tld
zone_id = "" # Your zoneid