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
import statsmodels.api as stapi
import numpy
def main():
(N, X, Y) = read_data()
results = do_multivariate_regression(N, X, Y)
print(results.summary())
effective_variables = get_effective_variables(results)
@Beomi
Beomi / models.py
Last active May 19, 2017 02:42
Using Gnuboard DB with Django custom AUTH_USER_MODEL
#GNUBOARD MODELS // DO NOT TOUCH!
class G5Member(AbstractBaseUser):
mb_no = models.AutoField(primary_key=True)
mb_name = models.CharField(max_length=255)
mb_nick_date = models.DateField()
email = models.CharField(max_length=255, db_column='mb_email', null=True)
mb_homepage = models.CharField(max_length=255, null=True)
mb_level = models.IntegerField()
mb_sex = models.CharField(max_length=1, null=True)
mb_birth = models.CharField(max_length=255, null=True)
@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: