Skip to content

Instantly share code, notes, and snippets.

Avatar

Timotheus Pokorra tpokorra

View GitHub Profile
@tpokorra
tpokorra / reinstallKolabDebian.sh
Last active Sep 18, 2020
install kolab on Debian
View reinstallKolabDebian.sh
service kolab-server stop
service kolab-saslauthd stop
service cyrus-imapd stop
service dirsrv stop
service wallace stop
service apache2 stop
if [ -f /usr/sbin/remove-ds-admin ]
then
sed -i "s#/usr/lib/x86_64-linux-gnu/dirsrv/perl);#/usr/lib/x86_64-linux-gnu/dirsrv/perl);\nuse lib qw(/usr/lib/dirsrv/perl);#g" /usr/sbin/remove-ds-admin
@tpokorra
tpokorra / arrange_photos_per_day.py
Last active Sep 1, 2020
Arrange Photos into directories per day
View arrange_photos_per_day.py
#!/usr/bin/python3
import os
from datetime import datetime
for file in os.listdir("."):
if file.endswith(".jpg") or file.endswith(".3gp"):
date = datetime.strptime(file.split("_", 2)[1], '%Y%m%d')
datestr = date.strftime('%m/%d/%Y')
print(file + " " + datestr)
@tpokorra
tpokorra / builder.cs
Last active Oct 18, 2019
simple c# build tool as alternative to xbuild
View builder.cs
// a simple alternative to xbuild
// parse sln and csproj files, and call mcs to compile the projects.
// can only build libraries at the moment
// Copyright: Timotheus Pokorra <timotheus.pokorra@solidcharity.com>
// License: MIT
// to build: mcs builder.cs -r:System.Xml.Linq
using System;
using System.IO;
using System.Diagnostics;
using System.Xml.Linq;
@tpokorra
tpokorra / testSendMail.cs
Created Oct 8, 2019
Test sending Mail with Ict.Common.IO and MimeKit
View testSendMail.cs
// mcs testSendMail.cs -r:System.Data -r:delivery/bin/Ict.Common.IO.dll -r:delivery/bin/Ict.Common.dll -r:delivery/bin/MimeKit.dll
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Collections;
using System.Collections.Specialized;
using System.Dynamic;
using System.Globalization;
@tpokorra
tpokorra / Dockerfile.test
Last active Aug 19, 2019
Fedora Docker image with systemd inside
View Dockerfile.test
# see https://developers.redhat.com/blog/2016/09/13/running-systemd-in-a-non-privileged-container/
FROM fedora:30
ENV container docker
RUN dnf -y install net-tools openssh-server glibc-locale-source passwd
RUN mkdir /var/run/sshd
# create host ssh key
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
# SSH login fix. Otherwise user is kicked off after login
@tpokorra
tpokorra / session.aspx
Last active Jul 21, 2019
Testing Sessions with aspx on Mono
View session.aspx
<%@ Page Language="C#" src="session.aspx.cs" %>
<html xmlns="www.w3.org/1999/xhtml">
<%@ Import Namespace="System.Threading" %>
<head runat="server">
<title></title>
</head>
<body>
<div>
<%
Response.Write( "Hello World<br/>");
@tpokorra
tpokorra / build_mono_nuget_mcs.sh
Last active Jul 15, 2019
Build NuGet 5 with Mono and mcs compiler for Fedora
View build_mono_nuget_mcs.sh
#!/bin/bash
path=`pwd`
if [ 1 -eq 1 ]; then
cd $path/build/Shared
echo "**** building `pwd`/ ****"
for f in *.cs
do
sed -i "s/internal/public/g" $f
View createkolabusers.py
import pykolab
from pykolab.translate import _
from pykolab import utils
log = pykolab.getLogger('pykolab.cli')
conf = pykolab.getConf()
def run():
from pykolab import wap_client
wap_client.authenticate()
@tpokorra
tpokorra / lxc-debian-wheezy
Last active Oct 4, 2018
lxc template for debian wheezy to install on Ubuntu precise 12.04 host
View lxc-debian-wheezy
#!/bin/bash
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@tpokorra
tpokorra / profile_db_generator.rb
Last active Oct 3, 2018
Discourse generator of a test database
View profile_db_generator.rb
# can be used to generate a mock db for profiling purposes
# we want our script to generate a consistent output, to do so
# we monkey patch array sample so it always uses the same rng
class Array
RNG = Random.new(1098109928029800)
def sample
self[RNG.rand(size)]
end
You can’t perform that action at this time.