Skip to content

Instantly share code, notes, and snippets.

View rkJun's full-sized avatar

Juntai Park rkJun

View GitHub Profile
@rkJun
rkJun / ri20min.rb
Created July 16, 2014 09:39
my first ruby code form studying ruby 20 minutes
#! /usr/bin/env ruby
class MegaGreeter
attr_accessor :names
# Create the object
def initialize(names = "World")
@names = names
end
@rkJun
rkJun / .zshrc
Last active August 29, 2015 14:21
my ubuntu dot files
alias h='history'
alias dl='docker ps -l -q'
# Invoke GnuPG-Agent the first time we login.
# Does `~/.gpg-agent-info' exist and points to gpg-agent process accepting signals?
if test -f $HOME/.gpg-agent-info && \
kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info | cut -c 16-`
else
# No, gpg-agent not available; start gpg-agent
{
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) {
@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)
유료 프로그램을 사용하거나 (Paragon NTFS 같은),
무료 ntfs 3g (osx fuse & ntfs 3g) 를 사용하는 방법도 있고,
패러럴즈를 통해 가상 윈도7 에서 사용하는 방법도 있다.
여러가지를 다 사용해 봤지만, 아래 방법이 개인적으로는 가장 안정적인 느낌이다.
sudo vi /etc/fstab
LABEL=NAME none ntfs rw,auto,nobrowse
@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

...

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 / 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
@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' \