본문 바로가기

전체 글378

Mariadb log 활성화 # MariaDB Log 종류 # # Error_log : # query 에러에 관련된 메세지를 포함 # General_log : # 실행되는 전체 쿼리에 대해 저장 # 쿼리 요청 받을때 바로 저장함. # Slow query_log : # long_query_time에 설정된 시간 이상을 소요한 정상적으로 완료된 쿼리를 모두 기록 # 에러가 발생한 로그에 대해서는 기록하지 않는다. # Binary log : # Relay log :# 로그 활성화 상태 보기 show variables where variable_name in ('version','log','general_log');# GENERAL log 활성화 SET GLOBAL GENERAL_LOG = ON; // 비활성화 할 경우 OFF SET GL.. 2017. 5. 31.
DB size query SELECT table_name , round(((data_length + index_length) /1024/1024/1024), 2) `Size(GB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA='데이터베이스 명' ORDER BY (data_length + index_length) DESC; MB 로 표시할경우 : 1024/1024 2017. 5. 30.
scapy install on mac $pip3 install scapy-python3 $pip3 install scapy usage:$scapy ref:https://phaethon.github.io/scapy/api/installation.html http://www.secdev.org/projects/scapy/doc/usage.html#starting-scapy 2017. 5. 28.
jupyter install on mac python3 을 사용하도록 한다. 1. pip 업데이트 $pip3 install --upgrade pip 2. jupyter 설치 $pip3 install jupyter 3. jupyter 시작 3.1 기본으로 시작$jupyter notebook -> 접속 : localhost:8888 3.2 포트 변경하여 시작 $jupyter notebook --port 9999-> 접속 : localhost:9999 3.3 브라우저 없이 실행 $jupyter notebook --no-browser 2017. 5. 28.
Java - 순열 ( Permutation ) public static void main(String[] args) { System.out.println(getPermutations("324")); } /** * * 순열 구하기 */ public static List getPermutations(String s){ if(s==null) return null; //boolean 은 누구를 선택 했는지 판별 파라미터 return permuRec(s,new boolean[s.length()],"",new ArrayList()); } private static List permuRec(String s, boolean[] pick,String perm,ArrayList result){ //종료 조건 if(perm.length() == s.length()){ .. 2017. 5. 28.
Java - N 비트 경우의 수 출력 public static void main(String[] args) { System.out.println(bitcomb(10)); } public static ArrayList bitcomb(int n){ return bitCombRec(n,"",new ArrayList()); } private static ArrayList bitCombRec(int n,String s,ArrayList list){ //s 가 n 비트이면 종료조건 if(n==s.length()) { list.add(s); return list; } bitCombRec(n,s+"0",list); bitCombRec(n,s+"1",list); return list; } 2017. 5. 28.