Skip to content

Instantly share code, notes, and snippets.

View berend's full-sized avatar
💭
working from home

Berend Kapelle berend

💭
working from home
  • esome
  • Hamburg
View GitHub Profile
@berend
berend / docker-compose.yaml
Created April 17, 2024 16:44
mumble server via docker compose
services:
mumble:
image: mumblevoip/mumble-server:latest
container_name: mumble
hostname: mumble
restart: unless-stopped
user: root
environment:
- MUMBLE_CONFIG_SERVER_PASSWORD=hunter2
- MUMBLE_SUPERUSER_PASSWORD=hunter2
@berend
berend / install-wifi.sh
Last active November 17, 2022 18:47
install wifi on rsapberry pi
#!/bin/bash
#set -e
# install-wifi - 03/05/2021 - by MrEngman.
UPDATE_SELF=${UPDATE_SELF:-1}
UPDATE_URI="http://downloads.fars-robotics.net/wifi-drivers/install-wifi"
ROOT_PATH=${ROOT_PATH:-"/"}
WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"}
@berend
berend / update.sh
Created November 15, 2021 17:25
noip update with up-to-date check in a shell script
#!/usr/bin/env bash
# set env variables or directly here
NOIPDOMAIN=<your domain>
NOIPUSER=<your noip update username>
NOIPPASS=<your noip password>
CURRENT_IP=$(dig +short $NOIPDOMAIN | tail -n1)

Installing python on a (more or less) fresh linux mint 20

Do not's

  • do not use system python (unless to install something to get a better python)
  • do not use deasnakes PPA (just system python, but with backports and older versions)

If you use one of these, you don't have a proper pip installed and you get all sorts of problems with pip & virtualenvs

@berend
berend / versioning.py
Last active August 27, 2023 21:45
Versioning with flask blueprint
from flask import Blueprint
from flask import Flask
app = Flask(__name__)
v1 = Blueprint("version1", "version1")
v2 = Blueprint('version2', "version2")
from flask import Blueprint
from flask import Flask
app = Flask(__name__)
v1 = Blueprint("version1", "version1", url_prefix="/v1")
v2 = Blueprint('version2', "version2", url_prefix="/v2")
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "The figo Connect API",
"description": "TODO: Add a description",
"license": {
"name": "MIT",
"url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
@berend
berend / cert.py
Last active January 25, 2017 20:26
Obtain the ssl certificate from a given url and generate the fingerprint for it (SHA1 and SHA256)
from M2Crypto import X509
import ssl
def colon(s):
return ':'.join(s[i:i+2] for i in range(0, len(s), 2))
addr = ("www.example.com", 443)
cert_pem = ssl.get_server_certificate(addr)
x509 = X509.load_cert_string(str(cert_pem), X509.FORMAT_PEM)
@berend
berend / select_to_text_grt.py
Created April 2, 2014 20:55
Workbench Plugin: Execute query to jira formatted table
from wb import *
import grt
import mforms
# define this Python module as a GRT module
ModuleInfo = DefineModule(name="mysql_to_jira",
author="berend.kapelle",
version="1.2")
@berend
berend / main.py
Created October 17, 2013 12:26
Small python programm to reproduce https://github.com/Kozea/WeasyPrint/issues/128
from weasyprint import HTML
html_source ="""
<!DOCTYPE HTML>
<html>
<head>
<title>Weasy</title>
</head>
<body>