Skip to content

Instantly share code, notes, and snippets.

View lucusowl's full-sized avatar

Park ChangMin lucusowl

  • South Korea
View GitHub Profile
@lucusowl
lucusowl / crypto-basic.js
Last active August 23, 2024 12:16
node.js (v15+) 에서 파일내용 암/복호화 기본 코드, 예시 알고리즘: 대칭키(AES-256-CBC), https://nodejs.org/api/crypto.html#cryptocreatecipherivalgorithm-key-iv-options
/**
* KEY generation
*/
function keyGenerate(keyName, ivName, keySize=32, ivSize=16){
const key = randomBytes(keySize)
const iv = randomBytes(ivSize)
writeFile(keyName, key, err=>{if(err)console.error(err)})
writeFile(ivName, iv, err=>{if(err)console.error(err)})
}
@lucusowl
lucusowl / counter.html
Created February 29, 2024 09:35
간단한 횟수 세기 용도, forwrd/backward 기능, 초기화 기능
<main>
<button class="btn" onclick="increase()">+</button>
<button class="btn" onclick="decrease()">-</button>
<button class="btn" onclick="reset()">R</button>
<span id="display">0</span>
</main>
<style>
button.btn{
width: 4rem;
height: 4rem;
@lucusowl
lucusowl / black.html
Last active May 13, 2026 16:28
까만화면(최소화버전)
<style>*{background:#000
@lucusowl
lucusowl / http.server.vanilla.py
Created December 24, 2023 01:07
파이썬 기본 모듈만을 가지고 작성한 http server 소스코드입니다. http.server.HTTPServer 보다는 http.server.ThreadingHTTPServer 가 다수의 유저에게 서비스 제공에 용이합니다. 추가적으로 헤더에 있는 Server정보도 기본정보만 보이게 변경해두었습니다.
from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler
_HOSTNAME = ''
_PORT = 8080
class CustomHttp(BaseHTTPRequestHandler):
def do_GET(self):
self.server_version = "BaseHTTP" # BaseHTTP/{version number}
self.sys_version = "Python" # Python/{version number}
@lucusowl
lucusowl / formstamp.py
Created November 27, 2023 13:21
A Instance Generator through a specific formatting/template
from datetime import datetime, date
class Stamp:
def __init__(self, obj = None):
self.set_template(obj)
def __deepcopy(self, ele):
if ele == None:
return None
@lucusowl
lucusowl / aws-ssh-key.md
Last active November 4, 2023 11:11
AWS EC2 인스턴스에 SSH 클라이언트로 연결하기

linux/unix based

Reference: LINK

  1. 키 권한 변경

    인스턴스 생성시 다운로드한 키의 권한을 변경합니다.

chmod 400 {키이름}.pem

@lucusowl
lucusowl / pull-all-git.sh
Created October 14, 2023 13:48
하위 폴더 중에 .git이 있는 모든 폴더 pull 시키는 스크립트
echo "[$(date "+%F(%a) %T(%z)")][Start] fetch all git repository"
for DIR in ./*; do
if [ -d "$DIR/.git" ]; then
cd "$DIR"
git pull
echo "[$(date "+%F(%a) %T(%z)")][Done] fetch $DIR repository"
cd ..
fi
done
@lucusowl
lucusowl / git-alias.md
Last active July 2, 2023 06:24
Git 단축 명령어

현재 주로 쓰는 git 단축 명령어 목록

git 설정파일에 아래의 내용을 작성

[alias]
	alias = "!# Prints all aliases. \n\
		git config -l \
		| egrep '^alias.+' \
 | sed -e 's/^alias\\.//' \
@lucusowl
lucusowl / git-setup.md
Created March 5, 2023 07:48
Git 설치 및 기본 설정 방법

Introduction

기본적인 git CLI설정 설명서입니다

git CLI가 git에서 지원하는 모든 기능을 이용할 수 있기에 추천하지만

GUI와 같은 직관적이고 간편한 인터페이스를 원한다면 git UI App(VS Code, Source Tree, git Kraken, etc)을 이용해 주세요

git 설치

@lucusowl
lucusowl / ssh-key.md
Created March 5, 2023 07:14
SSH 보안 키 생성하는 방법

Introduction

OpenSSH에서 제공하는 ssh-keygenssh-agent를 통해 KEY 생성과 관리하는 방법에 대한 설명서입니다

1. ssh-key 생성

IF) KEY가 이미 생성되어 있는 지 확인

KEY와 설정에 대한 정보는 ~/.ssh디렉토리 아래에 존재합니다