Skip to content

Instantly share code, notes, and snippets.

View bkram's full-sized avatar

Mark de Bruijn bkram

View GitHub Profile
@bkram
bkram / smb.conf
Last active September 26, 2017 15:14
Popcorn Hour A100/A110 no longer connects to a recent Samba server, fix this by degrading Samba security level in the smb.conf.
# Allow old style ntlm authentication
ntlm auth = Yes
@bkram
bkram / build-tvheadend.sh
Last active November 20, 2017 08:54
Simple script on to build a more recent tvheadend packages for Debian/Ubuntu Armhf (armbian)
#!/bin/bash
mkdir build
cd build
sudo apt install fakeroot debhelper pkg-config gettext libavahi-client-dev liburiparser-dev cmake dvb-apps
git clone https://github.com/tvheadend/tvheadend.git
cd tvheadend
git checkout v4.2.4
# the extra -fPIC was required on Ubuntu 16.04, not tested whether actually required on debian 8
AUTOBUILD_CONFIGURE_EXTRA=--disable-ffmpeg_static\ --CFLAGS=-fPIC ./Autobuild.sh
cd ..
#!/usr/bin/python
# -*- coding: utf-8 -*-
import subprocess
import cherrypy
config = {
'global': {
'server.socket_host': '0.0.0.0',
'server.socket_port': 8080,
'server.thread_pool': 8,
@bkram
bkram / rsdh-ssl-rss.py
Last active January 17, 2018 08:50
Experimental RSS Feed generator of Radio Stad Den Haag Sundaynight Live Weekly Shows
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import datetime
import hashlib
import urllib
import requests
import rfeed
# lxd on debian with snap
# get zfs support
apt install zfsutils-linux
# install snap
apt install snapd -y
# install lxd from snap
snap install lxd
#!/usr/bin/perl
#
# Troels Hansen @ Casalogic A/S
# Доработка скрипта - Шакиров Ленар, Шакиров Айнур (Группа компаний "Центр", г. Казань, Россия).
# Скрипт предоставлен форумом Zarafa на правах Public Domain. Скрипт предоставлен "как есть", его работа не гарантируется.
use Unicode::IMAPUtf7;
use Getopt::Std;
use Text::Iconv;
@bkram
bkram / db-find-missing-attachments.pl
Last active March 12, 2018 10:42
perl db-find-missing-attachments.pl /etc/kopano/server.cfg
#!/usr/bin/perl -w
use strict;
use DBI;
my $L1 = 10;
my $L2 = 20;
sub do_error($) {
exit(1);
@bkram
bkram / 61kopano.ldif
Created March 23, 2018 10:55
Kopano LDIF for FREEIPA/DS389 place in /etc/dirsrv/slapd-*/schema/
#
################################################################################
#
dn: cn=schema
#
################################################################################
#
attributeTypes: (
1.3.6.1.4.1.47732.1.1.1.1
NAME 'kopanoQuotaOverride'
@bkram
bkram / kopano-fix-ipm-subtree
Created April 16, 2018 07:23
Kopano-fix-ipm-subtree, from KC 8.5.5
#!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
#
import sys
import kopano
from MAPI.Tags import PR_IPM_SUBTREE_ENTRYID
server = kopano.Server(auth_user='SYSTEM', auth_pass='')
@bkram
bkram / cyrus2kopano.py
Created April 16, 2018 13:05
Migrate Cyrus directory structure to a Kopano user.
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
import os
import kopano
userfolder = '/var/spool/cyrus/mail/i/user/cyrususer'
kuser = kopano.user('kopanouser')
IGNORE = ['cyrus.cache', 'cyrus.index', 'cyrus.header']