Skip to content

Instantly share code, notes, and snippets.

View iomarmochtar's full-sized avatar
:octocat:
"Use the source luke"

Omar Mochtar iomarmochtar

:octocat:
"Use the source luke"
View GitHub Profile
@iomarmochtar
iomarmochtar / check_weak_passwd.php
Created May 17, 2017 09:16
Scan user that using weak password in ClearOS (6), read my post for more detail https://iomarmochtar.wordpress.com/2017/05/17/enhance-clearos-6-password-policy/
#!/usr/clearos/sandbox/usr/bin/php
<?php
/**
* Scan user weak password based on lists for ClearOS 6 and using OpenLDAP as directory server
* @author Imam Omar Mochtar <iomarmochtar@gmail.com>
**/
//error_reporting(-1);
@iomarmochtar
iomarmochtar / custom_password_policy.php
Created May 17, 2017 02:10
password policy that will be used for Custom_Password_Validator.php
<?php
// password policy that will be used for Custom_Password_Validator.php
define('POLICY_MAX_LENGTH', 0);
define('POLICY_MIN_LENGTH', 5);
define('POLICY_MIN_UPPERCASE', 1);
define('POLICY_MIN_NUMERIC', 1);
define('POLICY_MIN_PUNCTUATION', 1);
@iomarmochtar
iomarmochtar / custom_weak_passwd_list.php
Created May 17, 2017 02:08
list of weak password list that will be used for Custom_Password_Validator.php
<?php
// list of weak password list that will be used for Custom_Password_Validator.php
// you may add some more to prevent user using following weak password
return array(
'password',
'password1',
'password12',
'password123',
'password1234',
@iomarmochtar
iomarmochtar / Custom_Password_Validator.php
Created May 17, 2017 01:55
ClearOS custom password policy
<?php
/**
* Custom password policy validator for ClearOS (6)
*
* @author Imam Omar Mochtar <iomarmochtar@gmail.com>
*/
namespace clearos\apps\users;
@iomarmochtar
iomarmochtar / ozsoap.py
Created September 27, 2016 05:02
Demo Library kopdar python-ID Jogja 240916 untuk berinteraksi dengan zimbra API dengan dependensi module requests
__author__ = ('Imam Omar Mochtar', ('omar@jabetto.com', 'iomarmochtar@gmail.com'))
__version__ = (0 ,4)
"""
Dokumentasi zimbra soap berdasarkan versinyas
http://wiki.zimbra.com/wiki/SOAP_API_Reference_Material_Beginning_with_ZCS_8.0
"""
"""
@iomarmochtar
iomarmochtar / getmbxsize.sh
Created September 27, 2016 04:55
Demo script mendapatkan mailbox size pada kopdar python-ID Jogja 240916
# based on: https://wiki.zimbra.com/wiki/Get_all_user%27s_mailbox_size_from_CLI
all_accounts=`zmprov -l gaa`
for account in $all_accounts; do
mbox_size=`zmmailbox -z -m $account gms`
echo "Mailbox size of $account = $mbox_size"
done
@iomarmochtar
iomarmochtar / getmbxsize.py
Created September 27, 2016 04:52
Demo script menggunakan zmpython pada kopdar python-ID Jogja 240916
__author__ = ('Imam Omar Mochtar', ('iomarmochtar@gmail.com', 'omar@jabetto.com'))
from com.zimbra.common.soap import AccountConstants, AdminConstants
from com.zimbra.cs.account import Provisioning
from com.zimbra.cs.account.soap import SoapProvisioning
from com.zimbra.client import ZMailbox
from com.zimbra.common.account.Key import AccountBy
KBYTES = 1024
MBYTES = 1024*1024
@iomarmochtar
iomarmochtar / warning.php
Last active August 27, 2015 14:49
ClearOS warning page for e2guardian
<?php
function index($info)
//function index($info, $reason)
{
// Load dependencies
//------------------
$this->load->library('content_filter/DansGuardian');
$this->lang->load('content_filter');