How to clone a sub-directory only of a Git respository

 mkdir <repo>

cd <repo>

git init

git remote add -f origin <url>

git config core.sparseCheckout true

echo "some/dir/" >> .git/info/sparse-checkout

echo "another/sub/tree" >> .git/info/sparse-checkout

git pull origin master


-Reference

https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository

 Tensorflow - How to use Inception model


1. tensorflow 폴더에 소스 코드 복사하기

 cd /tensorflow

git clone https://github.com/tensorflow/models


2. 파이썬 경로에 nets 경로 추가

export PYTHONPATH="$PYTHONPATH:/tensorflow/models/slim"


3. inception_resnet_test 파일 실행

 cd /tensorflow/models/slim/nets

python inception_resnet_v2_test.py




Linux command - show number of lines or words of file


- 파일 행 갯수 표시

wc -l ${file_path}


- 파일 단어 갯수 표시 (공백 기준)

wc -w ${file_path} 


- 실행 커맨드

screen -S mysession

screen -list

screen -r myses (deattached session)

screen -rd myses (attacted session)

screen kill myses


- 키

Ctrl+a ? : 도움말 보기

Ctrl+a c : 새로운 가상터미널 생성 

Ctrl+a a : 이전 창으로 이동

Ctrl+a n : 다음 창으로 이동

Ctrl+a w : 창 리스트를 보여줌

Ctrl+a " : 열린 스크린 리스트를 보여줌

Ctrl+a [0-9] : 해당 번호의 터미널로 이동

Ctrl+a d : 현재 상태에서 detach 시킴

Ctrl+a K : 보고 있는 가상터미널 프로세스를 죽임

Ctrl+a C : 보고 있는 가상터미널 화면을 지움

Ctrl+a H : 보고 있는 가상터미널 로그를 기록, 다시 한번 실행시키면 중지

Ctrl+a s(x) : 현재 창을 잠금

Ctrl+a q : 잠궈진 현재 창을 해제

Ctrl+a S : 스크린 창을 가로 분할

Ctrl + a :resize : 분할된 크기 조정 

Ctrl + a :remove : 분할된 윈도우를 삭제

Ctrl+a tab : 스크린 상 이동

Ctrl+a I : 스크린 창을 세로 분할 (유분트에서만?)

Ctrl+a Q : 현재 스크린 이외에 닫기

Ctrl+a X : 현재 스크린을 제거한다

-Reference

http://egloos.zum.com/sulac/v/5623987

https://kldp.org/node/18744

http://faq.hostway.co.kr/?mid=Linux_ETC&page=3&document_srl=1601


How to use argparse  FLAGS




apt-get update
apt-get install python-tk -y (python3-tk : 버전3의 경우)

* -y : 모든 설치 질문에 동의

Linux Command ln - create link file

ln -s {원본파일} {심볼파일}

ln -s main_ver1.txt main

[옵션]

  • --backup[=CONTROL] : 대상파일이 이미 존재할 경우에 백업파일을 만든 후에 링크파일 생성
  • -b : 링크파일 생성시에 대상파일이 이미 존재하면 백업파일을 만든 후에 링크파일을 생성
  • -d : 디렉토리에 대한 하드링크파일생성을 가능하게 함. 단 root 권한으로 수행하더라도 시스템의 권한제한으로 인하여 실패할 가능성이 높음. (-F 와 --directory 는 -d 와 동일함)
  • -f : 대상파일이 존재할 경우에 대상파일을 지우고 링크파일을 생성
  • -i : 대상파일이 존재할 경우에 대상파일을 지울것인가를 확인요청 (--interactive 와 동일)
  • -s : 심볼릭 링크파일을 생성
  • -S : 백업파일 생성시에 원하는 접미사(suffix)를 지정할 수 있음
  • -t, --target-directory=DIRECTORY : 링크파일을 생성할 디렉토리를 지정


출처: http://webdir.tistory.com/148 [WEBDIR]

sudo chmod 664 /etc/screenrc

vi /etc/screenrc

vbell off #<-vbell on


1. vi 에서 블럭 지정을 이용한 # 추가


Ctrl + v 로 원하는만큼 블럭 지정

Shift + i

# 입력

Esc 


2. vi 문자열 치환을 이용해서 # 추가


10~20 줄까지 주석

:10, 20s/^/#/g

10~20 줄까지 주석 지우기

:10, 20s/^#//g 


3. here document 사용하기


<<COMMECT_END 

comment 1

comment 2

comment 3

...

COMMECT_END


출처 : http://forum.falinux.com/zbxe/index.php?document_srl=785985&mid=lecture_tip

+ Recent posts