Guance Learn

Observability questions

Focused answers for definitions, architecture choices, troubleshooting, pricing, and evaluation.

Illustration of Git branches and version history
Technical guide

Find and restore a deleted file in Git

Locate a deletion commit, restore the file from its parent, stage the recovered file, and distinguish committed deletions from working-tree or index changes.

Illustration of Git branches and version history
Technical guide

Find when and by whom a file was deleted in Git

Locate deletion commits, inspect author and committer metadata, recover the previous contents, and choose between restoring one file and reverting a whole commit.

Python programming and application logging
Explainer

Fix “Python.h: No such file or directory”

Find the headers for the Python interpreter building your extension, install matching development packages, and avoid mixing container or interpreter versions.

Python programming and application logging
Explainer

Flatten a nested list in Python

Flatten one level with a comprehension or itertools.chain, and use a list-specific recursive function when the nesting depth varies.

Python programming and application logging
Explainer

Flush Python print output immediately

Use flush=True, stdout.flush(), or unbuffered Python output, and distinguish application buffering from log delivery and durable disk writes.

Illustration of Git branches and version history
Technical guide

Make a local Git branch match the remote

Fetch and reset deliberately when remote contents should replace local work, preserve commits and edits first, and preview optional untracked-file cleanup.

Illustration of server operations and request logs
Explainer

Configure runtime DNS resolution in Nginx

Refresh changing upstream addresses with resolver and variable proxy_pass, or use dynamic upstream resolution on supported Nginx versions.

Illustration of server operations and request logs
Explainer

Redirect HTTP traffic to HTTPS with Nginx

Configure an HTTPS redirect, preserve paths and query strings, make health-check exceptions work, and enable HSTS deliberately.

Illustration of Git branches and version history
Technical guide

Remove Git tracking from a directory initialized with git init

Remove a standalone repository’s .git directory while keeping its files, check local-only work first, and distinguish linked worktrees, submodules, and remote deletion.

Illustration of server operations and request logs
Explainer

Can you recover a private key from an Nginx certificate?

A certificate cannot reveal its matching private key. Locate a saved key, verify the public-key match, or generate a new key and reissue.

Python programming and application logging
Explainer

Get the class name of a Python instance

Use type(obj).__name__ for an instance’s class name, and add the module and qualified name when a short name is ambiguous.

Python programming and application logging
Explainer

Get the current date and time in Python

Read local or UTC time with datetime, obtain Unix timestamps, and use an elapsed-time clock when measuring how long code runs.