Skip to content

Instantly share code, notes, and snippets.

@kerus1024
kerus1024 / nodejs-xlsx-merge-test.js
Created June 11, 2022 18:24
NodeJS에서 xlsx파일 merge 프로그램 백업
//
// NodeJS에서 xlsx파일 merge 프로그램 백업
// express.js랑 묶여있어서 참고용
//
//
const UPLOAD_TMPDIR = `${process.cwd()}/uploads_tmp/`;
const UPLOAD_DIR = `${process.cwd()}/uploads/`;
const TypeAPPSTATUS = {
WAIT: 0,
@kerus1024
kerus1024 / debian11-k8s-standalone-cluster.bash
Last active July 23, 2022 14:18
debian11-k8s-standalone-cluster.bash
#!/bin/bash
set -xe
# kernel parameter
cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
br_netfilter
EOF
cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
@kerus1024
kerus1024 / socat-tcp-reverse-proxy.bash
Created July 23, 2022 14:24
Simple TCP Reverse Proxy by using socat
socat -d -d TCP4-LISTEN:10999,fork TCP:10.50.20.1:4000
@kerus1024
kerus1024 / k8s-local-path.md
Created July 23, 2022 14:35
Kubernetes (K8S) Standalone Node : Use Local-Path Provisioner
ip6tables --policy INPUT DROP;
ip6tables --policy OUTPUT ACCEPT;
ip6tables --policy FORWARD DROP;
ip6tables -Z;
ip6tables -F;
ip6tables -X;
ip6tables -t nat -F
ip6tables -t mangle -F
@kerus1024
kerus1024 / php freeradius add new user .sh
Last active August 6, 2022 08:55
php freeradius add new user
USERNAME="samsung"
PASSWORD="pass"
SQL="use radius; INSERT INTO radcheck (username, attribute, op, value) VALUES ('$USERNAME','User-Password',':=','$PASSWORD');"
mysql -u root -p radius <<EOF
$SQL
EOF
@kerus1024
kerus1024 / run_multiple_process_with_features_restart_process_when_single_process_failed.bash
Created September 11, 2022 09:47
Bash Shell Script Run multiple process with features that re-starts process when single process failed
#!/bin/bash
JOBS=()
run_jobs() {
$@ &
JOBS+=($!)
}
while true;
do
@kerus1024
kerus1024 / run_multiple_process_with_features_restart_process_when_single_process_failed_and_daily_restarts.bash
Last active September 17, 2022 03:52
Bash Shellscript run_multiple_process_with_features_restart_process_when_single_process_failed_and_daily_restarts.bash
#!/bin/bash
PID=$$
RESTART_SECONDS_AFTER=15
get_date() {
echo $(TZ="Asia/Seoul" date +%Y%m%d)
}
run_jobs() {
$@ &
@kerus1024
kerus1024 / proxmox-macip-filter.sh
Created November 19, 2022 18:04
Proxmox MAC/IP Filter
#!/bin/bash
ebtables -F INPUT
ebtables -F FORWARD
CHAINNAME=MY_MACFILTER
ebtables -F $CHAINNAME 2>/dev/null
ebtables -D $CHAINNAME 2>/dev/null
ebtables -N $CHAINNAME
ebtables -A INPUT -j $CHAINNAME
@kerus1024
kerus1024 / install-openresty.bash
Last active December 4, 2022 15:59
Openresty Install on Debian/Ubuntu
#!/bin/bash
#
# Openresty Installation
# working on debian 11, ubuntu 22.04
#
# Define Some Variables
set -ex
ORIGIN_WORK_DIRECTORY="$(pwd)"
SOURCE_WORK_DIRECTORY="/opt"