Populate an arq.connections.RedisSettings
instance from a redis:
connection URL string.
Useful for populating arq WorkerSettings
etc.
# see rkengler.com for related blog post | |
# https://www.rkengler.com/how-to-capture-network-traffic-when-scraping-with-selenium-and-python/ | |
import json | |
import pprint | |
from selenium import webdriver | |
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
capabilities = DesiredCapabilities.CHROME |
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=xxxxxx rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles |
def run_all_tests(): | |
# pytest would be nicer | |
import types | |
for name, member in globals().items(): # NB: not iteritems() | |
if isinstance(member, types.FunctionType) and name.startswith("test_"): | |
print("Run test:", member.__name__) | |
member() | |
if __name__ == "__main__": |
Populate an arq.connections.RedisSettings
instance from a redis:
connection URL string.
Useful for populating arq WorkerSettings
etc.
from collections import defaultdict, OrderedDict | |
import luigi | |
from luigi.task import flatten, getpaths | |
def topological_sorting(struct, outnodes_funct, transform_funct): | |
struct = flatten(struct.keys()) if isinstance(struct, dict) else flatten(struct) | |
visited = OrderedDict() | |
def dvisit(root): |
As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.
The problems and solutions described in the examples below have led to the development of sciluigi,
As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.
The problems and solutions described in the examples below have led to the development of sciluigi,
#!/usr/bin/python | |
from __future__ import print_function | |
from PIL import Image, ImageChops, ImageEnhance | |
import sys, os | |
import threading | |
import argparse | |
parser = argparse.ArgumentParser(description=""" | |
Performs Error Level Analysis over a directory of images |
#!/bin/bash | |
ZM_MKVID=/path/to/zm_mkvid.py | |
ZM_MONITORS='Front_Porch_Substream Rear_Porch_Substream' | |
ZM_EVENTS_DIR=/var/lib/zoneminder/events | |
NOW_STRING=$( date +%Y%m%d-%H%M%S ) | |
DEST_DIR=/path/to/video_archive | |
cd ${DEST_DIR} |
Didn't see this mentioned in docs, so:
To enable HMR:
Append ?hotreload=true
to the page URL (assuming this only works in dev mode)
Example:
http://localhost:8081/index.html?hotreload=true