misc Package¶
misc Package¶
md5crypt Module¶
md5crypt.py - Provides interoperable MD5-based crypt() function
SYNOPSIS
import md5crypt.py
cryptedpassword = md5crypt.md5crypt(password, salt);
DESCRIPTION
unix_md5_crypt() provides a crypt()-compatible interface to the rather new MD5-based crypt() function found in modern operating systems. It’s based on the implementation found on FreeBSD 2.2.[56]-RELEASE and contains the following license in it:
“THE BEER-WARE LICENSE” (Revision 42): <phk@login.dknet.dk> wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
apache_md5_crypt() provides a function compatible with Apache’s .htpasswd files. This was contributed by Bryan Hart <bryan@eai.com>.
- shinken.misc.md5crypt.md5crypt(pw, salt, magic=None)¶
perfdata Module¶
regenerator Module¶
- class shinken.misc.regenerator.Regenerator[source]¶
Bases: object
sorter Module¶
Helper functions for some sorting
termcolor Module¶
ANSII Color formatting for output in terminal.
- shinken.misc.termcolor.colored(text, color=None, on_color=None, attrs=None)[source]¶
Colorize text.
- Available text colors:
- red, green, yellow, blue, magenta, cyan, white.
- Available text highlights:
- on_red, on_green, on_yellow, on_blue, on_magenta, on_cyan, on_white.
- Available attributes:
- bold, dark, underline, blink, reverse, concealed.
- Example:
- colored(‘Hello, World!’, ‘red’, ‘on_grey’, [‘blue’, ‘blink’]) colored(‘Hello, World!’, ‘green’)