목록전체 글 (21)
Ramanu
파이썬 코드 주석처리 정규식 실험환경 : notepad++ 검색키워드 : #(?:.*?)\n replace : \n 하면 주석 처리 가능
Setting > Options > Shared Folders > Enabled 한 후에 /mnt/hgfs/이 출력 안될 때, sudo mkdir /mnt/hgfs/ sudo vmhgfs-fuse .host:/ /mnt/hgfs/ -o allow_other -o uid=1000 다음과 같이 입력
# python3 기준 파이썬 코딩할 때 자주 사용하는 기술 정리(계속 추가예정..) 1. 리스트 공백 제거 data = [idx for idx in data if idx] 2. 리스트 중복제거 1) for 구문 data1 = [] for idx in data: if idx not in data1: data1.append(idx) 2) set 이용 data = list(set(data)) 3. hex string을 byte값으로 변환하는 방법 ex) '1f'(string) -> \x1f data = '1f' data = bytes.fromhex(data) >>> b'\x1f' https://stackoverflow.com/questions/5649407/hexadecimal-string-to-byte-a..
ssh사용시 내가 원하는 directory를 최상위 directory로 설정하는 방법 chroot를 사용하여 작업시 상위 directory로 이동하지 못하게 하고 싶을 때가 있다. 이 때 id를 만들어 chroot 방식의 ssh 접근을 설정해주는 방법을 설명한다. 1 2 3 4 5 6 7 8 9 10 11 12 $ mkdir /root/test_dir $ vi /etc/ssh/sshd_config #가장 아래쪽에 추가 +++ Match User test +++ ChrootDirectory /root/test_dir #[원하는 path] $ useradd test $ passwd test(useradd에서 비밀번호 변경하지 않는 경우) $ service ssh restart 또는 /etc/init.d/ss..