Skip to content

Instantly share code, notes, and snippets.

View ThiefMaster's full-sized avatar
🐈
Scratching your code.

Adrian ThiefMaster

🐈
Scratching your code.
  • CERN / @indico
  • Geneva, Switzerland
View GitHub Profile
# vim: ft=python
SQLALCHEMY_DATABASE_URI = 'postgresql:///indico'
BASE_URL = 'https://YOURHOSTNAME.cern.ch'
DEBUG = True
# DISABLE_CELERY_CHECK = False
DB_LOG = True
SMTP_USE_CELERY = False
ROUTE_OLD_URLS = True

Thank you for helping us test the new LDAP provider for Indico.

Below you will find instructions on how to install and use the example application for testing. While this is a very simple application, it uses the same code as Indico 2.0 to perform LDAP operations.

Testing this application with the LDAP server you use for Indico will allow us to catch LDAP related bugs before we release Indico 2.0 or Flask-Multipass.

Prerequisites

Flask-Multipass requires Python 2.7 or newer. You can test it using:

python --version
# use your actual postgres/zodb connection details here
export PG=postgresql:///indico
export ZODB=zeo://127.0.0.1:9675
# use the id of your "system" user. create one first if you have none
export JANITOR_UID=123
# specify the path to your indico archive dir
export ARCHIVE=/opt/indico/archive
# specify the name of the StorageBackends indico.conf entry pointing to fs:$ARCHIVE
export ARCHIVE_BACKEND=default
@ThiefMaster
ThiefMaster / indico_awesome_themes***__init__.py
Last active January 17, 2023 16:26
the `***` in the filenames are placeholders for `/` (which are not possible in gists)
# empty
@ThiefMaster
ThiefMaster / tmux-smartsplit.sh
Last active April 27, 2017 07:36
Automatically ssh to the current pane's target if applicable
#!/bin/bash
# tmux-smartsplit
# open a new tmux (split-)window which will automatically
# continue the existing ssh session if one exists
PID=$(tmux display-message -p -F "#{pane_pid}")
if [[ $(readlink /proc/$PID/exe) == $(which ssh) ]]; then
CHILD=$PID
else
CHILD=$(cat /proc/[0-9]*/stat | awk '$4 == '$PID' {print $1; exit}')
CREATE TEMP TABLE orphaned_note_ids ON COMMIT DROP AS
(SELECT id FROM events.notes x WHERE x.event_id IS NOT NULL and NOT EXISTS
(SELECT 1 FROM events.events WHERE id = x.event_id));
UPDATE events.notes SET current_revision_id = NULL WHERE id IN (SELECT id FROM orphaned_note_ids);
DELETE FROM events.note_revisions WHERE note_id IN (SELECT id FROM orphaned_note_ids);
DELETE FROM events.notes WHERE id IN (SELECT id FROM orphaned_note_ids);
@ThiefMaster
ThiefMaster / bash-to-zsh.py
Created March 19, 2015 21:50
simple script that converts a non-timestamped bash history to an extended zsh history
from __future__ import print_function
import sys
from time import time
def main():
ts = int(time())
for line in sys.stdin:
print(': {0}:0;{1}'.format(ts, line.rstrip()))
from indico.util.console import cformat
colors = {
'fk': 'yellow!',
'pk': 'red!',
'ix': 'green!',
'ck': 'cyan!',
'uq': 'blue!'
}
def print_stuff(table):
t = db.Model.metadata.tables[table]
-- All these commands must be executed as the owner of the object!
GRANT CONNECT ON DATABASE indico TO indico_ro;
ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO indico_ro;
ALTER DEFAULT PRIVILEGES GRANT SELECT ON SEQUENCES TO indico_ro;
GRANT USAGE ON SCHEMA public TO indico_ro;
GRANT USAGE ON SCHEMA attachments TO indico_ro;
GRANT USAGE ON SCHEMA categories TO indico_ro;
GRANT USAGE ON SCHEMA indico TO indico_ro;
GRANT USAGE ON SCHEMA event_abstracts TO indico_ro;
GRANT USAGE ON SCHEMA event_editing TO indico_ro;
@ThiefMaster
ThiefMaster / python.post-checkout.sh
Last active August 29, 2015 14:06
post-checkout githook which cleans up all pyc/pyc/__pycache__ files/folders. to enable, save as post-checkout in .git/hooks and chmod +x
#!/bin/bash
prev_head=$1
new_head=$2
checkout_type=$3
[[ $checkout_type == '1' ]] || exit 0
[[ $prev_head == $new_head ]] && exit 0
cd "./$(git rev-parse --show-cdup)"