Use this at the top of all your Bash scripts to avoid problems:
# Exit on error. set -e # Don't allow undefined variable. set -u # Make pipeline fail if any command in it fail. set -o pipefail
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
You can use this check to verify your migrations during CI (no dependency issue and no creation):
pipenv run make migrations if [[ $(git status --porcelain | grep migrations | wc …
Rely on String.prototype.normalize().
const str = "Crème Brulée" str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") > 'Creme Brulee'
Page 1 / 5 »