대학생때 만들었던 사진 객체로 스티커 (?) 만들기
·
devlog/etc
하드드라이브 정리하다가 발굴해낸 프로젝트. 여담을 하자면 이 프로젝트는 팀플젝이었는데, 4명중 2명이 중국으로 귀국(이라쓰고 도망)가버려서 나머지 2명이 울면서 개발한 프로젝트이다..빤쓰런을 하려면 저 정도 스케일은 되어야 인정을 받을 수 있을 것. 지금은 내용도 다 까먹고, MATLAB도 까먹고, 남은건 코드와 자료들 뿐이지만, 나름 재밌었다. Computational Photography 수업이었음. 문제의? 프로젝트 코드: https://github.com/yayyz/emojify-objects yayyz/emojify-objects Contribute to yayyz/emojify-objects development by creating an account on GitHub. github.com
[프로그래머스] 다리를 지나는 트럭 - 스택/큐
·
BE/algorithm
문제링크 https://programmers.co.kr/learn/courses/30/lessons/42583 코딩테스트 연습 - 다리를 지나는 트럭 트럭 여러 대가 강을 가로지르는 일차선 다리를 정해진 순으로 건너려 합니다. 모든 트럭이 다리를 건너려면 최소 몇 초가 걸리는지 알아내야 합니다. 다리에는 트럭이 최대 bridge_length대 올라갈 programmers.co.kr 문제풀이 import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue; class Solution { public int solution(int bridge_length, int weight, int[] ..
[프로그래머스] K번째수 - 정렬
·
BE/algorithm
문제링크 https://programmers.co.kr/learn/courses/30/lessons/42748 코딩테스트 연습 - K번째수 [1, 5, 2, 6, 3, 7, 4] [[2, 5, 3], [4, 4, 1], [1, 7, 3]] [5, 6, 3] programmers.co.kr 문제풀이 import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * K번째수 * https://programmers.co.kr/learn/courses/30/lessons/42748 */ public class Solution { public int[] solution(int[] array, int[][] commands) { Lis..
[프로그래머스] 완주하지 못한 선수 - 해시
·
BE/algorithm
문제 링크 https://programmers.co.kr/learn/courses/30/lessons/42576 문제 풀이 import java.util.HashMap; import java.util.Map; /** * 완주하지 못한 선수 * https://programmers.co.kr/learn/courses/30/lessons/42576 */ class Solution1 { public String solution(String[] participant, String[] completion) { Map map = new HashMap(); // convert array to hashmap for completion for (String person : participant) { if (map.cont..
[프로그래머스] 모의고사 - 완전탐색
·
BE/algorithm
문제 링크 https://programmers.co.kr/learn/courses/30/lessons/42840 코딩테스트 연습 - 모의고사 수포자는 수학을 포기한 사람의 준말입니다. 수포자 삼인방은 모의고사에 수학 문제를 전부 찍으려 합니다. 수포자는 1번 문제부터 마지막 문제까지 다음과 같이 찍습니다. 1번 수포자가 찍는 programmers.co.kr 문제 풀이 import java.util.ArrayList; import java.util.List; /** * 프로그래머스:완전탐색:모의고사 * https://programmers.co.kr/learn/courses/30/lessons/42840 */ class Solution { public int[] solution(int[] answers) {..
[대충로그] grafana-loki query
·
DevOps/monitoring
loki로 수집된 로그중에 json body (string)에서 값을 쿼리해야한다. loki로 수집된 로그중에 json body (string)에서 값을 쿼리해야한다. {container_name="도커컨테이너명"} |= " orderNo" |= "123123123" { } 안의 값은 label |= 는 로그 파이프라인, 필터처럼 사용
[ubuntu] python을 찾을 수 없다고 할때
·
DevOps/devops
Command 'python' not found, but can be installed with: 라고 뜨는 경우가 있다. 하지만 python은 설치 되어있는데? 🤔고민하지 말고 아래와 같이 입력해주자. # 터미널 (bashrc or bash_aliases) vim ~/.bashrc # bashrc (python3나 원하는 python 버전) alias python=python3 # 터미널 source ~/.bashrc 다시 python을 입력하면, 원하는 버전에 맞게 잘 실행되는것을 확인할 수 있다.
[TIL] pip install 시 "Consider using the `--user` option or check the permissions" 에러
·
DevOps/etc
Consider using the `--user` option or check the permissions. pip로 패키지 설치시 이런 에러가 발생함. 권한이 없는 디렉토리에서 설치하려고 하기 때문에 발생하는 에러. --user 옵션을 넣어서 설치하면 된다. 뭐든 모를땐 man page 나 -h를 사용해서 설명을 읽어본다. --user 옵션은 권한없는 디렉토리 (내경우의 C드라이브)가 아닌 사용자의 디렉토리 (home directory)에 설치해준다. --user Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python do..
crontab 을 사용해보자
·
DevOps/etc
서버에서 주기적으로 작업을 해야하는 일을 생성할때는 종종 crontab을 사용한다. cron으로 등록된 job list 확인 crontab -l cron에 새로운 job을 등록 crontab -e cron 스케줄 expression 주기적으로 cron을 실행시키기 위해서는 다음의 expression과 함께 등록해야한다. [분] [시간] [날짜/월] [월] [날짜/주] wildcard sign = any 예시 아래와 같이 세팅하면 매주 0시 0분 (자정) 목요일에 해당 file path에 있는 스크립트를 실행 으로 해석하면 된다. 0 0 * * THU [file path] 참고 cron schedule 유용한 링크: https://crontab.guru/
[curl] (60) SSL certificate problem: certificate has expired
·
DevOps/etc
curl command 를 사용하다가 만난 이슈 해결방법 (임시방편) curl의 옵션인 -k (or --insecure)를 사용한다. certificate validation을 스킵해준다.
[vim] 좀 더 편-안하게 vim editor를 사용하는 설정
·
devlog/TIL
포매팅: shift, tab 4!!!!!!! 8이면 막 마음이 무너져 버려 set smartindent set tabstop=4 set expandtab set shiftwidth=4 지금당장 라인끝으로 커서를 이동하고 싶다 $ (shift + 4) 지금당장 파일의 제일 아래로 가고싶다 shift + g 지금당장 파일의 헤드로 가고싶다 shift + h
fluentd - host is unreachable
·
DevOps/monitoring
2020-10-05 16:19:32 +0000 [warn]: #0 failed to flush the buffer. retry_time=15 next_retry_seconds=2020-10-05 21:09:56 +0000 chunk="5b0e6e3d58b7cec7f1d92eaa332995c8" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"호스트명\", :port=>포트번호, :scheme=>\"http\"}): Host is unreachable - connect(2) for IP주소 (Errno::EHO..
[TIL] fluentd & NGINX
·
devlog/TIL
다 설정하고 나니까 이런 에러가 로그에 남아있다 \[types removal\] Specifying types in bulk requests is deprecated. 이것은 대체 무슨 로그? https://www.elastic.co/guide/en/elasticsearch/reference/master/removal-of-types.html#_why_are_mapping_types_being_removed 엘라스틱 서치 버전8부터는 mapping type이 없어진다고 한다. 아마 엘라스틱서치 어딘가에서 mapping type을 계속 쓰고있어서 그런것 같다. 아니면 내 fluentd 설정인가? 이런 저런 이유라는데...어 읽어도 잘 모르겠다 지금은: https://www.elastic.co/guide/e..
뚝딱거리는 초보 devops의 TIL
·
devlog/TIL
max_map_count가 뭔가 https://stackoverflow.com/questions/11683850/how-much-memory-could-vm-use 이것이다. linux kernel Sonarqube의 스펙은 잘 맞춰야 한다 그렇지 않으면 이런 에러가 나기때문이다. 2020.08.28 02:28:49 ERROR es[][o.e.b.Bootstrap] node validation exception [1] bootstrap checks failed [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144] ERROR: [1] bootstrap checks failed docker..
유용한 linux command 모음 (사실 나를 위한 포스트 | 계속 추가 중)
·
devlog/TIL
서버 timezone 변경 (한국시간) cp -p /usr/share/zoneinfo/Asia/Seoul /etc/localtime 서버 kernel version 확인 uname -v