This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
setlocale(LC_ALL, | |
'id_ID.UTF8', 'id_ID.UTF-8', 'id_ID.8859-1', 'id_ID', | |
'IND.UTF8', 'IND.UTF-8', 'IND.8859-1', 'IND', | |
'Indonesian.UTF8', 'Indonesian.UTF-8', 'Indonesian.8859-1', 'Indonesian', 'Indonesia', | |
'id', 'ID', | |
// Add english as default (if all Indonesian not available) | |
'en_US.UTF8', 'en_US.UTF-8', 'en_US.8859-1', 'en_US', 'American', 'ENG', 'English', | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code borrowed from http://stackoverflow.com/questions/6809590/merging-a-python-scripts-subprocess-stdout-and-stderr-while-keeping-them-disti/6810231#6810231 | |
import subprocess | |
import select | |
from logging import DEBUG, ERROR | |
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs): | |
""" | |
Variant of subprocess.call that accepts a logger instead of stdout/stderr, | |
and logs stdout messages via logger.debug and stderr messages via |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: Azhar | |
* Date: 7/15/14 | |
* Time: 10:59 AM | |
*/ | |
$indent = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/python3.4 | |
""" | |
Created on Aug 01, 2014 | |
@author: Azhar | |
""" | |
from configparser import ConfigParser | |
import hashlib | |
import os | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'# Perform dir /a c:\users > c:\dir.txt | |
'# place this script file in c:\ too | |
'# double click to run it | |
'# run resulting script.bat from recovery mode | |
repprefix = " Directory of " ' Modify to your language | |
sourcepath = "C:\Users.bak" | |
targetpath = "C:\Users" | |
altsourcepath = "D:\Users.bak" | |
alttargetpath = "D:\Users" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
SNMP helper for HAproxy implementing EXCELIANCE-MIB with | |
`pass_persist` protocol. Data are retrieved from multiple instances of | |
haproxy using HTTP. | |
""" | |
def toOid(oid): | |
"""Convert a string to tuple OID""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', '2G'); | |
$numGen = function () { | |
return rand(1, 9999999); | |
}; | |
$rs = str_repeat("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 10); | |
$strGen = function () { |