Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View redutan's full-sized avatar

Jordan(정명주) redutan

View GitHub Profile
@redutan
redutan / gc-downtime.sh
Last active March 12, 2019 02:54
Base Shell 모들
# GC downtime sum
$ cat gc.log | grep secs | awk '{sum+=$(NF-1)} END{print sum}'
# gc.log
2019-03-07T11:31:54.324+0900: 54686.842: [GC pause (G1 Humongous Allocation) (young) (initial-mark) 1022M->934M(2048M), 0.0423201 secs]
2019-03-07T11:31:54.366+0900: 54686.884: [GC concurrent-root-region-scan-start]
2019-03-07T11:31:54.403+0900: 54686.921: [GC concurrent-root-region-scan-end, 0.0368224 secs]
2019-03-07T11:31:54.403+0900: 54686.921: [GC concurrent-mark-start]
@redutan
redutan / InterfaceProduct.java
Last active June 7, 2018 07:12
Entity Arguments
interface ProductDesc {
String getTitle();
long getPrice();
String getContent();
boolean isDiscountable();
}
@Entity
@Getter
@EqualsAndHashCode
@redutan
redutan / requirements.txt
Last active September 21, 2017 07:54
top_instagram_hashtags_crawler
requests==2.18.4
BeautifulSoup4==4.6.0
lxml==3.8.0
@redutan
redutan / backgroundh.sh
Created July 25, 2017 01:57
linux background
nohup ./gradlew run > /dev/null 2>&1 &
@redutan
redutan / NotThreadSafeTest.java
Last active March 9, 2017 08:55
NotThreadSafeTest
@Slf4j
public class NotThreadSafeTest {
Map<Integer, Integer> resourceMap;
Map<String, Integer> resourceMap2;
@Test
public void testNotThreadSafe_HashMapPut() throws Exception {
// given
final int size = 1_000_000;
resourceMap = new HashMap<>();
@redutan
redutan / blog
Last active November 23, 2017 02:06
mac bin
#!/bin/bash
cd ~/blog/redutan.github.io
bundle exec jekyll serve -D
@redutan
redutan / port80.sh
Created January 25, 2017 01:11
macOS(since sierra) 에서 8080 -> 80 으로 포트포워딩
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
" | sudo pfctl -ef -
@redutan
redutan / accesshist.py
Last active July 27, 2016 05:17
accesshist.py
from openpyxl import load_workbook
import cx_Oracle
ROWID_NO = 0
ROWID_LAST_ACCESS = 1
DB_USER = 'user'
DB_PASSWD = 'password'
DB_URL = '1.1.1.1:1111'
DB_SID = 'SID'
@redutan
redutan / resizeimgs.py
Last active July 21, 2016 05:04
Resize all images in a folder based on the width
#!/usr/bin/python
# usage python resizeimgs.py PATH WIDTH
import sys
from os import listdir, path
from PIL import Image
def getpath():
try:
inpath = sys.argv[1]
except: