Skip to content

Instantly share code, notes, and snippets.

View romelemperado's full-sized avatar

romel romelemperado

  • Cascadeo Corporation
  • Iligan City, Philippines
View GitHub Profile
@romelemperado
romelemperado / readable_random_string.php
Created April 4, 2019 09:08 — forked from sepehr/readable_random_string.php
PHP: Human-readable Random String
<?php
/**
* Generates human-readable string.
*
* @param string $length Desired length of random string.
*
* retuen string Random string.
*/
function readable_random_string($length = 6)
@romelemperado
romelemperado / random_strgenerator.php
Last active October 27, 2018 21:16 — forked from irazasyed/random_strgenerator.php
PHP: Generate random string
/**
* Generate and return a random characters string
*
* Useful for generating passwords or hashes.
*
* The default string returned is 8 alphanumeric characters string.
*
* The type of string returned can be changed with the "type" parameter.
* Seven types are - by default - available: basic, alpha, alphanum, num, nozero, unique and md5.
*
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header
#!/usr/bin/env python
#execute using Zenoss user
import Globals
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
from transaction import commit
dmd = ZenScriptBase(connect=True).dmd
#add your zendmd script below