Skip to content

Instantly share code, notes, and snippets.

View casesolved-co-uk's full-sized avatar
💭
Open for business

Richard Case casesolved-co-uk

💭
Open for business
View GitHub Profile
@casesolved-co-uk
casesolved-co-uk / werkzeug
Created January 25, 2025 21:19
Werkzeug problem
# python
@local_manager.middleware
@Request.application
def application(request: Request):
# gunicorn error
Traceback (most recent call last):
File "/home/rich/v14/env/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 134, in handle
self.handle_request(listener, req, client, addr)
File "/home/rich/v14/env/lib/python3.11/site-packages/gunicorn/workers/sync.py", line 177, in handle_request
@casesolved-co-uk
casesolved-co-uk / opencore-T470s-minimal.txt
Created September 12, 2024 01:52
Opencore hackintosh 1st sparse EFI attempt - boot loop
00:000 00:000 BS: Starting OpenCore application...
00:000 00:000 BS: Booter path - \EFI\BOOT\BOOTX64.EFI
00:000 00:000 OCFS: Trying to locate filesystem on D5129218 D5101F98
00:000 00:000 OCFS: Filesystem DP - \EFI\BOOT\BOOTX64.EFI
00:000 00:000 BS: Trying to load OpenCore image...
00:000 00:000 BS: Relative path - EFI
00:000 00:000 BS: Startup path - EFI\OpenCore.efi (0)
00:000 00:000 BS: Fallback to absolute path - EFI\OC\OpenCore.efi
00:000 00:000 BS: Read OpenCore image of 843776 bytes
00:000 00:000 OCM: Loaded image at D5101918 handle
@casesolved-co-uk
casesolved-co-uk / opencore.txt
Created September 12, 2024 00:39
Hackintosh Lenovo T470s fail to install - after a while outputs garbage to log and complains a lot about NVMe and GXBI I think
00:000 00:000 BS: Starting OpenCore application...
00:000 00:000 BS: Booter path - \EFI\BOOT\BOOTX64.EFI
00:000 00:000 OCFS: Trying to locate filesystem on D5129218 D5101F98
00:000 00:000 OCFS: Filesystem DP - \EFI\BOOT\BOOTX64.EFI
00:000 00:000 BS: Trying to load OpenCore image...
00:000 00:000 BS: Relative path - EFI
00:000 00:000 BS: Startup path - EFI\OpenCore.efi (0)
00:000 00:000 BS: Fallback to absolute path - EFI\OC\OpenCore.efi
00:000 00:000 BS: Read OpenCore image of 845400 bytes
00:000 00:000 OCM: Loaded image at D5100E98 handle
@casesolved-co-uk
casesolved-co-uk / ssh-git.sh
Created August 25, 2024 22:41
Shell file for creating git server - restricts ssh commands to git only (probably not totally secure)
#!/bin/bash
# To force particular keys to only use git, prefix their entry on authorized_keys with:
# command="/home/user/ssh-git.sh" ssh-ed25519 AAAAC3NzaC....
# Only allows git commands
if [ -z "$SSH_ORIGINAL_COMMAND" ] || [ "$SSH_ORIGINAL_COMMAND" = "${SSH_ORIGINAL_COMMAND#git-}" ]; then
echo "Sorry, only git allowed"
else
client_arr=( ${SSH_CLIENT} )
client_ip=${client_arr[0]}
@casesolved-co-uk
casesolved-co-uk / colab_gdrive.py
Created May 12, 2024 07:11
Google Colab local runtime Google Drive upload and download using pydrive2
class GDrive:
"""
Class that allows file upload and download from a 'mounted' GDrive folder
using pydrive2 in a local Google colab runtime
Usage:
First create and copy your settings.yaml according to this:
https://docs.iterative.ai/PyDrive2/oauth/
Then copy this code as a file and import or copy/paste
@casesolved-co-uk
casesolved-co-uk / Comparison Espressif ESP MCUs.md
Created October 25, 2023 11:55 — forked from sierses/Comparison Espressif ESP MCUs.md
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@casesolved-co-uk
casesolved-co-uk / swap.sh
Created May 7, 2023 14:08
Linux swap usage by process
#!/bin/bash
# Get current swap usage for all running processes
# Erik Ljungstrom 27/05/2011
# Modified by Mikko Rantalainen 2012-08-09
# Pipe the output to "sort -nk3" to get sorted output
# Modified by Marc Methot 2014-09-18
# removed the need for sudo
SUM=0
OVERALL=0
@casesolved-co-uk
casesolved-co-uk / domain_search.sh
Last active March 11, 2023 12:44
brute force all subdomain names using dig up to certain length
#!/usr/bin/env bash
# Copyright (c) 2023, CaseSolved.co.uk
if [ -z "$1" ]; then
echo "supply hostname character length"
exit 1
fi
clength="$1"
if [ -z "$2" ]; then
@casesolved-co-uk
casesolved-co-uk / server-rclone.sh
Last active February 15, 2023 14:40
Whole linux server offsite backup using rclone (Ubuntu 22.04)
#!/usr/bin/env bash
# Copyright (c) 2023, CaseSolved.co.uk
# Whole linux server offsite backup using rclone (Ubuntu 22.04)
# tar should achieve roughly 50% compression
read -r -d "" usage << EOM
arg1: rclone remote
arg2: remote directory
optional:
@casesolved-co-uk
casesolved-co-uk / README.md
Last active November 6, 2023 16:28
frappe ERPNext environment requirements pre-requisites

These are either the official advertised versions, recommended or known working versions:

frappe version year postgres mariadb redis nginx node.js yarn python wkhtmltopdf bench ubuntu
v15 2023 14 10.6 6 1.18 18 1.22 3.10 0.12.6 5.19.0 22.04
v14 2022 12-14 10.6 6 1.14 14 1.22 3.10 0.12.6 ?
v13 2020 9.5 10.3 5 1.14 12 1.12-1.22 3.7 0.12.6 5.8.1
v12 2020 9.5 10.2 5 1.14 8 1.12 3.6 0.12.5 4.1
v11 2018 - 10.0 5 1.14 8 1.12 2.7/3.5 0.12.2 4.0
v10 2017 - 10.0 ? ?