Skip to content

Instantly share code, notes, and snippets.

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 / gist:0d569a1f4d766d364704
Created November 10, 2015 06:37
Ruby에서 의존하는 Gem 안에 puts를 찍는 법?
WIP
# Gemfile안에 gem 'activerecord'를 gem 'activerecord', path: 'somewhere' 로 바꾼다.
# ruby를 실행할 때 -I 옵션을 잘 준다?
# bundle open activerecord로 직접 고치고, 끝나고 나면 bundle exec gem pristine activerecord로 원복해둔다.
@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 / storm-quick-ref.md
Last active November 27, 2015 08:51
storm-quick-ref.md

가끔 기억안날 때 보는 우리 환경 Storm의 Ref

chef-repo에 site-cookbooks가 들어 있다.

HelloWorld 같은 단순 Topology

Spout하나 Bolt 하나를 돌린다. 로컬에서 돌리기 위해 LocalCluster instance를 만들어 돌릴 때도 있고 데스크탑위에 docker에서 돌리는 원격에서 돌리기 위해 StormSubmitter를 쓸 때도 있다.

clj-time 사용법

(require '[clj-time.core :as t])
(require '[clj-time.format :as f])

현재시간 구하기

import java.sql.*;
public class ConnectionAlone {
@SuppressWarnings("unused")
public static void main(String[] args) throws SQLException {
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e) {
}