Skip to content

Instantly share code, notes, and snippets.

View minhoryang's full-sized avatar
😍
Happy Today!

Minho Ryang minhoryang

😍
Happy Today!
View GitHub Profile
@minhoryang
minhoryang / easing.js
Created January 22, 2014 08:58 — forked from gre/easing.js
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
#!/usr/bin/env python
#
# usage:
# conv2vmx-ovf.py some-vm.ovf
#
# ref: http://www.cnblogs.com/eshizhan/p/3332020.html
#
import sys
fn = sys.argv[1]
@minhoryang
minhoryang / FileReaderWithTQDM.py
Last active August 29, 2015 14:05
(Snippet) Reading File with Progressbar(TQDM), but it's okay to not have.
#!env python3
"""TestResult scorer for MusicID (in-house project)."""
import mmap
import os
import re
import sys
try:
from tqdm import tqdm
except ImportError:
@minhoryang
minhoryang / sort_encoding_multiprocessing.py
Last active August 29, 2015 14:05
(Snippet) Divide the unknown encoding files to its encoding-named directory (with multiprocessing.Pool).
#!env python3
"""Divide the unknown encoding files to its encoding-named directory."""
from functools import lru_cache
import os
from chardet.universaldetector import UniversalDetector
def detect_encoding(path):
"""Using external module 'chardet', detect the encoding and return."""
#!/usr/bin/env python2
# coding: utf-8
from __future__ import print_function
import sys
import re
import json
import urllib
from colorama import init, Fore, Back, Style
URL = 'http://csearch.naver.com/dcontent/spellchecker.nhn'
@minhoryang
minhoryang / gist:13d8b1516836e55acb9f
Created February 6, 2015 12:21
Add Dell Openmanage Repository and Install.
echo 'deb http://linux.dell.com/repo/community/ubuntu precise openmanage' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list
gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F
gpg -a --export 1285491434D8786F | sudo apt-key add -
apt-get update
apt-get install srvadmin-all
vi /opt/dell/srvadmin/sbin/CheckSystemType
service dsm_om_connsvc start
update-rc.d dsm_om_connsvc defaults
@minhoryang
minhoryang / SettingIAM.py
Last active April 4, 2016 11:04
Sign-in Multiple AWS Accounts and Get Credentials (NEED TO TYPE CAPTCHA)
from boto import config, connect_iam
config.add_section('Credentials')
prefix = "--------"
username = "student"
password = ""
for i in range(0, 111):
idx = "{0:03}".format(i)
cred = open(idx)
@minhoryang
minhoryang / 1-twisted-https.py
Last active January 24, 2018 12:21
Using SSL Certificate, PrivateKey, CertChains with Python Flask/Twisted
from OpenSSL.crypto import load_privatekey, load_certificate, FILETYPE_PEM
#from OpenSSL.SSL import SSLv3_METHOD
from twisted.internet import reactor
from twisted.internet.ssl import CertificateOptions, DefaultOpenSSLContextFactory, DiffieHellmanParameters
from twisted.web import proxy, server
from twisted.python.filepath import FilePath
sample_site = server.Site(proxy.ReverseProxyResource('localhost', 80, '')) # ignore it.
# AES256-SHA
@minhoryang
minhoryang / Newsroom.py
Created August 14, 2015 09:17
Korean News Crawler
#!py3env/bin/python
import os
import re
import sys
import a_href
##############################################3
from html.parser import HTMLParser
class Action(ActionMixIn, db.Model):
__bind_key__ = __tablename__ = "action"
class Action_01_NotResponsed_ByMe(Action):
__bind_key__ = "action"
__tablename__ = "Action_01_NotResponsed_ByMe".lower()
id = db.Column(db.Integer, db.ForeignKey('action.id'), primary_key=True)