Skip to content

Instantly share code, notes, and snippets.

View legout's full-sized avatar

Volker L. legout

View GitHub Profile
@legout
legout / vps-setup.sh
Last active March 19, 2025 10:26
VPS setup
#!/bin/bash
#--------------------------------------------------------------------#
# NOTE:
#
# I have added an interactive version of this vps setup script.
#
# https://gist.github.com/legout/56ce53a0275413b4c98d01482ca52943
#
#--------------------------------------------------------------------#
@prologic
prologic / weed.yml
Created May 25, 2021 03:07
SeaweedFS Docker Swarm Stack
---
version: "3.8"
services:
master:
image: chrislusf/seaweedfs:latest
command: master -mdir=/data
networks:
- weed
#!/bin/bash
set -ex
apt-get update
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
from __future__ import absolute_import
import signal
import gevent
import gevent.pool
from rq import Worker
from rq.timeouts import BaseDeathPenalty, JobTimeoutException
from rq.worker import StopRequested, green, blue
from rq.exceptions import DequeueTimeout
@lechup
lechup / gevent_rqworker.py
Last active April 10, 2025 10:15
GeventWorker class to use with rq. All credits to https://github.com/jhorman from https://github.com/nvie/rq/issues/303#issuecomment-45304465 comment.
from __future__ import absolute_import
import signal
import gevent
import gevent.pool
from rq import Worker
from rq.timeouts import BaseDeathPenalty, JobTimeoutException
from rq.worker import StopRequested, green, blue
from rq.exceptions import DequeueTimeout
@tanbro
tanbro / attrdict.py
Last active January 17, 2024 14:51
A class with both dictionary and attribute style access to it's data member.
from __future__ import annotations
from typing import Any, Dict, Iterable, Mapping, MutableMapping, MutableSequence, Union
class AttrDict:
"""
A class with both dictionary and attribute style access to it's data member.
It can be used in `RestrictedPython <http://restrictedpython.readthedocs.io/>`_