Skip to content

Instantly share code, notes, and snippets.

View roeniss's full-sized avatar
🌊
파도가 철썩 철썩 철썩

Roeniss Moon roeniss

🌊
파도가 철썩 철썩 철썩
View GitHub Profile
@roeniss
roeniss / letsencript_docker.md
Created December 29, 2019 07:47
let's encrypt certification / renew with docker
new
sudo docker run -it --rm --name certbot \
  -v '/etc/letsencrypt:/etc/letsencrypt' \
  -v '/var/lib/letsencrypt:/var/lib/letsencrypt' \
  certbot/certbot certonly -d '*.myDomain.com' --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory
renew
@roeniss
roeniss / addPlugins.sh
Created February 10, 2020 13:04
script for adding new plugin to zsh
# for example,
# plugins=(git)
# will become :
# plugins=(git zsh-autosuggestions)
# with "addPlugin zsh-autosuggestions"
# add below function to ~/.zsrc, then reload with 'source ~/.zshrc'
addPlugin() { l=`cat ~/.zshrc
| grep -n '^plugins=.*$'
| cut -f1 -d:`;
@roeniss
roeniss / script.sh
Created February 16, 2020 11:06
npx express-generator with options
#!/bin/bash
npx express-generator -e -v ejs -c sass -f --git .
@roeniss
roeniss / send_mail.py
Created March 17, 2020 00:32
simple python send_mail script (using gmail)
# -*- coding: utf-8 -*-
import csv
import os
import smtplib
from email.mime.text import MIMEText
import datetime
def sendGmail(userEmail, emailPassword, emailToBeSend, subject, htmlContent):
'''
Keep secret the PASSWORD !
@roeniss
roeniss / show_all_path.sh
Created April 6, 2020 05:07
show $PATH by one per line
echo $PATH | tr : \\n | xargs -n1
@roeniss
roeniss / gopen
Last active May 8, 2020 16:32
open git remote repository with Chrome
#!/bin/bash
# Using Chrome, open a github page of remote repo on current directory.
# tested on MacOS
REMOTE=$(git remote -v | sed -n '1,1p' | sed 's/.*https/https/' | sed 's/\ .*//')
open -a Google\ Chrome $REMOTE
@roeniss
roeniss / .eslintrc.json
Last active September 2, 2020 06:48
nodejs boilerplate snippets
{
"env": {
"browser": true,
"es2020": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
@roeniss
roeniss / makeSwap.sh
Created January 6, 2020 06:15
makeSwap.sh
# original article: [How To Add Swap Space on Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04)
# Cautious! Upgrading RAM is safer than this job.
# 1. check status
sudo swapon --show # no output == no available swap space
free -h # another way to do right above line
df -h # check available disk
# 2. create/enable swap file
@roeniss
roeniss / script.sh
Created January 19, 2021 04:54
bash script template
#!/usr/bin/env bash
set -Eeuxo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
사용법: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
#!/usr/bin/env sh
dk build -t tmp --no-cache --progress=plain .