분류 전체보기 1135

boost python numpy 컴파일해서 설치

Dead snakes로 python 3.10등을 설치할 수는 있지만, numpy는 제공되지 않아서 문제다. pip install numpy 로 넘파이를 쓸 수는 있는데, C++ 모듈을 짜서 numpy와 연동하는 부분은 linking이 되지 않을 것이다. ㄱ-;; ~/usr/venv-3.10 에 venv가 있고, numpy 모듈이 설치가 된 상태로 작업해야 한다. 그래야 부스트 컴파일러가 numpy가 있다고 감지를 해서 numpy 모듈도 빌드할 것이다. Python3.10에 boost_1_82_0.tar.bz2 기준이다. Instructions 1. boost 소스코드를 받아 압축을 푼다. 2. ./bootstrap.sh --with-python=$HOME/usr/venv-3.10/bin/python 3...

Unix/Ubuntu 2023.05.03

Airflow 대체: dagster, prefect

https://www.reddit.com/r/dataengineering/comments/s78jvx/best_job_scheduler_in_2022_airflow_dagster/ r/dataengineering on Reddit: Best job scheduler in 2022? (Airflow / Dagster / Prefect / Luigi / other) Posted by u/UglyChihuahua - 56 votes and 33 comments www.reddit.com droplet에서 airflow는 db도 띄우고 생난리를 쳐야 해서 못 쓰겠더라. 램이 4gb밖에 안 되는데 airflow가 2gb는 먹고 들어간다. yacron/cron, make를 생으로 쓰면서 맨날 에러 뜨니까 관리가 안..

Data science 2023.04.28

python3.10 venv No module named 'MySQLdb'

맨날 까먹는데, 해법이 너무 옛날 것들이 검색됨. venv환경에서 이를 해결보려면... https://stackoverflow.com/questions/48617779/virtualenv-importerror-no-module-named-mysqldb VirtualEnv ImportError: No module named MySQLdb I am receiving the error: ImportError: No module named MySQLdb whenever I try to run my local dev server and it is driving me crazy. I have tried everything I could find online: brew install mysql... stackover..

카테고리 없음 2023.04.04

systemctl wrapper

systemctl 과 pm2를 비교하면 명령어가 쉽다는거...? display를 예쁘게 해준다는거? 이 두 개 정도가 많이 아쉽다. 또 아쉬운 것은 pm2 start "명령어" 치면 바로 그냥 시작을 해준다는 거... pm2 start정도로 쉽진 않지만 그래도 pm2는 자체버그가 많아서 간간이 탈을 내는 편임. 다시 systemctl --user로 돌아옴. 다만 wrapper를 작성했다. #!/usr/bin/perl my $scu = "systemctl --user"; my $cmd = shift; my $args = join(' ', @ARGV); if ($cmd eq "") { system("$scu list-unit-files --type=service"); system("$scu list-unit..

Unix 2023.03.30

pm2-yacron 조합

유저 레벨에서 계속 실행되는 서비스를 관리할 때에는 이제 systemctl --user 보다는 pm2가 더 편한 툴로 생각된다. 슬슬 갈아타고있다. resilios sync라든지... 하지만 cron으로 돌리던 주기작업의 경우는 어떤가? pm2가 주기작업은 좀 별로인 것 같다. 실행이 안 되는 때도 있다 이상하게. 그리고 pm2 ls를 쳐보면 stopped로 뜨는 것도 마음에 안 든다. cron은 logging이 잘 안 되기도 하고 (잘 되는데 syslog로 들어간다든지해서...) notification을 보낸다든지 하는 부분이 이메일로 간다든지해서 영 별로임. https://pypi.org/project/yacron/ yacron A modern Cron replacement that is Docker..

Unix 2023.01.30

pm2 logrotate

pm2가 다 좋은데 logrotate만 없다 (?) 있는데 기본은 아니고 pm2 plugin이다. 그냥 시스템에 설치된 것으로 할지 pm2 plugin으로 할지 약간은 고민이 된다. /etc/logrotate.d/pm2-ubuntu /home/ubuntu/.pm2/logs/*.log { su ubuntu ubuntu daily rotate 10 copytruncate delaycompress compress notifempty missingok } 시스템 기본 logrotate로 한다면 위와 같이 하면 된다.. 하지만 시스템 파일을 건드려야 한다는 단점이 있다. 하지만 대부분 시스템에 있는 것을 활용하는 것이기도 하고, 세팅에 참고할 자료가 많음. pm2 logrotate로 구글링하면 한국자료도 많이 나..

Unix 2023.01.17

btdu - ncdu vs btrfs

btrfs를 쓰다보면 가끔 당혹스러울 때가 있다. ncdu로 파일의 크기만 합쳐놓고 보면 0.9 TB인데 df -h로 보면 1.8 TB를 먹고있는 것이다! 블록크기가 좀 큰가보다. btdu란 툴을 쓰면 어느 공간이 어떻게 쓰이고 있는지 대충 볼 수 있다. https://github.com/CyberShadow/btdu GitHub - CyberShadow/btdu: sampling disk usage profiler for btrfs sampling disk usage profiler for btrfs. Contribute to CyberShadow/btdu development by creating an account on GitHub. github.com 아치리눅스 aur 패키지는 존재하는데, 다른 ..

Unix 2022.11.25

SSH에 2FA (Google authenticator) 적용하기

의외로 몹시 쉽다. Instructions https://ubuntu.com/tutorials/configure-ssh-2fa#1-overview 공식 가이드인데 디테일이 조금 부족 https://dev.to/himadriganguly/configure-ssh-server-with-key-based-and-two-factor-authentication-3oc2 이걸 보고 했다. https://serverfault.com/questions/1073593/ssh-public-key-authentication-with-google-authenticator-still-asks-for-password 여기도 같은 맥락의 답이 달려있다. sudo apt install libpam-google-authenticato..

Unix 2022.11.15