Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Heechan Park channprj

View GitHub Profile
@channprj
channprj / config
Created June 7, 2020 16:44
~/.ssh/config
ServerAliveInterval 120
Host *
UseKeychain yes
# Company Server
# ------------------------------------
Host company-sample-server
HostName sample.company.com
User sample_user
IdentityFile ~/.ssh/sample/id_rsa
-- 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 April 7, 2020 16:10
Nginx conf for simultaneous streaming
worker_processes 2;
# error_log logs/error.log debug;
error_log off;
events {
worker_connections 1024;
}
rtmp {
@channprj
channprj / restream.css
Last active April 9, 2024 20:30
Personal 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 March 5, 2020 12:03 — forked from techniq/audit_mixin.py
Useful SQLAlchemy Mixins
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 January 10, 2020 08:25
ssh key chmod 자꾸 까먹어서 올려둠.
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
chmod 644 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
const tzOffset = (new Date()).getTimezoneOffset() * 60000
const now = new Date(Date.now() - tzOffset).toISOString();
@channprj
channprj / repo-reset.md
Created December 18, 2019 13:24 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
# NO MORE EUC-KR
def utf8_to_euc(str):
return unicode(str, 'utf-8').encode('euc-kr')
def euckr_to_utf8(str):
return unicode(str, 'euc-kr').encode('utf-8')
@channprj
channprj / oldman_shaves_opensource.md
Last active September 19, 2023 10:43
퇴근길에 @lqez 님 트윗을 보고 갑자기 영감을 받아 작성해봤습니다. 이미 유행 한참 지난 밯망희 깎던 노인쓰,,,

바닐라 스크립트로 오픈소스 깎던 노인

벌써 3~4여 년 전이다. 내가 개발자로 취직한 지 얼마 안 되어 테헤란로 쪽에서 일할 때다. 퇴근하며 트위터 타임라인을 훑어보는 와중에, 재미있는 트윗을 발견하여 정독하던 중이었다. 스타벅스 앞을 지날 즈음, 그 곳에는 바닐라 자바스크립트로 오픈소스를 깎던 노인이 있었다. 마침 유용할 것 같은 프로젝트라 오픈소스 패키지로 받아 쓰려고 부탁을 했다. 버전을

"좀 빨리 올려 줄 수 없습니까?"

했더니,

"마이너 버전 릴리즈 하나 가지고 에누리하겠소? 비싸거든 다른 오픈소스 받아서 쓰시우."