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 |
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<>(); |
View blog
#!/bin/bash | |
cd ~/blog/redutan.github.io | |
bundle exec jekyll serve -D |
View port80.sh
echo " | |
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080 | |
" | sudo pfctl -ef - |
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' |
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: |