Random snippets of all sorts of code, mixed with a selection of help and advice.
How to access the archived folder in ChatGPT? [closed]
14 November 2025 @ 9:57 am
How to access the archived folder in ChatGPT? I am using the free 5.1 flagship version. I think that it is a UI limitation.
Building the Qt 6.9.2 project on Ubuntu 24.04
14 November 2025 @ 9:57 am
I ran into a problem when building my application for the portable version. I wrote a script to automate the build:
#!/bin/bash
set -e
# ==============================================
APP_NAME="flygenapp"
EXECUTABLE_PATH="/home/cxz/Desktop/CODE/GITLAB/flygenapp/flygenapp/build/Desktop_Qt_6_9_3-Release/flygenapp"
SOURCE_ROOT="/home/user/repos/flygenapp/flygenapp"
ICON_PATH="$SOURCE_ROOT/img/drone.png"
PACKAGE_DIR="portable_flygenapp"
OUTPUT_ARCHIVE="${APP_NAME}_portable_ubuntu.tar.gz"
QT_ROOT="/home/cxz/Qt/6.9.3/gcc_64"
if [ ! -f "$EXECUTABLE_PATH" ]; then
echo "ERROR: bin not found: $EXECUTABLE_PATH"
exit 1
fi
if ! command -v patchelf &> /dev/null; then
echo "ERROR: patchelf not found!"
exit 1
fi
# ==============================================
if [ -z "$QT_ROOT" ] || [ ! -d "$QT_ROOT/lib" ]; then
QMAKE_PATH=$(which qm
How to use a go package (SDK) locally in another project without pushing it to git for faster development
14 November 2025 @ 9:56 am
I am working on two Go projects at the same time, let's call the first one myApp and the second one my-sdk , both are seperate Golang projects. Both myApp and my-sdk are under development at the same time and it is common for myApp to use the latest version of my-sdk
Current Approach: The current approach is whenever I change my-sdk for fixing a bug or a new feature, I commit and then push to a private remote git repo (on main branch directly since I am the sole developer). I then add a new tag (e.g. v0.3.0) following semver and push it as well.
Then I go to my MyApp's myApp/go.mod and update the dependency version and run go mod tidy to re-install the latest change.
Issue: This approach works but is quite tiresome, it would have been great if both the application and SDK were stable and have infrequent changes bu
"no certificate or crl found" when supplying PEM file constructed from string
14 November 2025 @ 9:56 am
I am using a known-to-be-valid PEM certificate for the purposes of calling an HTTP proxy using Python requests, but since I am in a serverless function environment, I want to create the PEM file in-memory via an environment variable (stored as a string), rather than a file stored on the container. To do that, I have the following code to re-construct the PEM file's contents:
pem_string = os.environ['PEM_STRING']
pem_string.replace(' ', '\n')
pem_string = f'-----BEGIN CERTIFICATE-----\n{pem_string}\n-----END CERTIFICATE-----\n'
Where pem_string is the encoded portion of the PEM file's contents, except when stored as an env var, it loses all of the newlines so I need to inject them back in using the above example.
Next, I write this to a temp file, and then supply the temp file to Python requests vi the "verify" parameter to hopefully get the certificate to work:
with tempfile.NamedTemporaryFile(
terraform issue when i add new value in config map
14 November 2025 @ 9:55 am
I’m trying to add a new record to my ConfigMap. It’s the third time I’ve done this operation – I made the previous edits in dev and stage – but in prod, when I add the record, Terraform tries to remove all the records in data.
This is the code and the issue in the tfplan.
data = {
"APP_NAME" = "Nuovo prod"
"APP_FE_URL" = "https://prod.it"
+ "APP_ENV" = "prod"
and this is the plan
~ resource "kubernetes_config_map_v1" "laravel_env" {
~ data = {
- "APP_NAME" = "Nuovo prod"
- "APP_FE_URL" = "https://prod.it"
- "APP_ENV" = prod
.....
Plan: 1 to add, 9 to change, 0 to destroy.
there is
docker save creates tarball with inconsistent index.json and manifest.json after docker load
14 November 2025 @ 9:54 am
I've found a bug where docker save on Docker Desktop (Windows) creates an inconsistent tarball after a docker load.
How to Reproduce:
docker load -i original.tar (This creates a new image ID, e.g., New-ID, as expected).
docker save -o new.tar my-image:latest
The Bug:
When I inspect new.tar:
manifest.json (legacy format) correctly points to the New-ID.
index.json (OCI format) incorrectly points to the manifest digest from the original.tar.
The Problem (Inconsistent Behavior):
This inconsistent tarball causes different behaviors on different systems:
On my PC (Docker Desktop, Windows): docker load -i new.tar
How to check why HTTP/3 is not working for demo Jetty 12.1 server?
14 November 2025 @ 9:54 am
I run Jetty 12.1.4 demo according to instruction:
https://jetty.org/docs/jetty/12.1/operations-guide/begin/index.html
including enabling HTT/3 protocol as described at:
https://jetty.org/docs/jetty/12.1/operations-guide/protocols/index.html
On console I see that HTTP/3 started:
...
oejs.AbstractConnector:main: Started oejs.ServerConnector@18b30951{SSL, (ssl, alpn, h2, http/1.1)}{0.0.0.0:8443}
oejs.AbstractConnector:main: Started oejs.ServerConnector@22ee7fdc{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
oejqqs.AbstractQuicheServerConnectionFactory:main: HTTP/3+QUIC support is experimental and not suited for production use.
netstat shows that Jetty demo is listening on proper ports: TCP 8433 for HTTP/2 and UDP 8444 to which br
Error on chrome.tabs.onUpdated for Chrome Extensions
14 November 2025 @ 9:53 am
Here's my background.js file:
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.status === "complete" && tab.url && tab.url.includes("youtube.com/watch")) {
const urlParam = new URLSearchParams(new URL(tab.url).search);
chrome.tabs.sendMessage(tabId, {
type: "NEW",
videoId: urlParam.get("v")
});
}
});
But on the Chrome Extensions tab, it gives this error for the first line:
"Uncaught TypeError: Cannot read properties of undefined (reading 'addListener')"
There is no logs on the console. Also, the permissions and service_worker is all done with no problem on the manifest.json. Does anyone know how to fix it?
Failed to bind properties under 'server.address' with helm
14 November 2025 @ 9:53 am
I want to deploy my app on kubernetes with Helm
I have a Ingest Service running with spring boot that is made of two parts
Fiprocessor
Io
Both of this part use the same deployment file and the same Service
spec:
replicas: {{ .Values.ingest.replicas }}
selector:
matchLabels:
app: ingest-{{ .Values.global.branch }}
template:
metadata:
labels:
app: ingest-{{ .Values.global.branch }}
spec:
containers:
- name: fileprocessor
image: "{{ .Values.ingest.fileprocessorRepository }}:{{ tpl .Values.ingest.tag $ }}"
ports:
- containerPort: {{ .Values.ingest.fileprocessorPort }}
envFrom:
- configMapRef:
name: tryphon-config-{{ .Values.global.branch }}
- name: io
image: "{{ .Values.ingest.ioRepository }}:{{ tpl .Values.ingest.tag $ }}"
ports:
- co
Convert PDF to DOCX in Python with tagging, but superscripts (FN) are misrecognized as subscripts during the process
14 November 2025 @ 9:52 am
I was converting pdf to docx using python along with tagging the Paragraphs(for e.g. [P20],[B44] like this ), emphasis( which are <EM>, <EMB>... like this has to be tagged) but I'm unable to capture the superscripts (footnotes) and tag them as well, superscripts are automatically converted into subscripts during conversion so unable to recognize them, also they have to be tagged as <FOOTNOTE 1>... .
1>Since footnotes descriptions are usually found at the end of the Page with corresponding number i tried capturing that 1st and searing for the corresponding number in the same page and compare them if they are same then we can tag but it tagged each and every number in that page. so it's unsuccessful.
def tag_emphasis(span, text):
font = span.get("font", "").lower()
flags = span.get("flags", 0)
is_bold = "bold" in font
is_italic = "italic" in font or "oblique" in font