You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to catch exceptions raised by Python worker threads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An example with an oneshot service on systemd. #systemd #systemd.service #oneshot
README
Services declared as oneshot are expected to take some action and exit immediatelly (thus, they are not really services,
no running processes remain). A common pattern for these type of service is to be defined by a setup and a teardown action.
Let's create a example foo service that when started creates a file, and when stopped it deletes it.
In older keyboards, enter and return are 2 different keys. Old Macintosh keyboards set it up so that the Return sends a carriage return \r, while the Enter key sends a linefeed \n. However many computers nowadays do not have separate Return and Enter keys. So what do these keyboards send? While it actually depends on your operating system, its keyboard settings, and the application you're interacting with. Windows applications will generally interpret \r\n as a newline, while Mac OS 9 and earlier interpreted \r as a newline, and finally Unix with Mac OS X and later will interpret \n as a newline. People involved in the technology space will generally use the convention of \n as the newline, with \r as an artifact of computing history.
A similar situation occurs with the Backspace and Del keys. Modern convention has settled on the behaviour wher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setting up Sphinx for generating documentation from DocStrings, leveraging the Napoleon extension.
Sphinx Setup for autodoc
Sphinx is a documentation generator that is the de facto standard for Python projects. The official documentation can be a bit daunting as it includes so many options, it's hard to know where to start.
Note: This Gist was updated on 04/04/2019 to accomodate a newer version of Sphinx, as well as Python 3.7. YMMV!
This document is written with the following presuppositions:
You want to leverage the DocStrings in your Python code.
Basic python HTTP server and manipulation of POST data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable tcpdump for non-root users on Debian/Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters