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 python3 | |
### Configuration ################################################ | |
CLIEN_USERID = 'XXXXXXXX' | |
CLIEN_PASSWD = 'XXXXXXXX' | |
TELEGRAM_TOKEN = '000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
TELEGRAM_CHAT_ID = '000000000' | |
### End of Configuration ######################################### | |
import argparse |
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
import re # 정규식(Regular Expression) | |
str = '2019-04-19 오후 1:50:39' # 2019-04-19 1:50:39 PM 로 바꾸고 싶다. dateutil.parser.parse()를 사용하기 위해서 | |
newstr = re.sub(r"(\S+) 오후 (\S+)", r"\1 \2 PM", str) # 2019-04-19 1:50:39 PM | |
print(newstr) |
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
import maya # pip install maya 잘 설치가 안되는 듯, 될때까지 반복 | |
str = '2019-04-19 1:50:39 PM' | |
dt = maya.parse(str).datetime() | |
print(dt) | |
print(dt.date()) | |
print(dt.time()) | |
print(dt.tzinfo) # 기본적으로 UTC로 설정 |
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
import dateutil.parser # pip install python-dateutil | |
str = '2019-04-19 1:50:39 PM' # 이런형태의 문자열을 날짜형으로 인식시켜야 한다 | |
#str = '2019-04-19 오후 1:50:39' # 한글은 안되는거 같음 | |
dt = dateutil.parser.parse(str) # 날짜로 추정되는 문자열을 datetime 데이터형으로 변환 | |
print(type(dt)) # t 의 데이터형 | |
print(dt) | |
print(dt.date()) |
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
import re # 정규식(Regular Expression) | |
str = '2019-04-19 오후 1:50:39' # 2019-04-19 1:50:39 PM 로 바꾸고 싶다. dateutil.parser.parse()를 사용하기 위해서 | |
list = re.split('오후 ', str) # '오후 '를 str에서 찾아서 둘로 쪼개어 각각을 list에 넣는다. 오후 다음에 Space가 있음에 유의 | |
print(list) | |
newstr = list[0] + list[1] + ' PM' | |
print(newstr) |
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
import os | |
def rename_movie_file(path, check_str): | |
for filename in os.listdir(path): | |
file_name, file_ext = os.path.splitext(filename) | |
file_ext = file_ext.lower() | |
if file_ext == '.md': | |
if check_str in filename: | |
file_name = file_name.replace(check_str, "") | |
rename_filename = file_name + file_ext |
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/sh | |
SL=/etc/apt/sources.list | |
cp ${SL} ${SL}.org | |
## | |
sed -e 's/\(us.\)\?archive.ubuntu.com/ftp.daumkakao.com/g' -e 's/security.ubuntu.com/ftp.daumkakao.com/g' < ${SL}.org > ${SL} | |
## check |
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
# Simple environment setup script | |
# Install Applications | |
choco install fiddler4 | |
choco install notepadplusplus | |
choco install visualstudiocode | |
choco install greenshot | |
choco install GoogleChrome | |
choco install putty | |
choco install ccleaner |
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 ON | |
REM install choco | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin | |
REM utility | |
choco install chocolatey-core.extension -y | |
choco install 7zip -y | |
choco install sysinternals -y | |
choco install procexp -y |
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
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory()))); |
NewerOlder