Skip to content

Instantly share code, notes, and snippets.

View byung-u's full-sized avatar
🍀

Byungwoo Jeon byung-u

🍀
  • Seoul, Republic of Korea
View GitHub Profile
@byung-u
byung-u / kerberos_setup.md
Created August 22, 2019 09:40 — forked from ashrithr/kerberos_setup.md
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

## Cell에서 AA로 시작하지 않는 것들은 모두 안보이게 하고 싶다는
## 요구사항에 대해서 이를 출력해주는 코드
import pandas as pd
def main():
df = pd.read_csv('./test.csv', delimiter='|', header=None)
for row in range(df.shape[1]):
df[row] = df[row].str.replace(r'^((?!AA).)*', '')
# I wanna make `grep` result like this
#
# % jgrep pStStps *.c
#
# vi -R MS_Stf.c +1006 if (!HINSERT(HTbl[T->i], &pStStps->lkey, 0, pStStps))
# vi -R MS_Stf.c +1009 pStStps->lkey, errno);
# vi -R MS_Stf.c +1010 CancelEvent(T->pool, pStStps->iTimer);
# vi -R MS_Stf.c +1011 free(pStStps);
# vi -R MS_Stf.c +1014 return pStStps;
@byung-u
byung-u / remove_subtitle_new_line.py
Last active December 29, 2016 00:31
자막파일에서 자막에 붙어있는 개행문자 제거해주는 스크립트
#!/usr/bin/env python3.5
#
# 원본
# 00:14:17.810 --> 00:14:22.529
# since the previous function was a generator
# that returns a list of positions, the caller
# 스크립트 실행 후 개행문자 제거
# 00:14:17.810 --> 00:14:22.529
# since the previous function was a generator that returns a list of positions, the caller
#
@byung-u
byung-u / subtitle_time_remove_space.py
Last active December 28, 2016 06:29
구글 기계번역 후 자막의 시간 정보가 바뀌는데 이를 한번에 수정해주는 스크립트
#!/usr/bin/env python3.5
#
# 자막의 원본 파일의 시간 형식 : 00:36:47.450 --> 00:36:50.560
# 구글 기계번역 후의 시간 형식 : 00 : 37 : 24.250 -> 00 : 37 : 30.160
#
# 차이점
# 1. ':' 앞뒤로 공백 추가
# 2. '-'가 1개 사라짐
#
# 이를 원래의 자막 시간 형식으로 되돌려 주는 스크립트
@byung-u
byung-u / exit_while_loop_by_enter_key.py
Last active March 10, 2022 21:42
Exit while loop by user hitting enter key (python)
#!/usr/bin/env python3
# http://stackoverflow.com/questions/7255463/exit-while-loop-by-user-hitting-enter-key
while True:
i = input("Enter text (or Enter to quit): ")
if not i:
print("excape") # Enter key to quit
break
print("Your input:", i)
proc_stat_list[proc_list_idx].mem_percent =
(double)(proc_stat_list[proc_list_idx].proc_rss * 100.0) / total_mem;