Skip to content

Instantly share code, notes, and snippets.

xopr /
Last active Jul 21, 2020 NAPTR to CSV/JSON/VCF phonebook generator
#!/usr/bin/env python3
#pip-3 install dnspython
import dns.resolver
import dns.e164
import re
import sys
import optparse
View SPI_slave.ino
// NOTE: make sure you disable the Arduino reset when using as serial terminal
// run: `systemctl enable serial-getty@ttyACM0.service` (or the appropriate Arduino serial device
// edit: `/etc/systemd/system/`
// and change
// ExecStart=...... $TERM
// into:
// ExecStart=...... vt52
// then run: `systemctl daemon-reload`
// and: `systemctl restart serial-getty@ttyACM0.service`
View Expander.c
// Standard includes
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
// System include
#include <Gigatron.h>
const int tinyfont[96] = {
#include "../Utils/BabelFish/tinyfont.h"
xopr /
Last active Nov 8, 2020
Generate mosaic from testcards
if [ $# -eq 0 ]; then
echo "Testcard mosaic generator: generate 1 to 9 mosaic labeled testscreens"
echo -e "\tUses read, sed, wget and ImageMagick (convert and montage)"
echo -e "\tIt also uses Terence Eden's Testcard <>"
echo -e "\tUsage: $0 <name>[,subtitle>] [name[,subtitle]..]"
xopr /
Last active Apr 16, 2020
auto block IP based registrations and invites in FreeSWITCH
#!/usr/bin/env perl
# Blocks IP adresses in 3 steps:
# * unknown REGISTER (Can't find user) is blocked immediately
# * unauthorized INVITE is flagged (and blocked after 3 strikes)
# * authorized INVITES are unflagged (and the IP block is removed when the counter hits 0 (or less))
# * IP based incoming call which is not from a trunk (defined in ACL) is blocked immediately
# this needs some adjustments in the FS config:
# An ACL list of ip adresses of trunks that setup calls to you: <list name="trunks" default="deny">
xopr /
Created Oct 30, 2018
ssl test webserver in python
# Create certificate
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mycert.pem -out mycert.pem -subj "/C=NL/ST=Limburg/L=Heerlen/O=ACKspace/OU=demo/"
# Copied from
import BaseHTTPServer, SimpleHTTPServer
import ssl
# add localhost to limit interfaces
httpd = BaseHTTPServer.HTTPServer(('', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket( httpd.socket, certfile='mycert.pem', server_side=True )
xopr / hybrid.bat
Created Sep 27, 2018
batch bash hybrid script
View hybrid.bat
echo Welcome to %COMSPEC%
echo "Welcome to ${SHELL}"
function REM {
# REM is used to execute linux shell code
xopr /
Created Apr 11, 2018
Use autossh and screen to create a tunnel back to the local host publicly available on 'remote'
echo Setting up remote tunnel in screen session
screen -dmS tunnel autossh -N -R *:2222:localhost:22 -i .ssh/cypher tunnel@remote -p22
xopr /
Last active Apr 12, 2017
Check FreeSWITCH services, space|nl|de node
# Add it to `crontab -e` with
# where space as node name is a special scenario
# NOTE: crontab uses `sh` which is somewhat spartan compared to `bash`
# Column number to place the status message
# Command to move out to the configured column number
MOVE_TO_COL="echo -en \\033[${RES_COL}G"
# Command to set the color to SUCCESS (Green)
View fetchIoTaps.js
"use strict"
var request = require( "request" );
var sensorIds = [