Skip to content

Instantly share code, notes, and snippets.

View Beomi's full-sized avatar

Junbum Lee Beomi

View GitHub Profile
@Beomi
Beomi / encoding.sh
Created January 19, 2016 06:11
encoding AVI to MP4 shell script
#!/bin/sh
ffprobe="/volume1/NAS/SH/dts/ffprobe"
ffmpeg="/volume1/NAS/SH/dts/ffmpeg"
cachedir="/volume1/NAS/SH/dts"
## cleanup by deleting unwanted files
find $1 -name "*.txt" -type f -print0 | xargs -0 rm -rf
find $1 -name "*.db" -type f -print0 | xargs -0 rm -rf
##find $1 -name "*.nfo" -type f -print0 | xargs -0 rm -rf
@Beomi
Beomi / xecure_cyworld.js
Created January 26, 2016 09:30
싸이월드 자바스크립트 암호화
document.domain = "cyworld.com";
var xGlobal = {
CookieDomain : "cyworld.com", // 도메인
CookieMain : "LOGIN", // 메인 쿠키
CookieXecureLevel : "xlevel", // 보안 레벨 쿠키
CookieIPLevel : "iplevel", // IP보안 레벨 쿠키
CookieSaveId : "saveid", // 로그인 아이디 저장 여부 쿠키
CookieLoginId : "loginid", // 로그인 아이디
CookieSavePwd : "savepwd", // 로그인 아이디 저장 여부 쿠키
@Beomi
Beomi / kb_balance.py
Created June 24, 2016 10:57 — forked from devxoul/kb_balance.py
국민은행 잔액조회
# -*- coding: utf-8 -*-
from datetime import datetime
import urllib2
def kb_balance(account, password, resident, username):
"""
국민은행 계좌 잔액 빠른조회. 빠른조회 서비스에 등록이 되어있어야 사용 가능.
빠른조회 서비스: https://obank.kbstar.com/quics?page=C018920
@Beomi
Beomi / auth.py
Created September 28, 2016 11:54
Using Gnuboard DB with Django custom AUTH_USER_MODEL
from django.utils.crypto import constant_time_compare
import hashlib
from .models import G5Member as User
class MyUserAuthBackend(object):
def check_legacy_password(self, db_password, supplied_password):
return constant_time_compare('*'+ hashlib.sha1(hashlib.sha1(supplied_password.encode('utf-8')).digest()).hexdigest().upper(), db_password)
@Beomi
Beomi / settings.py
Created September 28, 2016 11:56
Using Gnuboard DB with Django custom AUTH_USER_MODEL
import os
import json
from django.core.exceptions import ImproperlyConfigured
# some settings
# ...
# ...
INSTALLED_APPS = [
# encryption.py
def 시프트(입력, 횟수):
알파벳 = 'abcdefghijklmnopqrstuvwxyz'
결과 = ''
for 원래알파벳 in 입력:
숫자알파벳 = 알파벳.index(원래알파벳)
변환알파벳 = 알파벳[(숫자알파벳+횟수)%26]
print(원래알파벳+'-->'+변환알파벳)
# coding: utf-8
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from pandas_datareader import data as web
import time
start_time = time.time()
@Beomi
Beomi / auth.py
Created February 18, 2017 09:43
class MyUserAuthBackend(object):
def check_legacy_password(self, db_password, supplied_password):
return constant_time_compare('*'+ hashlib.sha1(hashlib.sha1(supplied_password.encode('utf-8')).digest()).hexdigest().upper(), db_password)
def authenticate(self, username=None, password=None):
""" Authenticate a user based on mb_id as the user name. """
try:
@Beomi
Beomi / deploy.json
Last active March 19, 2017 14:29
Fabric for Django Deploy
{
"REPO_URL":"",
"PROJECT_NAME":"",
"REMOTE_HOST_SSH":"",
"REMOTE_HOST":"",
"REMOTE_USER":"",
"REMOTE_PASSWORD":""
}
@Beomi
Beomi / cap.sh
Last active March 26, 2017 15:41
Upload capture for GoogleDrive
#!/bin/bash
# 1st Install https://github.com/prasmussen/gdrive
# then use this script in Alfred or from CLI when you want to screenshot then upload to your gdrive
# then share the link to others from your paste board
# (run gdrive one first time to authenticate with Google)
screencapture -tpng -i /tmp/temp_shot_gdrive.png
DATEFILENAME=`date +"%Y%m%d%H%M"`
# use -p id to upload to a specific folder