Skip to content

Instantly share code, notes, and snippets.

@redutan
redutan / gc-downtime.sh
Last active Mar 12, 2019
Base Shell 모들
View gc-downtime.sh
# 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]
View InterfaceProduct.java
interface ProductDesc {
String getTitle();
long getPrice();
String getContent();
boolean isDiscountable();
}
@Entity
@Getter
@EqualsAndHashCode
@redutan
redutan / requirements.txt
Last active Sep 21, 2017
top_instagram_hashtags_crawler
View requirements.txt
requests==2.18.4
BeautifulSoup4==4.6.0
lxml==3.8.0
View backgroundh.sh
nohup ./gradlew run > /dev/null 2>&1 &
View NotThreadSafeTest.java
@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 Nov 23, 2017
mac bin
View blog
#!/bin/bash
cd ~/blog/redutan.github.io
bundle exec jekyll serve -D
@redutan
redutan / port80.sh
Created Jan 25, 2017
macOS(since sierra) 에서 8080 -> 80 으로 포트포워딩
View port80.sh
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 Jul 27, 2016
accesshist.py
View 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 Jul 21, 2016
Resize all images in a folder based on the width
View resizeimgs.py
#!/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: