For excessively paranoid client authentication.
Updated Apr 5 2019:
because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.
some other notes:
#coding: utf-8 | |
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template | |
@route('/') | |
@route('/index.html') | |
def index(): | |
return '<a href="/hello">Go to Hello World page</a>' | |
@route('/hello') | |
def hello(): |
import ldap | |
def check_credentials(username, password): | |
"""Verifies credentials for username and password. | |
Returns None on success or a string describing the error on failure | |
# Adapt to your needs | |
""" | |
LDAP_SERVER = 'ldap://xxx' | |
# fully qualified AD user name | |
LDAP_USERNAME = '%[email protected]' % username |
#!/bin/sh | |
# | |
# /etc/init.d/tomcat -- startup script for the Tomcat 7 servlet engine | |
# | |
# Modified init-Script from Ubuntu Tomcat init-script | |
# | |
# 2010 - Sebastian Mogilowski - http://www.mogilowski.net/2010/12/11/install-tomcat-7-on-debian-lenny-with-virtual-hosts-and-apache2-integration/ | |
# 2012 - Collin Peters - Added debug option | |
# | |
### BEGIN INIT INFO |
import gdata | |
import json | |
import requests | |
# More examples: | |
# https://github.com/millioner/Python-contact-importer/blob/master/contact_importer/providers/google.py | |
# https://github.com/jtauber/django-friends/blob/master/friends/importer.py | |
# GData with access token | |
token = gdata.gauth.OAuth2Token( |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!python | |
"""See main.__doc__""" | |
import os | |
import logging | |
import glob | |
import unittest | |
import sys |
def encrypt_RSA(public_key_loc, message): | |
''' | |
param: public_key_loc Path to public key | |
param: message String to be encrypted | |
return base64 encoded encrypted string | |
''' | |
from M2Crypto import RSA, BIO | |
key = open(public_key_loc, "r").read() | |
pubkey = str(key).encode('utf8') | |
bio = BIO.MemoryBuffer(pubkey) |
#!/bin/bash | |
function main() | |
{ | |
monitor_from_file $* | |
} | |
function monitor_vpn_ip_port() | |
{ | |
local CONN_NAME=$1 |
#!/bin/bash | |
# modified from byobu's bashrc -- colorize the prompt | |
# Copyright (C) 2014 Dustin Kirkland | |
# | |
# Authors: Dustin Kirkland <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3 of the License. | |
# |