Skip to content

Instantly share code, notes, and snippets.

View rkdgusrnrlrl's full-sized avatar

Kang Hyeon Ku rkdgusrnrlrl

View GitHub Profile
@rkdgusrnrlrl
rkdgusrnrlrl / README.md
Created July 14, 2023 00:30 — forked from JosimarCamargo/README.md
How to setup a Postgres replication with docker and docker-compose

How to setup a Postgres replication with docker and docker-compose

How to use

To run you will need docker and docker-compose installed, and run the command docker-compose up on a folder within this file named docker-compose.yml(attached in this Gist)

How the PGAudit is enable, you will see the queries log and in which database is running which query, this is the main purpose of this Gist, along with have a database with replication working out of the box

To add user with just reading rights to access the database on slave replica

git for-each-ref refs/heads/ --count=10 --format='%(refname:short)' --sort=committerdate | grep users
echo "delete that branches(y/n): "
read name
if [ $name == 'y' ]; then
git for-each-ref refs/heads/ --count=10 --format='%(refname:short)' --sort=committerdate | grep users | xargs git branch -D
echo "deleted branches"
else
echo "cencel delete branches"
@rkdgusrnrlrl
rkdgusrnrlrl / pdf_manager.py
Created July 27, 2021 14:29
pdf 암호 제거 및 병합 하는 기능 함수(pikepdf, PyPDF2 라이브러리 설치 필요)
import pikepdf
import os
from PyPDF2 import PdfFileMerger
# pip install pikepdf
# pip install PyPDF2
def pdf_merge(key_file_names, dir_path):
ff = os.listdir(dir_path)
import sys
kor_num = {'영': 0, '일': 1, '이': 2, '삼': 3, '사': 4, '오': 5,
'육': 6, '칠': 7, '팔': 8, '구': 9, '십': 10, '백': 100, '천': 1000,
'만': 10000, '억': 100000000, '조': 1000000000000 }
def int_kor(str_num):
num_strs = [ss for ss in str_num]
idx = 0
total = 0
import sys
if __name__ == "__main__":
f_str = [ss for ss in sys.argv[1]]
f_str.reverse()
s_str = [ss for ss in sys.argv[2]]
s_str.reverse()
@rkdgusrnrlrl
rkdgusrnrlrl / change_mobile.py
Last active November 2, 2020 05:01
chrome remote debugger
import websocket
# pip install websocket-client
import json
try:
import thread
except ImportError:
import _thread as thread
import time
import requests
# pip install requests
import websocket
# pip install websocket-client
import json
try:
import thread
except ImportError:
import _thread as thread
import time
import requests
# pip install requests
@rkdgusrnrlrl
rkdgusrnrlrl / network.py
Created November 28, 2019 05:32
remote debugger network
import websocket
import json
import requests
import signal
import sys
from os import path
import logging
logging.basicConfig(filename='network_monitor.log',level=logging.DEBUG)
from time import sleep
@rkdgusrnrlrl
rkdgusrnrlrl / sock.py
Last active November 28, 2019 05:46
add how get ws url
import websocket
# pip install websocket-client
import json
try:
import thread
except ImportError:
import _thread as thread
import time
import requests
# pip install requests
@rkdgusrnrlrl
rkdgusrnrlrl / docker_cheat.md
Created December 22, 2018 01:54 — forked from nacyot/docker_cheat.md
도커(Docker) 치트 시트

Docker 치트 시트

한국어 번역(초벌) : nacyot

왜 Docker를 사용해야하는가?

Why Should I Care (For Developers)

"나에게 Docker의 매력은 간단히 격리된 환경을 만들 수 있다는 것과, 그러한 환경을 재사용할 수 있다는 점이다."런타임 환경을 한 번 만들어 패키지로 만들면, 이 패키지를 다른 어떤 머신에서도 다시 사용할 수 있다. 또한 여기서 실행되는 모든 것은 마치 가상머신과 같이 호스트로부터 격리되어있다. 무엇보다도 이런 모든 일들이 빠르고 간단히 가능하다.