A common and reliable pattern in service unit files is thus:
NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
#!/bin/env python3 | |
import argparse | |
import base64 | |
import os | |
import re | |
import subprocess | |
import sys | |
from tempfile import mkstemp |
#!/usr/bin/env python3 | |
""" | |
Apply database patches. | |
Applied patches are recorded in the schema_patch table of the database. | |
The dsn to connect to defaults to a local one (empty connection string). It can | |
be chosen using the command line or an environment variable. Patches | |
application is interactive by default. |
""" | |
Custom django checks. | |
H001: Field has no verbose name. | |
H002: Verbose name should use gettext. | |
H003: Words in verbose name must be all upper case or all lower case. | |
H004: Help text should use gettext. | |
H005: Model must define class Meta. | |
H006: Model has no verbose name. | |
H007: Model has no verbose name plural. |
Windows Service with Python 3.5 and pyinstaller
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
import logging import logging.config | |
LOGGING_CONFIG = { | |
'version': 1, # required | |
'disable_existing_loggers': True, # this config overrides all other loggers | |
'formatters': { | |
'simple': { | |
'format': '%(asctime)s %(levelname)s -- %(message)s' | |
}, | |
'whenAndWhere': { |
-- Found at: | |
-- http://www.if-not-true-then-false.com/2009/postgresql-psql-psqlrc-tips-and-tricks/ | |
-- http://opensourcedbms.com/dbms/psqlrc-psql-startup-file-for-postgres/ | |
\set QUIET ON | |
\pset pager always | |
\pset null 'NULL' |
""" | |
Turn a piano MIDI file into a basic 3D animated piano video. | |
See the result here: | |
I am leaving it as a script because it is not tested on enough MIDI files yet. | |
Zulko 2014 | |
This script is released under a Public Domain (Creative Commons 0) licence. |