2020/06 7

명령어 정리

ps -e 실행중인 모든 프로세스 -f 프로세스의 자세한 정보 -u 특정 사용자에 대한 프로세스 정보 -p pid로 지정한 프로세스 정보 u 상세 정보 a 터미널에서 실행한 프로세스 정보 x 실행중인 모든 프로세스 좀비 프로세스 찾기 ps -ef | grep defunct '문자열' 찾기 ps -eaf | grep '문자열' '문자열' 제외하고 찾기 ps -eaf | grep -v '문자열' find '파일이름' 이 존재하는 모든 전체 경로 출력 find / -name 파일이름 생성된지 30일 지난 파일들 찾기 find . -name '파일이름*' -mtime +30 용량이 1 아래인 파일 find . -name '파일이름*' -size -1 30분 안에 수정된 파일중에 파일이름으로 시작하는 파일을 찾아..

python slacker

1. python slack API - 준비 1. bot 만들고 token 얻기 https://api.slack.com/apps 위의 주소로 접속 Create New App 클릭 App Name 입력 -> Development Slack Workspace 선택 -> Create App 클릭 Your Apps 클릭 -> 방금 생성한 bot 클릭 Verification Token 복사 2. slacker 설치 pip install slacker 2. python slack API - 실제로 사용해보기 1. 공통 부분 작성 from slacker import Slacker token = "Verification Token" slack = Slacker(token) 2. 채널 리스트 얻어오기 channel_li..

chrome driver, chrome, centos7

chrome 설치 yum 저장소 만들기 sudo vi /etc/yum.repos.d/google-chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub chrome 설치 sudo yum install google-chrome-stable chrome 버전 확인 google-chrome --version [noel@noel_server]# google-chrome --version Google Chrome 83.0.4103..

pymysql

pymysql mysql timestamp select import datetime timestamp = datetime.datetime(2020, 1, 1) q = "SELECT * FROM test_table WHERE created_timestamp < %s" cursor.execute(q, (timestamp))column type 이 timestamp 라면 string으로 selct 하지 말것 timestamp = &#39;2020-01-01&#39; 오류는 발생하지 않지만 select는 불가능합니다. 꼭 datetime으로 변환해서 넣어줘야 합니다 pymysql timestamp 일부만 update 날짜는 그대로 두고 년도와 월만 update today = "2020-01" q = "UPDAT..

Python 2020.06.01