Skip to content

Instantly share code, notes, and snippets.

@ruseel
ruseel / gist:13b0741c42dc6a5093e7
Created September 22, 2014 05:16
set vim in Cloudera VM
sudo update-alternatives --config vim
git config --global core.editor "vim"
namespace :sidekiq do
def assert_process_running(pid)
begin
if pid == Process.waitpid(pid, Process::WNOHANG) then
raise "process killed"
end
end
puts "alive"
end
I18n.t 'datetime.distance_in_words.x_days', count: date_range
@ruseel
ruseel / gen.pl
Last active August 29, 2015 14:17
urlsafe_base64가 ruby와 perl간에 호환이 되는 걸까? 둘다 +/를 -_ 로 바꾸는 것으로..
use 5.010;
use UUID::Tiny;
use MIME::Base64::URLSafe;
foreach(1..1000000) {
$v=create_UUID(UUID_V1);
say $v.urlsafe_b64encode($v);
}
@ruseel
ruseel / gist:31b8483d4f73e8bff1f8
Created June 9, 2015 10:35
PropertyPlaceholderConfigurer
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound" value="true" />
<property name="searchSystemEnvironment" value="true" />
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
</bean>
#!/bin/bash
# chkconfig: 2345 95 20
# description: This application was developed by me and is tested on this server
# processname: my_app
#
# Tomcat 8 start/stop/status init.d script
# Initially forked from: https://gist.github.com/valotas/1000094
# @author: Miglen Evlogiev <bash@miglen.com>
#
# Release updates:
@ruseel
ruseel / multiple_command_to_multiple_ssh_host.md
Last active September 30, 2015 11:51
여러 서버에 같은 명령을 내리는 방법
@ruseel
ruseel / grinder.md
Last active November 12, 2015 10:15

Grinder Tutorial

Grinder는 Console, Agent로 나뉜다. 하나의 Agent안에 여러 Worker가 돌 수 있다.

grinder.org에서 zip파일을 다운로드 받고, 풀고, 실행한다. Project구조를 다양하게 잡을 수 있다.

이 글을 따라하면 간단한 HTTP 부하테스트를 시작할 수 있다.

Grindre의 Project 구조 잡기

@ruseel
ruseel / aws-docker-high-tracffic-kernel.md
Last active May 24, 2024 14:18
AWS에서 docker를 쓸 때 high traffic server라면 이렇게

AWS에서 docker를 쓸 때 high traffic server라면 이렇게 하는 것이 좋겠다. amazon linux를 쓴다고 하자.

ulimit

ulimit를 올려주어야 한다. /etc/security/limit.conf 에서 고쳐주어도 docker에는 적용되지 않는다. limit.conf는 PAM을 통해서 로그인했을 때만 먹는 설정이라 그렇다. docker로 띄운 process의 pid를 찾고 cat /proc/<pid>/limits를 실행해서 보면 적용되었는지 아닌지 확실하게 알 수 있다. kernel에서 직접 그 프로세스에 어떤 ulimit이 적용되었는지 확인하는 방법이다.

그래서 /etc/sysconfig/docker 파일을 만들고 아래를 추가한다.

@ruseel
ruseel / clojure-jdbc.md
Last active May 4, 2016 02:36
clojure에서 jdbc tutorial

WIP

embed H2를 사용해서 써보자.

Setup

lein new app clj-jdbc-tutorial