Skip to content

Instantly share code, notes, and snippets.

# using: rqworker -P /Path/To/Dir/With/NewWorker -w NewWorker.NewWorker -c settings
from rq import Worker
# import CustomLibs
class NewWorker(Worker):
def __init__(self, *args, **kwargs):
# Lets prepare database connection here
# take settings from environment variables, or configuration file
# self.db = CustomLibs.DB.Connect(*settings)
super(NewWorker, self).__init__(*args, **kwargs)
#!/usr/bin/env python
# creates file account_key.json for simp_le.py
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa
from acme import jose
key=jose.JWKRSA(key=rsa.generate_private_key(public_exponent=65537, key_size=4096, backend=default_backend()))
with open('account_key.json', 'wb') as persist_file:
persist_file.write(key.json_dumps())
configoptions="
--enable-cli \
--enable-debug \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-pcntl \
--enable-soap \
@kmadac
kmadac / HowTo.md
Last active December 16, 2022 09:57
Vagrant environment for Ceph cluster

How to prepare dev/test Ceph environment

When you are using Ceph in production, it is important to have environment where you can test your upcoming upgrades, configuration changes, integration of new clusters or any other significant changes without touching real production clusters. Such environment can be simply built with the tool called Vagrant, which can very quickly build virtualized environment describe in one relatively simple config file.

We are using Vagrant on Linux with libvirt and hostmanager plugins. Libvirt is a toolkit to manage Linux KVM VMs. Vagrant can also create virtualized networks to interconnect those Vms as well as storage devices, so you can have almost identical copy of your production cluster if you need it.

Let‘s create 5 nodes Ceph cluster. All nodes First 3 nodes will be dedicated for control node daemons, all nodes will also be OSD nodes (2 x 10gb disks on each node be default), and one node will be client node. Client nodes can be used for