Skip to content

Instantly share code, notes, and snippets.

View neoneo40's full-sized avatar

neo neoneo40

  • Seoul, Korea
View GitHub Profile
@jordan-wright
jordan-wright / check_hosts.py
Last active February 16, 2019 15:38
Fabric Botnet C&C Blog Post
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"
@st4lk
st4lk / root_logger_settings.py
Last active May 2, 2024 15:25
Python logging settings for root logger
"""
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
@devxoul
devxoul / korail.py
Last active January 24, 2023 08:39
[Deprecated] 코레일 승차권 검색 및 예매 프로그램. https://github.com/devxoul/korail
# -*- 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
@cornchz
cornchz / scraper.py
Last active May 1, 2018 12:13
[PyConKR 2014] 30분만에 따라하는 동시성 스크래퍼
# -*- 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
@jmjeong
jmjeong / toc.py
Last active October 26, 2015 03:07
markdown toc generator
#!/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
@bjorgvino
bjorgvino / yosemite ntfs read+write.txt
Last active December 2, 2021 03:58
osxfuse + ntfs-3g + Yosemite = NTFS R/W
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
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
@bavernet
bavernet / ITES
Created December 22, 2014 11:35
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
@allieus
allieus / app_icon_creator.py
Last active September 22, 2015 17:55
OSX/iOS/Android 앱 아이콘 생성기
#!/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 = {
--- 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': [