Skip to content

Instantly share code, notes, and snippets.

@passionsjin
passionsjin / bash_read_only_system_error.md
Last active December 13, 2021 10:33
cannot create temp file for here-document: Read-only file system 해결
# disk의 rw 유무 확인 / 혼자 ro일 가능성 높음
cat /proc/mounts | grep /dev

fsck -f /dev/vda1
reboot

# 그래도 안되면
umount /dev/vda1
e2fsck /dev/vda1
@passionsjin
passionsjin / bash_cheat.md
Created December 7, 2021 00:38
Bash Cheet Sheet

특정 파일(시간) 파일 삭제

find . -name "*.zip" -ctime +7 -type f -exec rm -f {} \;

@passionsjin
passionsjin / send_massage.py
Created June 21, 2021 12:45
Telegram Rest API (SendMessage)
def send_msg(msg):
req = requests.post(url=f'https://api.telegram.org/bot{token}/sendMessage',
json={'chat_id': chat_id,
'text': msg})
return req.text
@passionsjin
passionsjin / pyenv_install.md
Created February 2, 2021 09:46
pyenv & virtualenv 설치
  • pyenv


git clone https://github.com/pyenv/pyenv.git ~/.pyenv

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
@passionsjin
passionsjin / dir_path.py
Created January 14, 2021 06:52
Python 현재 디렉토리 & 루트 디렉토리
current_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.dirname(sys.modules['__main__'].__file__)
sudo apt-get install mongodb-clients
mongo --host {host} -u admin -p --authenticationDatabase admin
27017
1. 계정 생성하기
db.createUser({user: "계정이름",
pwd: "비밀번호",
@passionsjin
passionsjin / pyinstall.md
Created November 19, 2020 04:46
pyinstall 사용방법 (exe 말기)

EXE 파일 만들기

pyinstaller --noconfirm --onefile --console "C:/Users/Administrator/Desktop/New folder/sec_azure_script/main.py"

@passionsjin
passionsjin / pycharm_setting.md
Created November 11, 2020 04:55
Pycharm Terminal venv 설정(windows)

Settings > Tools > Terminal > Shell path 설정

"cmd.exe" /k ""C:\Users\YoungjinPark\Desktop\project_root\venv\Scripts\activate.bat""

```
sudo apt-get update
sudo apt-get install nginx -y
```
- 기본 호스트 path : `/var/www/html`
- Config path : `/etc/nginx`
@passionsjin
passionsjin / docker_install.md
Last active November 30, 2021 02:03
Docker 설치