Skip to content

Instantly share code, notes, and snippets.

@bosim
bosim / fix-entryids.py
Last active June 23, 2021 18:03
Fix broken entryids in a folder
"""
Fix broken entryids in a folder
BEFORE YOU RUN THIS SCRIPT: BACKUP YOUR KOPANO DATABASE WITH mysqldump OR SIMILAR
NOW YOU HAVE BEEN WARNED. THIS SCRIPT COMES WITH NO WARRANTY WHAT SO EVER.
Step 1: BACKUP DATABASE! It is recommended you shutdown kopano-server while running
this.
Step 2: Change the USER, PASSWORD, HOST, and DB variables below
Step 3: Find the store guid and hierarchy id of the folder
@bosim
bosim / mapi-sync.c
Last active August 25, 2016 06:32
mapi-synchronization
// Example of mapi synchronization
// State will be saved to test.dat (you need to create it in advance),
// first run: full sync (ImportMessageChange) will be called for all messages
// next run: state is read and only differences (i.e. message change, deletion, flag change)
// will be fetched and the appropriate methods in the class will be called.
#include <kopano/stringutil.h>
#include "platform.h"
// Example use of kopano MAPI
#include "platform.h"
#include <iostream>
#include <mapi.h>
#include <mapiutil.h>
#include <kopano/Util.h>
#include <kopano/ECLogger.h>
@bosim
bosim / .emacs
Last active August 29, 2015 14:01
.emacs
;; .emacs
;; =========================================================================
;;
;; Bo Simonsen - modified version of Malthe Borch's .emacs file
;; https://gist.github.com/malthe/1900182
;;
;; Add own packages to load path
(let* ((my-lisp-dir "~/.emacs.d/site-lisp")
(default-directory my-lisp-dir)
@bosim
bosim / varnish.vcl
Last active August 25, 2016 06:33
Basic varnish configuration for Plone
acl purge {
"localhost";
}
director plone_director round-robin {
{
.backend = {
.host = "127.0.0.1";
.port = "50020";
.probe = {
@bosim
bosim / exportVocabulary.py
Created October 3, 2012 09:57
Script for exporting ATVocabularyManager vocabularies to IMS VDEX format. Put it in the "custom" folder and access it using http://<my-site>/portal_vocabularies/<vocabName>/exportVocabulary
def recurse(element):
elements = []
for item in element.objectValues():
d = {'uid' : item.UID(),
'title' : item.title,
'children' : []}
if hasattr(item, 'objectValues'):
d['children'] = recurse(item)
elements.append(d)
return elements