Skip to content

Instantly share code, notes, and snippets.

View rkJun's full-sized avatar

Juntai Park rkJun

View GitHub Profile
@rkJun
rkJun / esm-package.md
Created July 12, 2021 16:35 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@rkJun
rkJun / I'm a night 🦉
Last active September 7, 2021 01:00
I'm an early
🌞 Morning 26 commits ███▍░░░░░░░░░░░░░░░░░ 16.1%
🌆 Daytime 51 commits ██████▋░░░░░░░░░░░░░░ 31.7%
🌃 Evening 35 commits ████▌░░░░░░░░░░░░░░░░ 21.7%
🌙 Night 49 commits ██████▍░░░░░░░░░░░░░░ 30.4%
@rkJun
rkJun / healthchecker.sh
Last active July 16, 2018 02:53
Server Health Checker (Memory, Disk, CPU) and send to slack
#!/bin/bash
freeText=$(free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')
diskText=$(df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}')
cpuText=$(top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}')
resultText=$(echo 'ServerName ('${HOSTNAME}')' ${cpuText} ${freeText} ${diskText})
#echo $resultText
#ServerName (precise64) CPU Load: 0.00 Memory Usage: 315/363MB (86.78%) Disk Usage: 1/78GB (3%)
curl 'https://hooks.slack.com/services/...blah...blah..webhook.url' \
-X POST -H 'Content-type: application/json' \
@rkJun
rkJun / healthchecker.sh
Created July 16, 2018 02:50
Server Health Checker (Memory, Disk, CPU) and send to slack
#!/bin/bash
freeText=$(free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }')
diskText=$(df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}')
cpuText=$(top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}')
resultText=$(echo 'ServerName ('${HOSTNAME}')' ${cpuText} ${freeText} ${diskText})
echo $resultText
curl 'https://hooks.slack.com/services/...blah...blah..webhook.url' \
-X POST -H 'Content-type: application/json' \
--data @<(cat <<EOF

Keybase proof

I hereby claim:

  • I am rkjun on github.
  • I am rkjun (https://keybase.io/rkjun) on keybase.
  • I have a public key ASBJxuWFW5SrGCoahXKZkpz1UBZgy6q7_bBu1MedatA3mgo

To claim this, I am signing this object:

@rkJun
rkJun / install_docker_on_macOS.md
Last active June 30, 2017 01:21
Install Docker on MacOS

Install Docker on MacOS

  1. Install Virtual Box

  2. Install docker

$ brew install docker

...

유료 프로그램을 사용하거나 (Paragon NTFS 같은),
무료 ntfs 3g (osx fuse & ntfs 3g) 를 사용하는 방법도 있고,
패러럴즈를 통해 가상 윈도7 에서 사용하는 방법도 있다.
여러가지를 다 사용해 봤지만, 아래 방법이 개인적으로는 가장 안정적인 느낌이다.
sudo vi /etc/fstab
LABEL=NAME none ntfs rw,auto,nobrowse
@rkJun
rkJun / slack-svn.sh
Last active October 30, 2023 18:36
Subversion integration with Slack
#!/bin/bash
#
# Bash script for Subversion integration with Slack
#
# 1. Save this file in /usr/bin as slack-svn
# 2. Make it executable:
# chmod +x /usr/bin/slack-svn
# 3. Put this line at the end of file of your_svn_repo/hooks/post-commit:
# slack-svn $REPOS $REV full_path_to_svn_directory
# 4. Edit this file, especially from line 16-20 and 27 (example given is for Redmine)
{
init: function(elevators, floors) {
var elevator_zero = elevators[0];
var elevator_active = elevators[0];
var idle_elevators = [];
var idle_elevator = {};
var getIdleElevator = function(floorNum, direction) {
if (idle_elevators.length > 0) {