Skip to content

Instantly share code, notes, and snippets.

View tpokorra's full-sized avatar

Timotheus Pokorra tpokorra

View GitHub Profile
@tpokorra
tpokorra / msbuild.spec
Last active March 31, 2017 07:40
msbuild spec file for RPM package
# Note: this only works if you are able to modify /etc/os-release!
# for some reason, we cannot build on CentOS7, but only if we pretend to be Ubuntu 16.04!
Name: msbuild
Version: 15.1
Release: 1%{?dist}
Summary: The Microsoft Build Engine is a platform for building applications.
License: MIT
URL: https://github.com/Microsoft/msbuild
#!/bin/bash
branch=Kolab16
# we need a fully qualified domain name
hostnamectl set-hostname $branch.demo.example.org
yum install -y wget which bzip2 mailx selinux-policy-targeted
# disable SELinux
sed -i 's/enforcing/permissive/g' /etc/selinux/config
--- mysql.db.inc.orig 2016-04-25 09:40:40.329052075 +0200
+++ mysql.db.inc 2016-04-25 09:58:47.650099683 +0200
@@ -5,10 +5,14 @@
//Should have plug in compatibility.
function dbConnect() {
+ global $dbh;
$GLOBALS["CONNECTED_MYSQL_DB_INC"] = 1;
global $DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS, $DATABASE_DB;
- $dbh = mysql_pconnect("$DATABASE_HOST","$DATABASE_USER","$DATABASE_PASS") or die("Unable to connect to SQL server: ". mysql_error());
@tpokorra
tpokorra / lxc-centos
Last active January 3, 2016 16:19 — forked from hagix9/lxc-centos
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
@tpokorra
tpokorra / upgradeLdifKolab.php
Last active December 27, 2015 10:59
upgrade ldif data from Kolab 2.3 to Kolab 3.x
<?php
# Timotheus Pokorra, for TBits.net, April 2013
#
# import ldif file that has been dumped from Kolab2
# restoring domains, domain admins, and users
require_once "/usr/share/kolab-webadmin/lib/functions.php";
function debug($msg){
if(is_writeable("/tmp/mylog.log")){
@tpokorra
tpokorra / fixannotations.sh
Created October 1, 2013 08:49
Kolab: fixes CyrusIMAP problems with 32 bit to 64 bit migration, annotations.db folder-type
# call with domain name as parameter, eg. ./fixannotations.sh mydomain.org
domain="user/*@$1"
acceptedFolderTypes=(
"event" "event.default"
"contact" "contact.default"
"note" "note.default"
"task" "task.default"
"journal" "journal.default"
"mail.outbox" "mail.sentitems" "text/plain")
@tpokorra
tpokorra / testimap.php
Last active December 21, 2015 20:59
testing the imap flags and acl permissions
<?php
// centos: yum install php-imap
$host="localhost";
$mbox = imap_open("{".$host.":993/imap/ssl/novalidate-cert}INBOX", "admin.admin@servers.jiffybox.net", "test");
if ($mbox== null) die("mbox is null");
$folders = imap_listmailbox($mbox, "{".$host.":993}", "*");
echo "<pre>folders: ".print_r($folders,true)."</pre>";
$headers = imap_headers($mbox);
<?php
// get from here: https://github.com/tfnet/jiffy-api-php-client/blob/master/JiffyBoxApi.class.php
require "JiffyBoxApi.class.php";
$token = "INSERT YOUR TOKEN HERE";
$id=INSERT YOU jiffybox id HERE;
$planid=20;
$hours=2;
if (!empty($argc) && strstr($argv[0], basename(__FILE__)))
{
@tpokorra
tpokorra / _patchQuotaEdit.patch
Last active December 18, 2015 22:58
Kolab webadmin: select a unit, eg. KB, MB or GB for the quota to be stored
diff -uNr kolab-webadmin.orig/lib/api/kolab_api_service_user.php kolab-webadmin/lib/api/kolab_api_service_user.php
--- kolab-webadmin.orig/lib/api/kolab_api_service_user.php 2013-06-18 11:33:48.541736452 +0200
+++ kolab-webadmin/lib/api/kolab_api_service_user.php 2013-06-25 13:37:54.989123228 +0200
@@ -125,6 +125,13 @@
{
//console("\$postdata to user_edit()", $postdata);
+ if ($postdata['mailquota-unit'] == 'gb') {
+ $postdata['mailquota'] *= 1024*1024;
+ }
@tpokorra
tpokorra / patchDomainAdmins.patch
Created June 25, 2013 11:22
domainadmin patch for Kolab trunk
diff -uNr kolab-webadmin.orig/lib/api/kolab_api_service_domain_types.php kolab-webadmin/lib/api/kolab_api_service_domain_types.php
--- kolab-webadmin.orig/lib/api/kolab_api_service_domain_types.php 2013-06-18 11:33:48.542736382 +0200
+++ kolab-webadmin/lib/api/kolab_api_service_domain_types.php 2013-06-18 11:34:09.088733566 +0200
@@ -64,6 +64,10 @@
'associateddomain' => array(
'type' => 'list',
),
+ 'domainadmin' => array(
+ 'type' => 'list',
+ 'optional' => 'true',