Add PYTHONUNBUFFERED=1 in run config or .env (only use .env if you use the plugin). This is meant to immediately view the output of the print function without the need for …
Useful to have a notification when a long command completes.
To enable it, add zbell to your plugins array if you are using oh-my-zsh or source the definition file.
- The minimum time commands must take for the notification to happen, use: ZBELL_DURATION. For instance ZBELL_DURATION …
Use the snippet below to capture and inspect the certificates of a distant site and its chain with requests.
import requests HTTPResponse = requests.packages.urllib3.response.HTTPResponse orig_HTTPResponse__init__ = HTTPResponse.__init__ def new_HTTPResponse__init__(self, *args, **kwargs): orig_HTTPResponse__init__(self, *args, **kwargs …
This will, for instance, allow you to redirect all matching domains to a certain server: dnsmasq will intercept the DNS query and return the ip you specified.
To do this, edit NetworkManager configuration in /etc/NetworkManager/NetworkManager.conf and add in the main section dns=dnsmasq:
You …read more
You can use signals and a context manager to acheive this. The idea is to register a function that will raise an exeption when the alarm signal is received and schedule the alarm signal for the timeout.
import signal from contextlib import contextmanager @contextmanager def timeout(time): # Register a function …read more
Page 1 / 6 »