Skip to content

Instantly share code, notes, and snippets.

View MinCha's full-sized avatar

Min Cha MinCha

  • GGtics
  • Gwanggyo
View GitHub Profile
@MinCha
MinCha / gist:3416246
Created August 21, 2012 14:57
Favorite Java GC Options
-server
-XX:-UseAdaptiveSizePolicy
-XX:ParallelGCThreads=2
-XX:+UseParNewGC
-XX:NewRatio=3
-XX:+PrintGCDetails -XX:+PrintHeapAtGC
-XX:+HeapDumpOnOutOfMemoryError
@MinCha
MinCha / gist:3416270
Created August 21, 2012 14:59
Extract pattern from file
#!/usr/bin/perl
##############################################################################
# $fileName : a filename to analyze
# $pattern : regexp pattern
# $patternIndex : a group index to extract(0..n)
# (OPT)$count : count will be printed if value is 1
##############################################################################
if (@ARGV < 2) {
print("usage : $0 (M)FILE_NAME (M)PATTERN\n");
@MinCha
MinCha / gist:3416284
Created August 21, 2012 15:02
Powerful PS with time per thread
ps -fL -p PID
@MinCha
MinCha / gist:3423806
Created August 22, 2012 08:42
Join NHN
@Test
public void youShouldJoinNHN() {
You you = new You();
you.joinNHN();
assertTrue(you.areOnLiveInteraction());
assertTrue(you.areWorkingWithTopPeople());
assertTrue(you.dealWithBigData());
}
@MinCha
MinCha / gist:3850876
Created October 8, 2012 05:34
Extracting error-count contained specified string from Nelo log
#!/bin/python
import csv
import sys
import operator
filepath = sys.argv[1]
patterns = sys.argv[2].split(";")
matched_count = 0
total_count = 0
@MinCha
MinCha / gist:3903802
Created October 17, 2012 05:09
One Line Apache RPS Monitoring
while true; do curl localhost/server-status?auto | grep ReqPerSec; sleep 2; done
@MinCha
MinCha / gist:3918064
Created October 19, 2012 12:43
Apache Conf For Apache First Tomcat Late
<VirtualHost *:80>
DocumentRoot /home1/www/data
ServerName some.com
SetEnvIf Request_URI "/staged/linecamera" no-jk
Alias /staged/camera "/home1/www/data/camera-admin"
<Location /staged/camera>
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
@MinCha
MinCha / gist:4064085
Created November 13, 2012 05:25
Netstat Detecting Connection Problem
while true; do netstat -nto | grep 69.171;sleep 3;echo "next"; done
@MinCha
MinCha / gist:4129927
Created November 22, 2012 08:07
MySQL Batch Performance Option
rewriteBatchedStatements=true
@MinCha
MinCha / gist:4134382
Created November 23, 2012 07:32
Simple JDBC Batch
package jp.naver.my;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;