Skip to content

Instantly share code, notes, and snippets.

View mcchae's full-sized avatar

Jerry Chae mcchae

View GitHub Profile
@mcchae
mcchae / figlet.out
Created January 7, 2019 05:06
pyfiglet ascii art for python usage example
Font=1943____
### ## #### #### ### # # ## ## ### # # ### # # ####
## ## #### #### ### # # ## ## ### # # ### # # ####
## ## #### #### ### # # ## ## ### # # ### # # ####
## ### ## #### # # ### # # ## # ## ### # # ### # # # # ## # ## ##
## ## ## ## # ### # ### ### # # # ### # ### # # ### # # # ### ## ## ## ## ##
## ## ### #### ### #### ### #### ### # # ## ## ### # # ### # # ### #### ## ### ##### ##
### ## ## ## ### #### ### #### ### # # ## ## ### # # ### # # ### #### # ## # ### ##
## ## # # ### # # ### ### # # ### # # ### # # # # ### ## ## # ## ##
#### #### #### ### # # ### # # ### # #
@mcchae
mcchae / debug_dynamic_code.py
Created May 8, 2018 10:53
PyCharm debug with dynamic code
#!/usr/bin/env python
# coding=utf8
################################################################################
import os
import importlib.util
################################################################################
@mcchae
mcchae / api.php
Created May 2, 2018 06:08
python client <=> php service sample code
<?php
// get the HTTP http_method, path and body of the request
$http_method = $_SERVER['REQUEST_METHOD'];
$request = explode('/', trim($_SERVER['PATH_INFO'],'/'));
$input = json_decode(file_get_contents('php://input'),true);
// retrieve the method and key from the path
$method = preg_replace('/[^a-z0-9_]+/i','',array_shift($request));
$key = array_shift($request);
@mcchae
mcchae / email_send.py
Created April 30, 2018 23:59
python gmail send
import os
import smtplib
import time
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.utils import COMMASPACE, formatdate
from email import encoders
@mcchae
mcchae / google-map-search.py
Last active June 2, 2021 10:53
Some python selenium examples
#!/usr/bin/env python
################################################################################
import sys
from time import sleep
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
@mcchae
mcchae / Modules.Setup
Created September 23, 2017 00:54
dockcross ARMv5 python build
# -*- makefile -*-
# The file Setup is used by the makesetup script to construct the files
# Makefile and config.c, from Makefile.pre and config.c.in,
# respectively. The file Setup itself is initially copied from
# Setup.dist; once it exists it will not be overwritten, so you can edit
# Setup to your heart's content. Note that Makefile.pre is created
# from Makefile.pre.in by the toplevel configure script.
# (VPATH notes: Setup and Makefile.pre are in the build directory, as
# are Makefile and config.c; the *.in and *.dist files are in the source
@mcchae
mcchae / acl_test.py
Created September 5, 2017 23:56
AAA Authorization with miracle_acl
#!/usr/bin/env python
# coding=utf8
###############################################################################
from miracle.acl import Acl
from pprint import pformat
###############################################################################
def acl_test():
@mcchae
mcchae / image_diff.py
Created August 24, 2017 00:58
Python OpenCV Image diff
# USAGE
# python image_diff.py --first images/original_01.png --second images/modified_01.png
# import the necessary packages
from skimage.measure import compare_ssim
import argparse
import imutils
import cv2
# construct the argument parse and parse the arguments
@mcchae
mcchae / index.py
Last active August 29, 2018 06:00
CVE search engine using python Whoosh
#!/usr/bin/env python
# coding=utf-8
"""
import CVE from "http://cve.mitre.org/data/downloads/allitems.txt"
"""
################################################################################
import os
import urllib2
import getopt
@mcchae
mcchae / sendslack.json
Created December 23, 2016 05:54
sendslack is a simple program to send a message to slack communication app
{
"token":"xoxp-1_________75-10________93-11________40-4d________c382e04140057________",
"channels": [
{
"name": "_imo_devops_",
"incoming_webhook_url": "https://hooks.slack.com/services/T________/__________/______________________",
"icon_emoji": ":shipit:"
},
{
"name": "_imo_do1_unittest_",