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 sys | |
def my_except_hook(exctype, value, traceback): | |
if exctype == KeyboardInterrupt: | |
print("Handler code goes here") | |
else: | |
print('Error Send...') | |
sys.__excepthook__(exctype, value, traceback) | |
sys.excepthook = my_except_hook |
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 | |
require_once "$_SERVER[DOCUMENT_ROOT]/vendor/autoload.php"; | |
use \Monolog\Logger as Logger; | |
use Monolog\Handler\SlackWebhookHandler; | |
// 로거 채널 생성 | |
$log = new Logger('logger name'); | |
// log/your.log 파일에 로그 생성. 로그 레벨은 Info |
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 | |
// we will do our own error handling | |
error_reporting(0); | |
// user defined error handling function | |
function userErrorHandler($errno, $errmsg, $filename, $linenum, $vars) { | |
// timestamp for the error entry | |
$dt = date("Y-m-d H:i:s (T)"); | |
// define an assoc array of error string |
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 configparser | |
from io import StringIO | |
class OpenSSLCnf: | |
def __init__(self, cn): | |
# todo database load cn | |
self.cnf = configparser.ConfigParser(allow_no_value=True) | |
self.cnf.optionxform = str | |
self.default_ca_name = None |
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
# 제목, 지은이, 출판사, 출판일, ISBN, 그림 | |
url1 = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=248169181" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=256383383" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=220179301" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=200010445" | |
# url = "https://www.aladin.co.kr/shop/UsedShop/wuseditemall.aspx?ItemId=243636605" | |
# url = "https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=165668006" | |
import requests | |
from bs4 import BeautifulSoup, Tag, NavigableString |
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 requests | |
from urllib import parse | |
import json | |
import re | |
headers = { | |
'Referer': 'https://cyberbureau.police.go.kr/prevention/sub7.jsp?mid=020600', | |
} | |
fieldType = 'A' # 휴대폰은 H, A는 계좌번호 |
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
#!/usr/bin/env python3 | |
import argparse | |
import subprocess | |
import shlex | |
import os, sys | |
from datetime import timedelta, datetime | |
parser = argparse.ArgumentParser(description='통째 영상 파일을 여러개의 비디오 파일로 분할합니다') | |
parser.add_argument('description', metavar='description', type=str, nargs=1, help='분할 영상 정보 파일을 제공하세요') |
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
function Add-EnvPath { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string] $Path, | |
[ValidateSet('Machine', 'User', 'Session')] | |
[string] $Container = 'Session' | |
) | |
if ($Container -ne 'Session') { |