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
@ECHO OFF | |
IF "%1" == "" GOTO END_A | |
IF "%2" == "" GOTO END_A | |
ECHO 파일 복사 및 생성을 시작합니다. 각 웹서버에 네트워크 연결이 되어 있어야 합니다. | |
@ECHO ON | |
@ECHO OFF | |
SET TODAY=%date:~-10,4%%date:~-5,2%%date:~-2,2% |
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
--기본 | |
curl http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/ | |
--헤더 추가 | |
curl -H 'Content-Type: application/json' http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/ |
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
@rem hosts file backup | |
xcopy "%systemroot%\system32\drivers\etc\hosts" ".\" /s /y | |
echo 192.168.0.1 openapi.seoul.go.kr #testserver-01 > "%systemroot%\system32\drivers\etc\hosts" | |
ipconfig /flushdns | |
wget -O result01.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/" | |
echo 192.168.0.2 openapi.seoul.go.kr #testserver-02 > "%systemroot%\system32\drivers\etc\hosts" | |
ipconfig /flushdns | |
wget -O result02.txt "http://openapi.seoul.go.kr:8088/sample/json/ForecastWarningUltrafineParticleOfDustService/1/5/" |
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
extension NSDate | |
{ | |
func hour() -> Int | |
{ | |
//Get Hour | |
let calendar = NSCalendar.currentCalendar() | |
let components = calendar.components(.Hour, fromDate: self) | |
let hour = components.hour | |
//Return Hour |
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
extension String | |
{ | |
func replace(target: String, withString: String) -> String | |
{ | |
return self.replacingOccurrences(of: target, with: withString, options: NSString.CompareOptions.literal, range: nil) | |
} | |
} |
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
extension String | |
{ | |
func replace(target: String, withString: String) -> String | |
{ | |
return self.stringByReplacingOccurrencesOfString(target, withString: withString, options: NSStringCompareOptions.LiteralSearch, range: nil) | |
} | |
} |
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
extension Date | |
{ | |
func hour() -> Int | |
{ | |
//Get Hour | |
let calendar = Calendar.current | |
let hour = calendar.component(.hour, from: Date()) | |
//Return Hour | |
return hour |
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
### Run Python scripts as a service example (ryrobes.com) | |
### Usage : python aservice.py install (or / then start, stop, remove) | |
import win32service | |
import win32serviceutil | |
import win32api | |
import win32con | |
import win32event | |
import win32evtlogutil | |
import os, sys, string, time |
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
/* | |
mapper의 writeValueAsString() | |
*/ | |
ObjectMapper mapper = new ObjectMapper(); | |
System.out.println(mapper.writeValueAsString(jsonString)); | |
{"attributes":[{"nm":"ACCOUNT","lv":[{"v":{"Id":null,"State":null},"vt":"java.util.Map","cn":1}],"vt":"java.util.Map","status":"SUCCESS","lmd":13585},{"nm":"PROFILE","lv":[{"v":{"Party":null,"Ads":null},"vt":"java.util.Map","cn":2}],"vt":"java.util.Map","status":"SUCCESS","lmd":41962}]} | |
/* | |
mapper의 defaultPrettyPrintingWriter().writeValueAsString() |
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 inspect | |
from inspect import currentframe, getframeinfo | |
import dis | |
def test(): | |
frame_info = getframeinfo(currentframe()) | |
print 'file name :', frame_info.filename | |
print 'line no :' , frame_info.lineno | |
print 'function name :', frame_info.function |
OlderNewer