Skip to content

Instantly share code, notes, and snippets.

View cinsk's full-sized avatar

Seong-Kook Shin cinsk

View GitHub Profile
@cinsk
cinsk / keybase.md
Last active February 21, 2019 23:15
keybase identity proof

Keybase proof

I hereby claim:

  • I am cinsk on github.
  • I am cinsk (https://keybase.io/cinsk) on keybase.
  • I have a public key whose fingerprint is 8B44 C9AA 2A3B E9E8 3A13 97B7 6A2B 450D 5B52 C175

To claim this, I am signing this object:

@cinsk
cinsk / Emacs.app.sh
Created February 22, 2018 00:43
How to create Dock Emacs/Aquamacs Icon reading bash init scripts and more
# See https://www.emacswiki.org/emacs/EmacsForMacOS
#
# Create an app that runs a shell script that runs Emacs.app, like this:
# 1. use Finder to navigate to /Applications and double-click Automator.app.
# 2. Select the document type “Application” and click “Choose”.
# 3. In the list on the left, select “Library”.
# 4. In the next list, find “Run Shell Script” and drag it into the workflow area on the right.
# 5. In the new shell script, delete the text and replace it with:
EMACS=/Applications/Aquamacs.app/Contents/MacOS/Aquamacs
@cinsk
cinsk / java-flamegraph.sh
Created January 25, 2018 00:52
Generate flame graphs of JVM, JAVA
#!/bin/bash
# SJK tool need to run as the same user of the target process.
USER=
PID=
INTERVAL=10ms
PROGRAM_NAME=$(basename $0)
error() {
@cinsk
cinsk / diffjson
Created August 28, 2016 22:33
diffjson: compare JSON documents for the differences
#!/bin/bash
CONV_JSON=/tmp/convjson.$$
SRC1=/tmp/diffjson.1.$$.json
SRC2=/tmp/diffjson.2.$$.json
SRC3=/tmp/diffjson.3.$$.json
PROGRAM_NAME=$(basename $0)
VERSION_STRING="0.1"
PYTHON=
@cinsk
cinsk / private.xml
Created February 27, 2016 10:01
Karabiner Setting (For UK mac keyboard, IntelliJ settings..)
<?xml version="1.0"?>
<root>
<appdef>
<appname>IntelliJ IDEA</appname>
<equal>com.parallels.desktop.console</equal>
<equal>com.jetbrains.intellij.ce</equal>
</appdef>
<deviceproductdef>
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD_0x0273</productname>
@cinsk
cinsk / check-nfs.sh
Last active January 20, 2023 22:27
Check if NFS mounted directory is stale
#!/bin/bash
PATH=/bin:/usr/bin:/usr/local/bin
check-nfs () {
local TMPFILE=/tmp/checknfs.$$ RET=0 ORPHAN SUBSHELLPID
if [ "$#" -eq 0 ]; then
cat<<EOF
usage: check-nfs NFS-DIRECTORY...
@cinsk
cinsk / chkprocs.rb
Last active August 29, 2015 14:02
Check the status of the processes (# of processes, # of fds, memory usage, etc.) in Nagios format
#!/usr/bin/env ruby
require 'timeout'
require 'getoptlong'
RLIMIT_MAP = {
"Max cpu time" => Process::RLIMIT_CPU,
"Max file size" => Process::RLIMIT_FSIZE,
"Max data size" => Process::RLIMIT_DATA,
"Max stack size" => Process::RLIMIT_STACK,
@cinsk
cinsk / reboot-abnormal
Last active August 29, 2015 13:56
force soft reboot Scalr-managed server if abnormal reboot detected
#!/bin/bash
#
# reboot-abnormal Force soft-reboot when Scalr event was not received
#
# chkconfig: 2345 80 10
# description: Force soft reboot when Scalr event was not received
#
# pidfile: /var/run/reboot-abnormal.pid
. /etc/rc.d/init.d/functions
@cinsk
cinsk / programming-in-scala.rb
Created November 1, 2013 11:43
Generate E-book friendly html files from http://www.artima.com/pins1ed/ See the comment in the source.
#!/usr/bin/env ruby
require 'rubygems'
require 'fileutils'
#
# Generate HTMLs for e-book from HTML files of "Programming in Scala".
#
# Usage:
@cinsk
cinsk / pom.xml
Created October 24, 2013 06:19
Maven project to embed GIT commit information into the output (.jar or .war) file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<dependencies>
<dependency>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.5</version>
</dependency>