Researched by Robert Quattlebaum darco@deepdarc.com.
Last updated 2020-02-03.
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
from __future__ import with_statement | |
from kombu import BrokerConnection | |
from collections import defaultdict | |
import gevent | |
from gevent import monkey | |
monkey.patch_all() | |
class WorkerHub(): | |
""" | |
WorkerHub controls the local mailboxes that the @worker decorator assigns. |
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
from django.db.models import Field | |
from django.conf import settings | |
from django.utils.decorators import cached_property | |
class VirtualField(object): | |
""" | |
A virtual field, mainly used for caching and seamless computed field retrieval. | |
This acts both like a (cached) property and a virtual field if supported. | |
""" |
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
#!/usr/local/bin/python | |
from pyPdf import PdfFileWriter, PdfFileReader | |
import random | |
from pprint import pprint as pp | |
import sys | |
# sys.setrecursionlimit(10000000) | |
seed = 'BN9F' | |
pile = [1] | |
def getNumber(): |
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
# MQTT broker configuration | |
mqtt: | |
broker: !secret mqtt_broker | |
username: !secret mqtt_username | |
password: !secret mqtt_password | |
discovery: False # Only if you use the HA API usually | |
id: mqtt_client | |
# Define the room for this ESP32 node | |
substitutions: |
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
blueprint: | |
name: Update notifications | |
description: Send notifications for new updates and install or skip on action | |
homeassistant: | |
min_version: '2022.4.0' | |
domain: automation | |
input: | |
update_entities: | |
name: Update entities | |
description: >- |
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
#include "SpaceshipPawn.h" | |
// Sets default values | |
ASpaceshipPawn::ASpaceshipPawn() | |
{ | |
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it. | |
PrimaryActorTick.bCanEverTick = true; | |
USphereComponent * SphereComponent = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent")); | |
RootComponent = SphereComponent; | |
SphereComponent->InitSphereRadius(40.0f); |
A simple usecase of a Bitcoin compatible coin integration. Not all coins are created equal, so it is possible that extra work must be done to successfully integrate a new cryptocurrency.
- Start the Anoncoin daemon and in the
anoncoin.conf
file add the option "txindex=1"
rpcuser=anoncoinrpc
rpcpassword=MFfySYp9o9qQi0mYbQmxOdE1pEHVS1DQuhhHssOzkO3
rpcport=8022
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.
Create executable file /opt/foo/setup-foo.sh
:
NewerOlder