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

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
@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
>>> from indico.modules.rb.models import Photo
>>> Photo.room
AttributeError: type object 'Photo' has no attribute 'room'
>>> db.session.query(Photo)
<sqlalchemy.orm.query.Query at 0x8211490>
>>> Photo.room
<sqlalchemy.orm.attributes.InstrumentedAttribute at 0x81c8090>
# 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
-- 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 / regex.py
Last active December 29, 2020 13:09
import sys
class ParseError(ValueError):
pass
class Regex(object):
def __init__(self, tree):
self.tree = tree
@ThiefMaster
ThiefMaster / tmux.conf
Last active November 23, 2020 05:34
my tmux config
set -g prefix C-a
bind C-s send-prefix
bind F11 set -g prefix C-a \; display-message 'Prefix: ^A'
bind F12 set -g prefix C-b \; display-message 'Prefix: ^B'
unbind Space
bind h clear-history \; display-message 'Cleared history'
bind C new-window -c ~
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
from ctypes import windll, byref, Structure, WinError, POINTER, WINFUNCTYPE
from ctypes.wintypes import BOOL, HMONITOR, HDC, RECT, LPARAM, DWORD, BYTE, WCHAR, HANDLE
import sys
_MONITORENUMPROC = WINFUNCTYPE(BOOL, HMONITOR, HDC, POINTER(RECT), LPARAM)
class _PHYSICAL_MONITOR(Structure):
_fields_ = [('handle', HANDLE),
#!/bin/bash
n=0
lines=
newline='
'
LINES=$(tput lines)
case $LINES in
''|*[!0-9]*) exec less;;
@ThiefMaster
ThiefMaster / auth.py
Created August 21, 2012 22:10
Flask-IRC example
from flask.ext.irc import BotModule, CommandAborted
from exodus import login_required, db
auth = BotModule('Auth', __name__)
@auth.command('addhost')
def addhost(source, channel):
"""Show the URL to connect your host with your account.
This command shows you the URL to associate your hostname with an account.