<div id="comments-section" data-bsky-uri="{{ .Params.bsky }}"></div>
{{ $comments := resources.Get "js/comments.js" }}
<script src="{{ $comments.RelPermalink }}"></script>This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.
Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!
Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly).
All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented.
This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog.
You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom
Hugo is a static site generator: it takes some plain-text content, marries it to a bunch of HTML templates, and produces a set of complete, static HTML pages that can be served by any generic, stand-alone web server. Simple.
Or maybe not. Hugo does a lot of things automatically, relying on conventions and implicit rules, rather than on explicit configuration. For example, it tries to match each piece of content with the most
| import logging | |
| import time | |
| from pprint import pformat | |
| # pretty print logs: https://stackoverflow.com/a/11093247/5628238 | |
| # pformat indent: https://stackoverflow.com/a/29469358/5628238 | |
| # (even needed when using %s string format): do not evaluate complex pformat when log level not printed: https://docs.python.org/3/library/logging.html#logging.Logger.isEnabledFor | |
| # (wrong: complex variable string takes time nevertheless): https://reinout.vanrees.org/weblog/2015/06/05/logging-formatting.html | |
| # https://stackoverflow.com/questions/13131400/logging-variable-data-with-new-format-string | |
| # main script or module |
| _APP_ENV=production | |
| _APP_LOCALE=en | |
| _APP_OPTIONS_ABUSE=enabled | |
| _APP_OPTIONS_FORCE_HTTPS=disabled | |
| _APP_OPENSSL_KEY_V1=your-secret-key | |
| _APP_DOMAIN=localhost | |
| _APP_DOMAIN_TARGET=localhost | |
| _APP_CONSOLE_WHITELIST_ROOT=enabled | |
| _APP_CONSOLE_WHITELIST_EMAILS= | |
| _APP_CONSOLE_WHITELIST_IPS= |
If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.
This should fit most setups (not mine though 😉)
If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.
This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.
DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.
To upgrade WSL, follow these steps,
https://gist.github.com/search?q=user%3A%40me&ref=searchresults
Uses @me to refer to itself in the gist search query.
Type this into Github Gist Search (https://gist.github.com/)
user:BoQsc your search query
| <?php | |
| $streamedResponse = new StreamedResponse(); | |
| $streamedResponse->setCallback(function () { | |
| $spreadsheet = //create you spreadsheet here; | |
| $writer = new Xlsx($spreadsheet); | |
| $writer->save('php://output'); | |
| }); |
| <?php | |
| add_action( 'init', 'my_child_move_legal_checkboxes', 50 ); | |
| function my_child_move_legal_checkboxes() { | |
| // Remove | |
| remove_action( 'woocommerce_review_order_after_payment', 'woocommerce_gzd_template_render_checkout_checkboxes', 10 ); | |
| // Readd before submit button | |
| add_action( 'woocommerce_gzd_review_order_before_submit', 'woocommerce_gzd_template_render_checkout_checkboxes', 10 ); | |
| } |