This file contains 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 | |
import sys | |
import xml.dom.minidom | |
data = sys.stdin.read() | |
xml = xml.dom.minidom.parseString(data) | |
print xml.toprettyxml(indent=" ", newl="") |
This file contains 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
error_log logs/error.log; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
proxy_cache_path /data/cache/page levels=1:2 keys_zone=python:10m max_size=1g inactive=5m; | |
server { | |
access_log logs/access.log; | |
listen 8080; | |
lua_code_cache off; |
This file contains 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 -*- | |
from BeautifulSoup import BeautifulSoup | |
from urlparse import urlparse | |
import urllib2 | |
import json | |
import sys | |
import re |
This file contains 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 scrapy | |
from thaischool.items import ThaischoolItem | |
class SchoolSpider(scrapy.Spider): | |
name = "school" | |
allowed_domains = ["thaischool.in.th"] | |
base_url = 'http://www.thaischool.in.th/sitemap.php?page=%s&school_area=&province_id=&txtsearch=' | |
start_urls = [] | |
for i in range(1,236): |
This file contains 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 | |
from BeautifulSoup import BeautifulSoup | |
import urllib2 | |
import sys | |
if len(sys.argv) < 2 : | |
print 'Usage : fbbot.py URL' | |
exit() | |
http = urllib2.build_opener() |
This file contains 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 luajit | |
-- author : Narate Ketram | |
-- github.com/narate | |
-- usage : | |
--[[ | |
echo ' | |
{ | |
"query": { | |
"bool": { |
This file contains 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 luajit | |
-- author : Narate Ketram | |
-- github.com/narate | |
-- $ echo '{"name":"narate"}' | parse_json name | |
-- "narate" | |
local cjson = require 'cjson.safe' | |
local data = io.read('*all') | |
local json = cjson.decode(data) |
This file contains 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 | |
if [ $# -eq 0 ]; then | |
echo "Usage : $ exif /path/to/file" | |
exit | |
fi | |
echo "EXIF of `basename $1`" | |
identify -format %[exif:*] $1 |
This file contains 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/python | |
import sys | |
import json | |
data = sys.stdin.read() | |
json_data = json.loads("".join(data)) | |
json_string = json.dumps(json_data, sort_keys=True, indent=4, ensure_ascii=False) | |
print(json_string) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#logs_content { | |
border: 1px solid red; | |
width:98%; | |
height: 480px; | |
position:relative; |