This file contains hidden or 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
# put this into your .bashrc or .zshrc, to use it just type pyenvme on target working directory | |
function pyenvme(){ | |
targetDir=~/pyenvme | |
test -d $targetDir || mkdir -p $targetDir | |
curDir=$(pwd) | |
pyEnvDir=$(echo $curDir | sed -e 's/\//_/g') | |
# only include for major and minor version | |
pyVersion=$(python --version | awk '{ print $2 }' | sed -E 's/\.[0-9]+$//') | |
pyEnvDirPath="${targetDir}/${pyEnvDir}/${pyVersion}" | |
echo "using ${pyEnvDirPath}" |
This file contains hidden or 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
# modified version of https://github.com/sachaos/viddy/issues/2#issuecomment-907586514 for respecting passed arguments | |
# eg: vd kgp -n flux-system | |
function vd() { | |
args=$(echo $* | cut -d' ' -f 2-) | |
real_cmd=$(which $1 | cut -d' ' -f 4-) | |
viddy -d -n 1 --shell $SHELL "$real_cmd $args" | |
} |
This file contains hidden or 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
[centos] | |
name=CentOS-7 | |
baseurl=https://mirror.dewabiz.com/centos/7/os/x86_64/ | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=https://mirror.dewabiz.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7 |
This file contains hidden or 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
from configparser import ConfigParser | |
from pprint import pprint | |
def as_dict(ini_file): | |
config = ConfigParser() | |
config.read_file(open(ini_file, 'r')) | |
return { x: dict(config[x]) for x in config.sections() } | |
pprint( as_dict('main.ini') ) |
This file contains hidden or 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 | |
// Author: Imam Omar Mochtar ([email protected]) | |
namespace app\models; | |
use Yii; | |
use Zimbra\Admin\AdminFactory; | |
use Zimbra\Admin\Request\CreateAccount; | |
use Zimbra\Struct\KeyValuePair; | |
use Zimbra\Struct\AccountSelector; | |
use Zimbra\Enum\AccountBy; |
This file contains hidden or 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
#!/bin/bash | |
## Author: Imam Omar Mochtar ([email protected]) | |
## Func: Simple script to start and stop pgadmin4 container | |
[email protected] | |
PASSWORD=kacangitem | |
PORT=8787 | |
IMAGE="dpage/pgadmin4" | |
CONTAINER="omr_pgadmin4" |
This file contains hidden or 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
#!/bin/bash | |
# Author: Imam Omar Mochtar ([email protected]) | |
# Move user's OU by sAMAccountName for samba4 | |
# arg1 = param name, arg2 = value, arg3 = default value | |
getParam(){ | |
if [ "$2"x == "x" ] && [ "$3"x == "x" ]; then | |
echo "$1 dimasukan diset" | |
exit 1 | |
fi |
This file contains hidden or 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
import smtplib | |
import random | |
fromaddr = '[email protected]' | |
toaddrs = '[email protected]' | |
subject = 'This can be a fraud' | |
message_id = '%032x@randommail'%random.getrandbits(128) | |
username = 'mcuser' | |
password = 'mcpassword' |
This file contains hidden or 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
__author__ = 'Imam Omar Mochtar ([email protected])' | |
""" | |
WARNING : For learning purpose only !!! | |
This is example of utilizing ozpy for gaining zimbra admin rights through SSRF vulnerability | |
""" | |
import sys | |
import requests |
This file contains hidden or 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
__author__ = ('Imam Omar Mochar', ('[email protected]',)) | |
""" | |
Simple XML builder, i create it for generating HTML tag(s) | |
""" | |
# alternative of xml attribute that also become keyword in python side | |
ALTERNATE_MAP = { | |
'klass': 'class' | |
} |
NewerOlder