Skip to content

Instantly share code, notes, and snippets.

View defnull's full-sized avatar

Marcel Hellkamp defnull

View GitHub Profile
@defnull
defnull / dl.py
Created October 4, 2012 21:27
Easiest way to download bottle
wget http://bottlepy.org/bottle.py
curl http://bottlepy.org/bottle.py > bottle.py
pip install bottle
easy_install bottle
python -c 'import urllib; open("bottle.py", "wb").write(urllib.urlopen("http://bottlepy.org/bottle.py").read())'
python3 -c 'import urllib.request; open("bottle.py", "wb").write(urllib.request.urlopen("http://bottlepy.org/bottle.py").read())'
Verifying I am +defnull on my passcard. https://onename.com/defnull
'''
For a tree of nested lists with integer leaves, calculate the sum of all leaves.
'''
def recurse(root):
# Slow because it creates a lot of lists (generators are even slower)
return sum([child if isinstance(child, int) else recurse(child) for child in root])
def recurse2(root):
# Faster because less intermediate objects are created.
@defnull
defnull / bbb-broadcast.py
Last active April 21, 2023 18:20
Admin tool to send chat messags to running BBB meetings
#!/usr/bin/env python3
import sys, json, subprocess, time, argparse
"""
Admin tool to send chat messages to running BBB meetings by directly injecting events into the REDIS channel.
This can be used for example to broadcast a maintenance warning message before shuttinng down a server.
Tested with BBB 2.5
Copyright 2022 Marcel Hellkamp
License: MIT
@defnull
defnull / bbb-cluster-notes.md
Created April 4, 2023 11:20
Ansible cluster setup for BBB

How To deploy an anible-role-bigbluebutton cluster with the Proxy Setup

Configuration per BBB node

bbb_lbmode:
  # Loadbalancer domain name (e.g. example.com)
  host: "{{ bbblb_domain }}"
  # Node name (e.g. bbb01, defaults to subdomain)
  name: "{{ bbb_nodename | default(inventory_hostname.split('.')[0]) }}"