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 binascii | |
from datetime import datetime | |
def chunkstring(string, length): | |
return (string[0+i:length+i] for i in range(0, len(string), length)) | |
# Open in binary mode (so you don't read two byte line endings on Windows as one byte) | |
# and use with statement (always do this to avoid leaked file descriptors, unflushed files) | |
with open('hexdata.txt', 'r') as f: |
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
{ | |
"REPO_URL":"깃헙Repo주소", | |
"PROJECT_NAME":"프로젝트폴더(settings.py가있는 폴더)의 이름", | |
"REMOTE_HOST":"여러분이 만든 도메인주소(ex: djangogirls-seoul-tutorial.tk )", | |
"REMOTE_USER":"django", | |
"STATIC_ROOT":"static", | |
"STATIC_URL":"static", | |
"MEDIA_ROOT":"media" | |
} |
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
# parser.py | |
import requests | |
# 로그인할 유저정보를 넣어주자 (모두 문자열) | |
LOGIN_INFO = { | |
'email': '[email protected]', | |
'pw': 'aaa124', | |
'proc': 'login', | |
'returnUrl': '', | |
'witnessMe': '1' |
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 | |
# 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 |
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
{ | |
"REPO_URL":"", | |
"PROJECT_NAME":"", | |
"REMOTE_HOST_SSH":"", | |
"REMOTE_HOST":"", | |
"REMOTE_USER":"", | |
"REMOTE_PASSWORD":"" | |
} |
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
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: |
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
# 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() |
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
# encryption.py | |
def 시프트(입력, 횟수): | |
알파벳 = 'abcdefghijklmnopqrstuvwxyz' | |
결과 = '' | |
for 원래알파벳 in 입력: | |
숫자알파벳 = 알파벳.index(원래알파벳) | |
변환알파벳 = 알파벳[(숫자알파벳+횟수)%26] | |
print(원래알파벳+'-->'+변환알파벳) |
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 os | |
import json | |
from django.core.exceptions import ImproperlyConfigured | |
# some settings | |
# ... | |
# ... | |
INSTALLED_APPS = [ |
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 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) |