Skip to content

Instantly share code, notes, and snippets.

View inceax's full-sized avatar

Jangho Lee inceax

View GitHub Profile
// normalized(0-1) 단위
// { average: 0.06, cpus: [ 0.06, 0.05, 0.05, 0.08 ] }
// warning: 부팅 이후의 값이므로, 실시간 측정은 불가능
const cpustat = function () {
const cpus = os.cpus();
const result = {};
result.average = 0;
result.cpus = [];
for (let i = 0; i < cpus.length; i++) {
@inceax
inceax / co-example-a.js
Last active March 9, 2016 14:08
node.js co example
co(function* () {
var a = yield new Promise(function(resolve, reject) {
setTimeout(() => resolve("ok"), 100);
});
console.log("result: " + a);
var b = yield new Promise(function(resolve, reject) {
setTimeout(() => reject("fail"), 100);
});
console.log("result: " + b);
}).catch(function(e) {
@font-face {
font-family: "굴림";
src: local("Noto Sans CJK KR DemiLight");
}
@font-face {
font-family: "돋움";
src: local("Noto Sans CJK KR DemiLight");
}
* {
font-family: "Noto Sans CJK KR DemiLight";
}
@inceax
inceax / Singleton.cs
Created November 26, 2015 13:29
Simple Singleton Template for C#
// Singleton
//
// declaration:
// public class A
// {
// public static A Instance { get { return Singleton<A>.Instance; } }
// public void foo(){}
// }
//
// usage:
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
@inceax
inceax / client.sublime-project
Created August 20, 2015 04:19
client.sublime-project
{
"folders":
[
{
"follow_symlinks": true,
"path": ".",
"folder_exclude_patterns": ["Temp", "Extensions", "Plugins", "JsonDotNet", "ProjectSettings"],
"file_exclude_patterns": ["*.meta", "*.prefab", "*.mat", "*.asset"]
}
],
@inceax
inceax / mpv.config
Last active August 29, 2015 14:23
mpv.config on osx
# ~/.config/mpv/mpv.config
# 폰트
sub-text-font="Apple SD Gothic Neo:style=Bold"
# 한글 출력
sub-codepage="cp949"
# reference
http://mpv.io/manual/master/
@inceax
inceax / vscode-setting.md
Last active August 29, 2015 14:20
Visual Studio Code 세팅

Visual Studio Code 세팅

Mac OSX에서 Unity를 위한 세팅

Homebrew 설치

http://brew.sh

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@inceax
inceax / vsftpd-adduser.md
Last active August 29, 2015 14:19
vsftpd 전용 계정 추가

vsftpd 전용 계정 추가

  • Virtual User를 사용하지 않고, 계정 추가를 이용한 vsftpd 전용 계정 설정
  • 특정 디렉토리만 접근 가능, ssh 로그인 차단

Shell 사용하지 않는 media 이름의 계정 추가

adduser -s /bin/nologin media

해당 유저 ssh 로그인 차단. /etc/ssh/sshd_config