Skip to content

Instantly share code, notes, and snippets.

View romabysen's full-sized avatar

Lars Hansson romabysen

View GitHub Profile
@romabysen
romabysen / gist:2947941
Created June 18, 2012 11:21
replace md5 with hashlib in md5crypt
--- md5crypt.py.orig 2012-06-18 19:19:24.093589000 +0800
+++ md5crypt.py 2012-06-18 19:19:53.057589003 +0800
@@ -41,7 +41,7 @@
MAGIC = '$1$'# Magic string
ITOA64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
-import md5
+from hashlib import md5
def to64 (v, n):
@romabysen
romabysen / md5crypt.py
Created June 2, 2012 04:32
Python md5crypt module
#########################################################
# md5crypt.py
#
# 0423.2000 by michal wallace http://www.sabren.com/
# based on perl's Crypt::PasswdMD5 by Luis Munoz ([email protected])
# based on /usr/src/libcrypt/crypt.c from FreeBSD 2.2.5-RELEASE
#
# MANY THANKS TO
#
# Carey Evans - http://home.clear.net.nz/pages/c.evans/
@romabysen
romabysen / cfg_password_ui_.py.diff
Created June 2, 2012 04:30
Shinken: Don't print passwords
--- cfg_password_ui_.py.orig 2012-06-02 11:56:47.931756001 +0800
+++ cfg_password_ui_.py 2012-06-02 11:58:20.859756001 +0800
@@ -71,6 +71,5 @@
if not c:
return False
- print "User %s (%s) try to init with %s" % (user, c.password, password)
p = c.password
return p == password and p != 'NOPASSWORDSET'
@romabysen
romabysen / passwd_ui.py.diff
Created June 2, 2012 04:29
Support for Apache md5 passwords in shinken
--- passwd_ui.py.orig 2012-06-02 11:40:38.267756001 +0800
+++ passwd_ui.py 2012-06-02 12:07:42.995755998 +0800
@@ -36,6 +36,7 @@
import fcrypt as crypt
from shinken.basemodule import BaseModule
+from shinken.md5crypt import apache_md5_crypt
print "Loaded Apache/Passwd module"