commit 633de648a49528fa638c2dedd6ffbd89ef112888
parent ec5877c504e1fb06063fee43d5c5c8e0729c0e89
Author: ling0x <ling0x@users.noreply.github.com>
Date: Fri, 21 Aug 2026 17:19:12 +0100
various commands
Diffstat:
4 files changed, 93 insertions(+), 6 deletions(-)
diff --git a/commands/certbot.txt b/commands/certbot.txt
@@ -0,0 +1,68 @@
+===============================================================================
+Certbot / SSL Certificates
+===============================================================================
+
+1. Check what certificate your origin is actually presenting
+
+# From outside the container, test the origin directly (bypass Cloudflare):
+
+openssl s_client -connect example.com:443 -servername sanctum.co.uk </dev/null 2>/dev/null | openssl x509 -noout -dates -subject
+
+# Or if your origin IP is different from what DNS resolves to:
+
+openssl s_client -connect <your-origin-ip>:443 -servername sanctum.co.uk </dev/null 2>/dev/null | openssl x509 -noout -dates -subject
+
+
+2. Verify your web server config points to the right paths
+
+# For nginx
+grep -r "ssl_certificate" /etc/nginx/conf.d/ /etc/nginx/sites-enabled/
+
+# For Apache
+grep -r "SSLCertificate" /etc/apache2/sites-enabled/
+
+
+3. Check if the certificate files exist and are readable
+
+# Inside the certbot container
+ls -la /etc/letsencrypt/live/example.com/
+
+# Permissions should look roughly like:
+# -rw-r--r-- on the .pem files
+
+
+4. Reload your web server
+
+# Nginx
+docker exec <your-nginx-container> nginx -s reload
+
+# Apache
+docker exec <your-apache-container> apachectl reload
+
+
+5. The most likely culprit: certbot hasn't actually renewed
+
+Try a forced renewal to test the full cycle:
+
+docker exec -it certbot-manager certbot renew --force-renewal
+# Then reload your web server
+
+===============================================================================
+Auto-renewal:
+
+In order to have auto-renewal running in the background, you certbot-manager
+docker container has to be running in daemon mode, then it will continuously
+check for certfificate validity every 12 hours:
+
+docker compose -f compose-renew.yml up --build -d
+
+
+and then dry run renewal to check which domain is due for renewal:
+
+docker exec -it certbot-manager certbot renew --dry-run
+
+
+Make sure the manager is actually running persistently:
+
+docker compose -f compose-renew.yml up -d
+docker compose -f compose-renew.yml logs -f certbot-manager
+\ No newline at end of file
diff --git a/commands/linux.txt b/commands/linux.txt
@@ -1,3 +0,0 @@
-Mount a harddrive to a directory in archlinux:
-
-sudo mount -t exfat /dev/sda1 /mnt/seagate
-\ No newline at end of file
diff --git a/commands/linux_commands.txt b/commands/linux_commands.txt
@@ -0,0 +1,17 @@
+Mount a harddrive to a directory in archlinux:
+
+sudo mount -t exfat /dev/sda1 /mnt/seagate
+
+Delete all files within a folder that is 7+ days old:
+
+To list all the files that are 7+ days old:
+
+find . -type f -mtime +7
+
+To count all the files that are 7+ days old:
+
+find . -type f -mtime +7 | wc -l
+
+To delete all the files that are 7+ days old:
+
+find . -type f -mtime +7 -delete
+\ No newline at end of file
diff --git a/commands/pdf-image.txt b/commands/pdf-image.txt
@@ -14,9 +14,14 @@ Rasterize PDF to reduce its size:
convert -density 200 combined.pdf -quality 90 -compress jpeg combined_raster_hq.pdf
+Convert PDF to PNG:
+
+magick input.pdf output.png
+
=========================================================================
Read PDF in terminal
=========================================================================
sudo pacman -S poppler
-pdftotext -layout file.pdf - | less
-\ No newline at end of file
+pdftotext -layout file.pdf - | less
+