Posts

Multiprocessing

Parallel Processing i recently read an article about parallel processing. i remembered my domain checker service which checks a lot of domains for their availablitly, and this script runs sequentiel and needs around 30 seconds. initially i worked on a caching mechanism to speed up results. but if a service is not used that often (nobody is useing my domain checker…), there is not much you can gain with caching.

SOA Checker

Intro this is a little script which reads the Name Servers for a given Domain, and then asks the NameServer for the SOA of this Domain. Script cat << 'EOF' > soachecker.sh #!/usr/bin/env bash # Little SOA & Serial Checker, v0.1, @stoege tmpfile=$(mktemp) # Check Args echo if [ $# -eq 0 ]; then d="stoege.net" echo -e "No argument provided. use \033[1m'${d}'\033[0m" elif [ $# -eq 1 ]; then d="$1" echo -e "Domain \033[1m'${d}'\033[0m provided" else echo -e "\033[1mmore than one arguments provided.

acme.sh

Certificate Management with ‘acme.sh’ I like to manage my certificates on my own. If you work with Wildcard Certs, acme.sh is a nice and flexible ACME Client, purely written in Shell. It’s probably the easiest & smartest shell script to automatically issue & renew the free certificates. Basic Handling Get Version acme.sh --version run it # acme.sh --version https://github.com/acmesh-official/acme.sh v3.0.6 Upgrade Self are we up2date ? acme.sh --upgrade run it

Python - Redirector

Redirector App wrote a little redirector app and tought i will explain and share it here. it’s a bit like a url shortener, but you can define the “shortcut” of the URL. how does it work it basically consists of a Text File wir Redirection URL’s. redi.txt stoege,https://www.stoege.net blog,https://blog.stoege.net test,https://www.test.com Call it so, when you open a Browser and Request the URL: https://your.domain.de/blog, you get redirected to https://blog.stoege.net main.app from flask import Flask, redirect, request import datetime import os import random # Vars redirect_file="redi.

HTMX & Nginx

Little Test with HTMX & Nginx recently, i saw the Keynote - “Full-Stack Python” (Andy “Pandy” Knight) and i read an article about html & websockets. So I thought why not give it a try? Preview Requirements the usual stuff: Virtual Machine (here: OpenBSD VM) FQDN Pointing to your Box SSL Cert Webroot on your webserver, create a new webroot wherever you have your pages located. su - webmaster mkdir -p /var/www/virtual/your.

OpenBSD - Smokeping

How to Install Smokeping on OpenBSD Requiremens running Server with OpenBSD Root Permission FQDN with Cert Install Software pkg_add smokeping Update Config cat << 'EOF' >/etc/smokeping/config *** General *** owner = YOUR NAME contact = YOUR@EMAIL.NET mailhost = localhost sendmail = /usr/sbin/sendmail # NOTE: do not put the Image Cache below cgi-bin # since all files under cgi-bin will be executed ... this is not # good for images. imgcache = /var/www/htdocs/smokeping/cache imgurl = cache datadir = /var/db/smokeping piddir = /var/run cgiurl = https://YOUR.

Anycast IPv6 - YourSelf

How to Build your own AnyCast Network you’re using anycast every day. all public resolvers (1.1.1.1, 8.8.8.8, 9.9.9.9) for example are anycast ip’s and hence, many servers distributed around the world which listen and announce the same ip address. we can build a proof of concept, how to build such a network, for a few $. Requirements AS Number Anycast heavily depends on BGP. So, you need a own AS Number.

Docker - IPv6

got Docker running with Traefik as ingress Loadbalancer ? Just enable IPv6 like this. daemon.json cat << EOF > /etc/docker/daemon.json { "ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64" } EOF Restart Services systemctl reload docker Check Netstat # netstat -tulpen |grep docker tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 15788 977/docker-proxy tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 17495 952/docker-proxy tcp6 0 0 :::80 :::* LISTEN 0 15791 984/docker-proxy tcp6 0 0 :::443 :::* LISTEN 0 15773 963/docker-proxy Any Comments ?

OpenBSD - HTTPD CGI

Let’s have a look a the old and simple “cgi-bin” stuff on OpenBSD. The Webserver is written by the OpenBSD Guys, and it runs in a chrooted environment. switch to cgi-bin dir cd /var/www/cgi-bin/ ip.cgi create the file under /var/www/cgi-bin called ‘ip.cgi’ cat << 'EOG' > ip.cgi #!/bin/sh cat << EOF Content-type: text/html <html><head> <title>IP: $REMOTE_ADDR</title> </head><body> <p>Your IP address is: $REMOTE_ADDR</p> </body></html> EOF EOG Set Owner & Permission chmod 500 ip.

OpenBSD - PHP 8.2

Running PHP on OpenBSD yes, i know … it’s not rocket science .. but why not make a short post so other (or myself) can have a quick look if needed ? pkg_info -Q php pkg_add php--%8.2 pkg_add php-sqlite3--%8.2 pkg_add php-curl--%8.2 Set TimeZone and allow short open tags sed -i s'#date.timezone = UTC.*#date.timezone = Europe/Zurich#' /etc/php-8.2.ini sed -i s'#short_open_tag = Off.*#short_open_tag = On#' /etc/php-8.2.ini Install all Modules if needed .. does not make sense for me :(