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
def check_hosts(): | |
''' Checks each host to see if it's running ''' | |
for host, result in execute(run_command, "uptime", hosts=env.hosts).iteritems(): | |
running_hosts[host] = result if result.succeeded else "Host Down" |
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
""" | |
Settings for root logger. | |
Log messages will be printed to console and also to log file (rotated, with | |
specified size). All log messages from used libraries will be also handled. | |
Three approaches for defining logging settings are used: | |
1. using logging classes directly (py25+, py30+) | |
2. using fileConfig (py26+, py30+) | |
3. using dictConfig (py27+, py32+) | |
Choose any variant as you like, but keep in mind python versions, that |
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 -*- | |
""" | |
This code won't be updated anymore. | |
Project has moved to repository: https://github.com/devxoul/korail | |
""" | |
import requests | |
from bs4 import BeautifulSoup | |
from datetime import datetime |
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 -*- | |
from __future__ import unicode_literals | |
from gevent import monkey; monkey.patch_all() | |
import re | |
from urlparse import urljoin | |
from gevent.pool import Pool | |
import requests |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# markdown toc generator, v1.8 | |
# | |
# Jaemok Jeong, 2014/10/27 | |
from AppKit import NSPasteboard, NSArray | |
import re | |
import argparse |
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
Remove osxfuse if installed via homebrew: | |
> brew uninstall osxfuse | |
Install osxfuse binary and choose to install the MacFUSE compatibility layer: | |
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files | |
Reboot (optional but recommended by osxfuse) | |
Install ntfs-3g via homebrew: | |
> brew update && brew install ntfs-3g |
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
def gen_data(): | |
a = 1983 | |
po = pow(2, 32) | |
while True: | |
yield a % 10000 + 1 | |
a = (a * 214013 + 2531011) % po | |
def do_case(k, n): | |
head = gen_data().next |
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
q = [0] * 5000000 | |
def solve(k, n): | |
ss = 0 | |
cnt = 0 | |
prev = 1983 | |
front = 0 | |
rear = 0 | |
for i in xrange(n): | |
num = prev % 10000 + 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
#!/usr/bin/env python2 | |
# coding: utf-8 | |
from __future__ import print_function | |
from tempfile import NamedTemporaryFile | |
import os | |
import sys | |
from shutil import copyfile | |
from wand.image import Image | |
DIMENSIONS = { |
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
--- appicon.py 2015-01-23 02:21:33.000000000 +0900 | |
+++ appicon2.py 2015-01-23 02:47:26.000000000 +0900 | |
@@ -4,6 +4,7 @@ | |
import os | |
import sys | |
from wand.image import Image | |
+from wand.exceptions import BlobError, CoderError, MissingDelegateError | |
DIMENSIONS = { | |
'OSX': [ |