├── README.md ├── linux ├── .vimrc ├── github.md ├── gpu.md ├── server.md ├── util.md └── vim.md └── web └── flask.md /README.md: -------------------------------------------------------------------------------- 1 | # Misc Cheatsheet 2 | 3 | 이 레포는 다음과 같은 내용을 포함하고 있습니다. 4 | 5 | - 개발과 연구 경험을 배풀고자 만든 레포 6 | - 주니어분들에게 추천하고 싶은 자료들 7 | - 터미널을 사랑하는 사용자들에게 8 | 9 | ## Linux 10 | 11 | ### [Server](linux/server.md) 12 | 13 | - 서버 간 파일 전송하기 (`scp`) 14 | - 외부 localhost 접속하기 (`ngrok`) 15 | - 서버 password 변경하기 (`passwd`) 16 | - remote server의 port를 localhost에서 사용하기(`ssh -L` or `ssh -R`) 17 | - 서버의 GUI를 로컬에서 사용하기 (`ssh -X` or `ssh -Y`) 18 | - 서버 ssh-key로 password없이 접속하기 (`ssh-keygen`) 19 | - ssh config 파일 설정으로 간단하게 접속하기 (`~./ssh/config`) 20 | 21 | ### [GPU](linux/gpu.md) 22 | 23 | - 사용 GPU 지정 Python (`CUDA_VISIBLE_DEVICES`) 24 | - CUDA 버전 확인하기 (`nvcc`) 25 | - GPU 사용량 확인하기 (`nvidia-smi`) 26 | - GPU 사용량 확인하기 2 (`nvtop`) 27 | - GPU 사용량 확인하기 3 (`nvitop`) 28 | 29 | ### [Util](linux/util.md) 30 | 31 | - 노트북을 덮거나 시간이 지나도 꺼지지 않게 (`caffeinate`) 32 | - 파일 개수를 알고 싶다면? (`ls -l | grep ^- | wc -l`) 33 | - 디스크의 남은 용량을 알고 싶다면 (`df -h`) 34 | - Syntax Highlight와 함께 cat을 쓰고 싶다면 (`bat`) 35 | - iterm에서 new tab을 만들 때 directory를 유지하고 싶다면? 36 | - 심볼릭 링크 사용하여 바로가기 만들기(`ln -s`) 37 | - pip로 설치 시, 필요없는 output을 보지 않으려면? (`pip install`의 `-q`, `-qq`, `-qqq`) 38 | - tmux에서 마우스 사용하기(`set -g mouse on`) 39 | - json 파일 이쁘게 보기 (`jq`) 40 | - 폰트 추천 (`D2 Coding`) 41 | 42 | ### Advanced Utils 43 | 44 | - [fig](https://github.com/withfig/autocomplete) : 터미널 내부 고급 자동 완성. 미쳐버린 퀄리티... 45 | - [say](https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/SpeechSynthesisProgrammingGuide/FineTuning/FineTuning.html) : MacOS 전용 TTS 커맨드 46 | 47 | ### [Vim](linux/vim.md) 48 | 49 | - **[vimrc 통합본](linux/.vimrc)** 50 | - (vimrc) 문서 형식 파악 및 문법 하이라이트(`syntax on`, `filetype indent plugin on`) 51 | - (vimrc) 검색, 괄호 등 정보 하이라이트(`hlsearch`, `ruler`, `showmatch`) 52 | - (vimrc) Python 문서 작성에 편리한 모드(종류별 tab 사이즈, `autoindent`) 53 | - (vimrc) 라인 번호 표기(`nu` or `number`) 54 | - (vimrc) 모드별 커서 모양 변경 55 | - vim에서 여러 줄 주석 처리 (`norm i#`, `norm 1x`) 56 | - vim에서 sudo로 저장하기 (`w sudo! tee %`) 57 | 58 | ### [Git/Github](/linux/github.md) 59 | 60 | - Github Profile Badge List : 깃헙을 다양하게 꾸며봅시다. 61 | - 브랜치를 만들면서 바로 체크아웃하려면 (`git checkout -b`) 62 | - 커밋 날짜 바꾸기 (`git commit --amend --no-edit --date`) 63 | - 한글 에러 방지(`core.precomposeunicodem`, `core.quotepath`) 64 | 65 | ## Data Science 66 | 67 | ### Computer Vision 68 | 69 | - [albumtations](https://github.com/albumentations-team/albumentations) : Image data augmentation library 70 | - [ttach](https://github.com/qubvel/ttach) : Image Test Time Augmentation with PyTorch 71 | - [timm](https://github.com/rwightman/pytorch-image-models) : Pytorch pre-trained SOTA image models 72 | - [smp](https://github.com/qubvel/segmentation_models.pytorch) : Pytorch pre-trained SOTA image segmentation models 73 | 74 | ### Prototype 75 | 76 | - [Streamlit](https://github.com/streamlit/streamlit) : ML Model을 Web-based GUI로 쉽게 보여주는 오픈소스 77 | - [Gradio](https://github.com/gradio-app/gradio) : ML Model을 Web-based GUI로 쉽게 보여주는 오픈소스 78 | 79 | ### Tools 80 | 81 | - [Jupyter Lab](https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html) : Jupyter Notebook 상위 호환 82 | - [Weights & Biases](https://wandb.ai/) : tensorboard보다 편리한 웹 대시보드 83 | 84 | ### ETC 85 | 86 | - [watermark](https://github.com/rasbt/watermark) : Jupyter에서 라이브러리 버전 명시 익스텐션 87 | - [holidays](https://github.com/dr-prodigy/python-holidays) : 공휴일 구하기. 시계열 데이터에서 유용하게 활용 가능 88 | - [pprint](https://docs.python.org/ko/3/library/pprint.html) : 이쁜 출력을 위한 내장 라이브러리 89 | 90 | ## Web 91 | 92 | ### [Flask](web/flask.md) 93 | 94 | - Flask에 캐시가 쌓여 새로고침이 안된다면? 95 | 96 | ### Library & Service 97 | 98 | - [Vercel](https://vercel.com/) : 쉬운 배포 서비스 99 | 100 | - CSS/Styles 101 | - [Tailwind UI](https://tailwindui.com/) : 유틸리티 CSS Framework 102 | - [Headless UI](https://headlessui.dev/) : Tailwind UI와 함께 사용할 수 있는 UI Components 103 | - [Chakra UI](https://chakra-ui.com/) : 사용하기 좋은 프레임워크 (추천) 104 | - [Chakra Templates](https://chakra-templates.dev/) : Chakra로 만든 여러 컴포넌트 제공 105 | - react 106 | - [Reactour](https://github.com/elrumordelaluz/reactour) : react에서 onboarding을 도와주는 패키지 107 | - [react-i18next](https://github.com/i18next/react-i18next) : react 다국어처리 패키지 108 | 109 | ### Data Visualization(JS) 110 | 111 | - [D3](https://d3js.org/) : 하나씩 커스텀하고 싶은 사용자라면 d3 112 | - [Plotly](https://plotly.com/) : 파이썬으로도 사용가능 113 | - [Recharts](https://recharts.org/) 114 | - [Chart.js](https://www.chartjs.org/) 115 | - [Highchart](https://www.highcharts.com/) 116 | 117 | ## Tool 118 | 119 | ### Website 120 | 121 | - 오픈소스 122 | - [Codepen](https://codepen.io/) : html/css/js 코드 스니펫 공유 사이트. 다른 사람들을 통해 테크닉을 습득하기도 좋음 123 | - 문서 작업 124 | - [Thesaurus.com](https://www.thesaurus.com/) : 유의어 사전 125 | - [Grammarly](https://app.grammarly.com/) : 문법 체크 126 | - [맞춤법 검사](http://speller.cs.pusan.ac.kr/) : 어떤 문서든 제발...한 번 이상 돌려보길. 127 | - 디자인 작업 128 | - [flaticon](https://www.flaticon.com/) : 저작권 free 아이콘 129 | - [Unsplash](https://unsplash.com/) : 저작권 free 이미지 130 | - [dafont.com](https://www.dafont.com/) : 저작권 free 영어 폰트 131 | - [carbon](https://carbon.now.sh/) : 코드 공유 이쁘게 만들어주는 사이트 132 | - [2 Color Combinations](https://2colors.colorion.co/) : 시각화/UI에서 2색 조합을 살펴볼 때 유용한 사이트 133 | - 트렌드 134 | - [GeekNews](https://news.hada.io/) : 최신 개발/기술/스타트업 뉴스 팔로우업에 좋은 서비스 135 | - [Product Hunt](https://www.producthunt.com/) : 스타트업의 각자 서비스 공유 플랫폼. 여러 최신 SaaS 등을 살펴볼 수 있음 136 | - [Disquiet](https://disquiet.io/) : 메이커를 연결해주는 플랫폼. Product Hunt와 유사하게 활용 가능. 137 | - ETC 138 | - [Ghost](https://ghost.org/) : 깃헙 블로그도 싫고, 티스토리도 싫다면? 유료 블로그 플랫폼 139 | - [StackShare](https://stackshare.io/) : 기술스택공유 템플릿 사이트 140 | - 141 | ### Note Taking 142 | 143 | - [Notion](https://www.notion.so/) : 이제는 국룰이 되어버린 노트툴 144 | - [oopy](https://www.oopy.io/) : 노션 페이지를 웹사이트로 만들어주는 서비스 145 | - [Obsidian](https://obsidian.md/) : Roam과 비슷한 기능의 도구 146 | - [Craft](https://www.craft.do/) : Notion과 유사한 툴. MacOS에서 사용하며 더 깔끔한 느낌. 147 | - [Bear](https://bear.app/) : 가벼운 마크다운 툴 148 | - [Roam Research](https://roamresearch.com/) : 그래프 형식으로 마크다운 노트를 정리할 수 있는 도구 149 | 150 | ### VSCode Extension 151 | 152 | - [VSCode Setting Github 계정으로 연동하기](https://code.visualstudio.com/docs/editor/settings-sync) 153 | - [GitLens](https://github.com/Axosoft/vscode-gitlens) : Vscode에서 깃 기록을 앞/뒤로 확인할 수 있는 도구 154 | 155 | ### Chrome Extension 156 | 157 | - [Arxive](https://chrome.google.com/webstore/detail/arxive/hkoblclipggkhhbllgefhnbjdcajmelh/related?hl=ko) : Arxiv 논문 제목을 연도가 아닌 제목-저자 형식으로 바꿔주는 툴 158 | - [Google Scholar Button](https://chrome.google.com/webstore/detail/google-scholar-button/ldipcbpaocekfooobnbcddclnhejkcpn?hl=en) : google scholar 검색을 extension 상에서 할 수 있음. 159 | 160 | ### Application 161 | 162 | - [Todoist](https://todoist.com/) : 투두리스트 관리 툴 - 사용성이 좋음 163 | - [TickTick](https://ticktick.com/) : 투두리스트 관리 툴 - 기능이 많음 164 | - [Mathpix Snip](https://mathpix.com/) : 수식 스크린샷을 LaTex으로 바꿔주는 툴 165 | - [1password](https://1password.com/) : 패스워드 관리 툴 166 | - [Havitica](https://habitica.com/) : 게이미피케이션을 활용한 루틴 관리 툴 167 | 168 | ## Articles & Repo 169 | 170 | - Articles 171 | - [오욱환, 학문을 직업으로 삼으려는 젊은 학자들을 위하여](http://home.ewha.ac.kr/~oookwhan/essay/essay2-toyoung.htm) : 대학원생에게 추천하는 글 172 | - [이직초보 어느 개발자의 이력서 만들기](https://techblog.woowahan.com/2531/) : 처음 CV를 작성하는 분들에게 추천하는 글 173 | - [subicura님 블로그 : 본격 macOS에 개발 환경 구축하기](https://subicura.com/2017/11/22/mac-os-development-environment-setup.html) : 맥 초기 세팅 가이드라인 174 | - Repos 175 | - [Modern Unix](https://github.com/ibraheemdev/modern-unix) : 짱짱 멋진 command 명령어 모음 176 | - [awesome-devteam](https://github.com/leehosung/awesome-devteam) : 좋은 개발팀을 만드는데 도움이 되는 자료 (국문!) 177 | - Youtube & Videos 178 | - [Ali Abdaal](https://www.youtube.com/channel/UCoOae5nYA7VqaXzerajD0lg) : 생산성 관련 유튜브 채널 179 | - [How great leaders inspire action](https://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action/up-next?language=en) : Golden Circle의 창시자 사이먼 시넥의 TED 발표. 왜?를 먼저 생각해야 하는 이유. 180 | - Books 181 | - [타이탄의 도구들(팀 페리스 저)](https://shopping.interpark.com/product/productInfo.do?prdNo=8577355413) : 성장하고 싶은 이들을 위해. 182 | - [소프트 스킬(존 손메즈 저), 길벗](http://www.yes24.com/Product/Goods/23161141) : 개발자에게 필요한 역량에 대한 다양한 조언을 줄 수 있는 책입니다. 183 | - [초생산성(마이클 하야트 저), 로크미디어](http://www.kyobobook.co.kr/product/detailViewKor.laf?mallGb=KOR&ejkGb=KOR&barcode=9791135465512) : 생산성에 대해 생각해보고, 본인의 삶을 더 자유롭게 만드는 책 -------------------------------------------------------------------------------- /linux/.vimrc: -------------------------------------------------------------------------------- 1 | syntax on 2 | filetype indent plugin on 3 | set tabstop=4 4 | set softtabstop=4 5 | set shiftwidth=4 6 | set autoindent 7 | 8 | set hlsearch 9 | set ruler 10 | set showmatch 11 | 12 | set number "line number 표기 13 | let &t_SI = "\]50;CursorShape=1\x7" " Vertical bar in insert mode 14 | let &t_EI = "\]50;CursorShape=0\x7" " Block in normal mode 15 | let &t_SR = "\]50;CursorShape=2\x7" " Underline in replace mode -------------------------------------------------------------------------------- /linux/github.md: -------------------------------------------------------------------------------- 1 | ## Github Profile Badge List 2 | 3 | - github repo에 본인 계정명으로 repo를 만들면 프로필이 생성된다. 4 | - 사용할 수 있는 배지 리스트 5 | - 배지 사용하기 [shields.io](https://shields.io/) 6 | - 아이콘 사용하기 [simpleicons](https://simpleicons.org/) 7 | - 조회수 확인 [Hits](https://hits.seeyoufarm.com/) 8 | - 깃헙 통계 [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) 9 | - daily coding [productive-box](https://github.com/maxam2017/productive-box) 10 | - Pinned Gist [awesome-pinned-gists](https://github.com/matchai/awesome-pinned-gists) 11 | - boj/solved-ac 배지 [mazassumnida](https://github.com/mazassumnida/mazassumnida) 12 | - kaggle 배지 [kaggle-badge](https://github.com/subinium/kaggle-badge) 13 | - 코드 퀄리티 [codefactor](https://www.codefactor.io/) 14 | - 깃헙 공식 아이콘 15 | - github topic에서 아이콘 링크 사용 가능 [github topic](https://github.com/topics) 16 | 17 | ## 브랜치를 만들면서 바로 체크아웃하려면 (`git checkout -b`) 18 | 19 | - 다음 과정을 한 번에 진행 20 | - git branch <브랜치명> 21 | - git checkout <브랜치명> 22 | 23 | ``` sh 24 | git checkout -b 25 | ``` 26 | 27 | ## 커밋 날짜 바꾸기(`git commit --amend --no-edit --date`) 28 | 29 | - 마지막 커밋 날짜를 수정하는 가장 간단한 코드 30 | - 오늘로 바꾸고 싶다면 날짜 텍스트 대신 `$(date)`으로 변경 가능 31 | - 1일1커밋러에게 추천 32 | 33 | ``` 34 | git commit --amend --no-edit --date "Sat 1 Jan 2022 00:00:00 KST" 35 | ``` 36 | 37 | ## 한글 에러 방지(`core.precomposeunicodem`, `core.quotepath`) 38 | 39 | - 깃에서 한글 작성에서 에러가 발생함을 방지하기 위한 설정 40 | - 한글 작성 가능 + 파일명이 깨지지 않기 41 | 42 | ``` 43 | git config --global core.precomposeunicode true 44 | git config --global core.quotepath false 45 | ``` -------------------------------------------------------------------------------- /linux/gpu.md: -------------------------------------------------------------------------------- 1 | ## 사용 GPU 지정 Python (`CUDA_VISIBLE_DEVICES`) 2 | 3 | - 파이썬 실행 시 GPU를 지정하는 방법 4 | - N개를 지정하고 싶다면 `,`로 구분 5 | 6 | ``` sh 7 | CUDA_VISIBLE_DEVICES=1 python hello.py 8 | CUDA_VISIBLE_DEVICES=1,3 python hello.py 9 | ``` 10 | 11 | ## CUDA 버전 확인하기 (`nvcc`) 12 | 13 | - CUDA 및 GPU 확인을 위한 기본적인 명령어 14 | - 이게 실행안되면 path 설정 issue 15 | - 아래의 nvidia-smi랑 종종 다른 버전을 말하는 경우가 있는데 보통은 path 문제 16 | 17 | ``` sh 18 | nvcc --version 19 | ``` 20 | 21 | ## GPU 사용량 확인하기 (`nvidia-smi`) 22 | 23 | - 기본적으로는 `nvidia-smi`를 사용해서 보면 된다. 24 | - 주기적으로 gpu 사용량을 확인하고 싶다면 아래를 사용하자. 25 | 26 | ``` sh 27 | nvdia-smi 28 | watch -n 1 nvidia-smi 29 | ``` 30 | 31 | - GPU를 안쓰는 데, 사용량이 많다면 `top`, `ps` 등의 명령어로 process를 찾아 `kill`할 것 32 | 33 | ## GPU 사용량 확인하기 2 (`nvtop`) 34 | 35 | - https://github.com/Syllo/nvtop 36 | - 위 보다 조금 더 간지나는(?) GPU 모니터링 툴 37 | 38 | ``` sh 39 | nvtop 40 | ``` 41 | 42 | ## GPU 사용량 확인하기 3 (`nvitop`) 43 | 44 | - https://github.com/XuehaiPan/nvitop 45 | - 위 보다 조금 더 간지나는(??) GPU 모니터링 툴 46 | 47 | ``` sh 48 | nvitop 49 | ``` -------------------------------------------------------------------------------- /linux/server.md: -------------------------------------------------------------------------------- 1 | ## 서버 간 파일 전송하기 (`scp`) 2 | 3 | - `-p`는 port 번호 지정 4 | - `-r`는 디렉토리 단위일 때 5 | - source와 target은 꼭 본인 서버가 아니어도 되므로 알고 있으면 좋음 6 | 7 | ``` sh 8 | ssh -p [-r] 9 | ``` 10 | 11 | ## 외부 localhost 접속하기 (`ngrok`) 12 | 13 | - 개발 단위에서는 localhost에서 특정 포트에 서버가 열림 (웹, 주피터 노트북) 14 | - 이를 현재 개발 환경에서 열기 위해 사용하는 명령어 15 | - vscode에서 ssh로 직접 연결하면, 이런 과정이 필요 없음 16 | 17 | ``` sh 18 | ngrok http 19 | ``` 20 | 21 | ## 서버 password 변경하기 (`passwd`) 22 | 23 | - 해당 명령어를 치면 기존 서비스와 같이 비밀번호 변경가능 24 | 25 | ``` 26 | passwd 27 | ``` 28 | 29 | ## remote server의 port를 localhost에서 사용하기(`ssh -L` or `ssh -R`) 30 | 31 | - **ssh 터널링**이라고도 함 32 | - remote server에서 실행하는 다양한 일들(tensorboard, local 등)을 실행하고 웹서버를 localhost로 키게 될때 사용 33 | - 원래는 remote server의 localhost였으나 local에서 열 수 있음 34 | - `-L`은 local forwarding, `-R`은 dynamic forwarding인데, 이는 방화벽과 연결 방법에 따라 다르다. 35 | 36 | ``` 37 | ssh -L :localhost: subinium@ 38 | ``` 39 | 40 | ## 서버의 GUI를 Mac에서 연동하기 (`ssh -X` or `ssh -Y`) 41 | 42 | - 서버의 GUI를 실행하기 위해서는 `ssh`에서 `-X`나 `-Y`를 사용하면 된다. 43 | - 둘 다 X11 Forwarding을 사용한다. 44 | - Mac에서는 일부 설정이 필요하다. 45 | - XQuartz 설치 46 | - ssh config 변경 47 | - 각 모드는 [이런 차이점](https://askubuntu.com/questions/35512/what-is-the-difference-between-ssh-y-trusted-x11-forwarding-and-ssh-x-u)이 있다고 한다. 48 | 49 | ``` 50 | ssh -X 51 | ssh -Y 52 | ``` 53 | 54 | ## 서버 ssh-key로 password없이 접속하기 (`ssh-keygen`) 55 | 56 | - ssh 접속 시에 매번 password를 적는 것보다 ssh-key를 미리 생성해두면 좋다. 57 | - key의 종류는 다양하지만 일반적으로 rsa 4096을 많이 사용한다. 58 | - `.pub` 파일을 접속하는 서버에 보내야 하는 데, 이때 `ssh-copy-id`를 사용한다. 59 | 60 | ``` 61 | ssh-keygen -t rsa -b 4096 62 | ssh-copy-id -i ~/.ssh/id_rsa_name.pub username@server -p port_num 63 | ``` 64 | 65 | ## ssh config 파일 설정으로 간단하게 접속하기 (`~./ssh/config`) 66 | 67 | - [ssh config](https://www.ssh.com/academy/ssh/config) 설정은 다양하게 할 수 있음 68 | - `~./ssh/`에 `config`파일을 수정하여 접속을 간단하게 할 수 있음 69 | - 다음과 같은 형태로 config에 작성 (여러 서버작성 가능) 70 | 71 | ``` 72 | Host host_name 73 | HostName xxx.xxx.xxx.xxx 74 | User username 75 | Port 1234 76 | IdentityFile ~/.ssh/id_rsa_name 77 | ``` 78 | 79 | - host_name은 자유롭게 80 | - ssh-keygen과 함께 사용하면 더 좋음 (IdentityFile) 81 | - 설정을 하면 다음과 같이 서버명, 유저명, 포트명, 패스워드 없이 바로 접속가능 82 | 83 | ``` 84 | ssh host_name 85 | ``` -------------------------------------------------------------------------------- /linux/util.md: -------------------------------------------------------------------------------- 1 | ## 노트북을 덮거나 시간이 지나도 꺼지지 않게 (`caffeinate`) 2 | 3 | - 전처리 작업 등을 local에서 할 때, 꺼지지 않게 4 | - 원격 서버라면 `tmux`를 사용하면 됨 5 | 6 | ``` sh 7 | caffeinate 8 | ``` 9 | 10 | ## 파일 개수를 알고 싶다면? (`ls -l | grep ^- | wc -l`) 11 | 12 | ``` sh 13 | ls -l | grep ^- | wc -l 14 | ``` 15 | 16 | ## 디스크의 남은 용량을 알고 싶다면 (`df -h`) 17 | 18 | - 리눅스 시스템 전체의 디스크 사용량을 알 수 있음 19 | - `-h` 옵션은 Mb, Gb 단위로 바꿔서 확인해주는 옵션 20 | 21 | ``` sh 22 | df -h 23 | ``` 24 | 25 | ## Syntax Highlight와 함께 cat을 쓰고 싶다면 (`bat`) 26 | 27 | - cat과 유사하지만 syntax highlight가 적용되어 출력하는 명령어 28 | 29 | ``` sh 30 | brew install bat 31 | bat 32 | ``` 33 | 34 | 팁으로 이걸 cat에 alias하면 좋습니다. 35 | 36 | ``` 37 | alias cat="bat" 38 | ``` 39 | 40 | ## iterm에서 new tab을 만들 때 directory를 유지하고 싶다면? 41 | 42 | - iterm preferences > Profiles > Working Directory > Advanced Configuration에서 edit 43 | - Working Directory for New Tabs를 Reuse previous sessions's directory로 변경 44 | 45 | ## 심볼릭 링크 사용하여 바로가기 만들기(`ln -s`) 46 | 47 | - 바로가기를 만드는 것이다. 48 | 49 | ``` sh 50 | ln -s [target path] [source path] 51 | ``` 52 | 53 | ## pip로 설치 시, 필요없는 output을 보지 않으려면? (`pip install`의 `-q`, `-qq`, `-qqq`) 54 | 55 | - jupyter notebook에서 pip로 라이브러리 설치 시, output 때문에 내용이 보기 어려운 경우가 많다. 56 | - 물론 shell에서도 마찬가지. 57 | - 이럴 때는 `-q`, `-qq`, `-qqq` 옵션을 주어 output을 생략할 수 있다. 58 | - `-q` : WARNING,ERROR,CRITICAL 59 | - `-qq` : Error, CRITICAL 60 | - `-qqq` : CRITICAL 61 | 62 | ``` 63 | pip install -qqq 64 | ``` 65 | 66 | ## tmux에서 마우스 사용하기(`set -g mouse on`) 67 | 68 | - tmux에서 마우스를 사용하기 위해 `.tmux/.tmux.conf.local`에서 주석처리 제거 69 | 70 | ``` 71 | # start with mouse mode enabled 72 | set -g mouse on 73 | ``` 74 | 75 | ## json 파일 이쁘게 보기 (`jq`) 76 | 77 | - json을 이쁘게 보여줌 78 | 79 | ``` 80 | brew install jq 81 | jq test.json 82 | ``` 83 | 84 | ## 폰트 추천 (`D2 Coding`) 85 | 86 | - 개발 폰트 추천 87 | - [naver/d2codingfont](https://github.com/naver/d2codingfont) -------------------------------------------------------------------------------- /linux/vim.md: -------------------------------------------------------------------------------- 1 | ## (vimrc) 문서 형식 파악 및 문법 하이라이트(`syntax on`, `filetype indent plugin on`) 2 | 3 | - 별도 플러그인 없이 기본 문법 하이라이트 4 | 5 | ``` 6 | syntax on 7 | filetype indent plugin on 8 | ``` 9 | 10 | ## (vimrc) 검색, 괄호 등 정보 하이라이트(`hlsearch`, `ruler`, `showmatch`) 11 | 12 | - `hlsearch` : 검색 시, 결과 하이라이트 13 | - `ruler` : 현재 작성 줄 정보 표기 14 | - `showmatch` : 매칭되는 괄호 표시 15 | 16 | ``` 17 | set hlsearch 18 | set ruler 19 | set showmatch 20 | ``` 21 | 22 | ## (vimrc) Python 문서 작성에 편리한 모드(tab 사이즈, indentation) 23 | 24 | - 기본 tab size 조정 25 | - auto indentation과 indent 조정 26 | 27 | ``` 28 | set tabstop=4 29 | set softtabstop=4 30 | set shiftwidth=4 31 | set autoindent 32 | ``` 33 | 34 | ## (vimrc) 라인 번호 표기 35 | 36 | - line number 표기 37 | 38 | ``` 39 | set number "line number 40 | ``` 41 | 42 | ## (vimrc) 모드별 커서 모양 변경 43 | 44 | ``` 45 | " cursor shap 46 | let &t_SI = "\]50;CursorShape=1\x7" " Vertical bar in insert mode 47 | let &t_EI = "\]50;CursorShape=0\x7" " Block in normal mode 48 | let &t_SR = "\]50;CursorShape=2\x7" " Underline in replace mode 49 | ``` 50 | 51 | ## vim에서 여러 줄 주석 처리 (`norm i#`, `norm 1x`) 52 | 53 | - visual mode에서 원하는 부분 선택 54 | - 이후 norm을 사용하여 `#`을 줄 맨 앞에 삽입 55 | - 언어에 따라 `#` 외의 표현 사용 가능 56 | 57 | ``` 58 | :norm i# 59 | ``` 60 | 61 | - 주석 삭제는 다음과 같이 문장의 첫 단어 삭제 62 | - 1 대신 다른 숫자를 넣어 n개의 문자 삭제 가능 63 | 64 | ``` 65 | :norm 1x 66 | ``` 67 | 68 | ## vim에서 sudo로 저장하기 (`w sudo! tee %`) 69 | 70 | - vi로 켰는데 갑작스럽게 권한이 없어서 저장이 어렵다면? 71 | - 각 명령어 설명 72 | - `w` : 쓰기 73 | - `!sudo` : 루트 권한 74 | - `tee` : stdin으로 전달 75 | - `%` : 현재 파일명 대체 76 | 77 | ``` 78 | :w sudo! tee % 79 | ``` -------------------------------------------------------------------------------- /web/flask.md: -------------------------------------------------------------------------------- 1 | ## Flask에 캐시가 쌓여 새로고침이 안된다면? 2 | 3 | - Flask 개발 시, 캐시가 쌓이다보면 새로고침해도 수정사항이 반영되지 않음 4 | - `ctrl/cmd` + `shift` + `상단 새로고침` 시 캐시와 상관없이 새로고침 --------------------------------------------------------------------------------