Skip to content

Instantly share code, notes, and snippets.

Avatar
🇰🇷

CHANN channprj

🇰🇷
View GitHub Profile
@channprj
channprj / README.md
Last active Aug 5, 2020
실행중인 파이썬 프로세스 모니터링하기
View README.md

실행중인 파이썬 프로세스 모니터링하기

사전준비

pip install pyrasite urwid meliae

사용방법

View keybase-github.md

키베이스로 깃 커밋 서명하는법

A. PGP 공개키-비공개키 키쌍 등록

갖고있는 PGP 키쌍이 없을경우 새로 만들어야한다. 이미 키 쌍이 keybase에 업로드되어있는 경우, 기존의 키를 컴퓨터에 다운로드하기만 하면 된다.

A.1. 새 키 만들어서 하는법

keybase login
@channprj
channprj / remove_danglings.sh
Last active Jul 9, 2020
Remove dangling images and volumes silently
View remove_danglings.sh
#!/bin/bash
# Remove exited containers
EXITED_CONTAINERS=$(docker ps -a -f status=exited -q)
if [ ! -z "${EXITED_CONTAINERS}" ]
then
docker rm ${EXITED_CONTAINERS} &2>1
echo "Remove exited containers."
else
echo "...No exited containers."
@channprj
channprj / docker-compose.yml
Created Jul 6, 2020 — forked from barnybug/docker-compose.yml
Docker compose for a Docker-in-docker gitlab runners setup
View docker-compose.yml
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2
@channprj
channprj / config
Created Jun 7, 2020
~/.ssh/config
View config
ServerAliveInterval 120
Host *
UseKeychain yes
# Company Server
# ------------------------------------
Host company-sample-server
HostName sample.company.com
User sample_user
IdentityFile ~/.ssh/sample/id_rsa
View init_postgresql_example.sql
-- Postgres 계정 생성 및 설정
CREATE ROLE sample_user WITH LOGIN PASSWORD 'sample_password';
-- Postgres 데이터베이스 생성
CREATE DATABASE sample_db WITH OWNER sample_user ENCODING 'UTF8' LC_COLLATE = 'ko_KR.UTF-8' LC_CTYPE = 'ko_KR.UTF-8';
-- sample_db 로 접속
\c sample_db;
-- DB 권한 부여
@channprj
channprj / nginx.conf
Created Apr 7, 2020
Nginx conf for simultaneous streaming
View nginx.conf
worker_processes 2;
# error_log logs/error.log debug;
error_log off;
events {
worker_connections 1024;
}
rtmp {
@channprj
channprj / restream.css
Last active Apr 5, 2020
Personal restream css
View restream.css
body {
background-color: rgba(0, 0, 0, 0) !important;
margin: 0px auto; overflow: hidden;
}
.restream-embed-themes-chat-container.restream-embed-themes-chat-container_default {
background: transparent !important;
}
.message-item {
@channprj
channprj / audit_mixin.py
Created Mar 5, 2020 — forked from techniq/audit_mixin.py
Useful SQLAlchemy Mixins
View audit_mixin.py
from datetime import datetime
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declared_attr
from flask_security import current_user
class AuditMixin(object):
created_at = Column(DateTime, default=datetime.now)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now)
@channprj
channprj / set_ssh_key_permission.sh
Created Jan 10, 2020
ssh key chmod 자꾸 까먹어서 올려둠.
View set_ssh_key_permission.sh
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts