Skip to content

Instantly share code, notes, and snippets.

😍
Happy Today!

Minho Ryang minhoryang

😍
Happy Today!
Block or report user

Report or block minhoryang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 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
View conv2vmx-ovf.py
#!/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 Aug 29, 2015
(Snippet) Reading File with Progressbar(TQDM), but it's okay to not have.
View FileReaderWithTQDM.py
#!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 Aug 29, 2015
(Snippet) Divide the unknown encoding files to its encoding-named directory (with multiprocessing.Pool).
View sort_encoding_multiprocessing.py
#!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."""
View spellchecker.py
#!/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 Feb 6, 2015
Add Dell Openmanage Repository and Install.
View gist:13d8b1516836e55acb9f
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 Apr 4, 2016
Sign-in Multiple AWS Accounts and Get Credentials (NEED TO TYPE CAPTCHA)
View SettingIAM.py
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 Jan 24, 2018
Using SSL Certificate, PrivateKey, CertChains with Python Flask/Twisted
View 1-twisted-https.py
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 Aug 14, 2015
Korean News Crawler
View Newsroom.py
#!py3env/bin/python
import os
import re
import sys
import a_href
##############################################3
from html.parser import HTMLParser
View Is_It_Reduced_by_Metaclass.py
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)
You can’t perform that action at this time.