|
프로젝트 파일들 안에 CRLF 를 사용하는 파일과 LF 를 사용하는 파일이 혼재 되어 있을때…
git을 사용한다면…
lf 로만 처리를 하고 싶다면…
|
git config core.autocrlf false git rm --cached -r . git reset --hard |
P.S. 이 처리 이후에 git이 연결이 안되는 상황이 발생했다. 근데 다시 해보니까 잘된다..
|
command 2>&1 | tee "./result/$(date +%Y%m%d_%H%M%S).log” |
보통은 터미널에서 python main.py를 실행시키면 터미널을 닫으면서 프로그램이 끝나지만 nohub을 사용하고 백그라운드로 돌아가라고 하는 & 를 붙이면 터미널을 종료시켜도 주구장창 돈다.
다만 다음에 다시 접속해서 프로세스를 종료시키려면 ps -ef 명령으로 찾아서 kill 해야만 한다.
|
ssh -v -N -L localhost:8080:localhost:8080 -L localhost:8081:localhost:8081 id@remote.anyons.net |
localhost (앞쪽) : binding 할 현재 컴퓨터의 8080 포트 localhost (뒤쪽) : 리모트 의 binding 가능한 8080 포트 id@remote.anyons.net : ssh로 접속할 server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
COLOR magenta { # matches the date ^(... ..).*$ } COLOR cyan { # matches the time ^... .. (..:..:..).*$ # matches the word INFO ^.*(INFO|info).*$ } COLOR green { # matches the hostname ^... .. ..:..:.. ([^ ]+).*$ } COLOR yellow { # matches the "program" that wrote to syslog ^... .. ..:..:.. [^ ]+ ([^ ]+) } COLOR brightyellow { # matches all ip adresses ^.*([0-9]{3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ ^.*([0-9]{2}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ ^.*([0-9]{1}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ # matches two ip adresses in one line ^.*([0-9]{3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*([0-9]{3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ ^.*([0-9]{2}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*([0-9]{2}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ ^.*([0-9]{1}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*([0-9]{1}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}){1}([:][0-9][0-9][0-9][0-9][0-9]?).*$ # matches the word WARNING ^.*(WARNING|warning|WARN).*$ } COLOR brightred { # matches the word root ^.*(root).*$ # matches DENY ^.*(ppp-in DENY ppp0).*$ ^.*(eth-in DENY eth0).*$ # matches the word ERROR ^(ERROR|error|err).*$ ^.*(ERROR|error|err).*$ } COLOR brightblue { # matches the output from the "program" ^... .. ..:..:.. [^ ]+ [^ ]+ (.*) # matches the time ^.*([0-9]{2}:[0-9]{2}:[0-9]{2}).*$ } |
client에서 할일
~/.ssh/id_rsa.pub 공개키 생성되면 접속할 서버에 ./ssh/authorized_keys 파일 안에 복사 해 넣는다.
관리자 권한으로 /etc/sudoers.d/init-users 파일 생성하여 다음과 같이 작성
|
# User rules for id id ALL=(ALL) NOPASSWD:ALL |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# Install Dependencies # ----------------------------------------------------------------------------------------------------------- # Build requirements: sudo apt install git build-essential libtool autotools-dev autoconf automake pkg-config bsdmainutils python3 libssl-dev libssl-dev # Install required dependencies sudo apt install libevent-dev libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev # Install the BerkeleyDB from Ubuntu repositories: sudo apt install libdb-dev libdb++-dev libsqlite3-dev # Optional: upnpc sudo apt install libminiupnpc-dev # Optional ZMQ: sudo apt install libzmq3-dev # For GUI: sudo apt install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler # For QR Code support sudo apt install libqrencode-dev # Install Bitcoin # ----------------------------------------------------------------------------------------------------------- git clone https://github.com/bitcoin/bitcoin.git # Move into project directory cd bitcoin # Config # ----------------------------------------------------------------------------------------------------------- # Generate config script ./autogen.sh # If debugging symbols not required, amend compile flags: ./configure --with-incompatible-bdb CXXFLAGS="-O2" # ...lot's of checking... # Make # ----------------------------------------------------------------------------------------------------------- make # Install - sudo is required to install binaries in /usr/local/bin sudo make install |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
upstream myserver { # 기본 round robin server localhost:3000; server localhost:3001; } server { listen 8080; listen [::]:8080; # server_name xxx.anyons.net; root /nodejsPath; location / { allow 192.168.1.0/24; deny all; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. # try_files $uri $uri/ =404; try_files $uri @myserver; } location @myserver { proxy_redirect off; proxy_http_version 1.1; proxy_pass http://myserver; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; # proxy_redirect http://myserver http://$server_name; } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
apt install build-essential apt install net-tools apt install openssh-server systemctl enable ssh systemctl restart ssh apt install curl apt install tmux apt install mc apt install git apt install zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" chsh -s /usr/bin/zsh # logout 필요 zsh # 일단 한번 실행 git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting vi .zshrc d2coding 설치 apt install neovim curl -sLf https://spacevim.org/install.sh | bash vi vi init.vim vi init.toml curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim vi # 실행후 :PlugInstall cd ./vim/bundle/vimproc.vim make apt install nodejs apt install npm npm install jshint |
.zshrc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
# Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, # to know which specific one was loaded, run: echo $RANDOM_THEME # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes ZSH_THEME="agnoster" # Uncomment the following line if you want to change the command execution time # stamp shown in the history command output. # You can set one of the optional three formats: # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" # or set a custom format using the strftime function format specifications, # see 'man strftime' for details. # HIST_STAMPS="mm/dd/yyyy" export HISTSIZE=10000 export SAVEHIST=10000 setopt EXTENDED_HISTORY # Which plugins would you like to load? # Standard plugins can be found in $ZSH/plugins/ # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. plugins=( git zsh-syntax-highlighting zsh-autosuggestions tmux colored-man-pages colorize svn ) |
./.SpaceVim/init.vim
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
"============================================================================= " init.vim --- Entry file for neovim " Copyright (c) 2016-2020 Wang Shidong & Contributors " Author: Wang Shidong < wsdjeg@outlook.com > " URL: https://spacevim.org " License: GPLv3 "============================================================================= call plug#begin("~/.vim/plugged") Plug 'vim-airline/vim-airline' " vim status bar Plug 'airblade/vim-gitgutter' " Show git status in vim Plug 'iamcco/markdown-preview.nvim' call plug#end() execute 'source' fnamemodify(expand('<sfile>'), ':h').'/main.vim' filetype plugin on set vb set nu set nuw=5 " 줄 번호 표시 너비 set backspace=eol,start,indent " 편집 기능 설정 set sol set sm " 검색 기능 설정 set hlsearch set ignorecase set showmatch " indent 설정 set cindent set autoindent set smartindent set tabstop=4 set shiftwidth=4 set softtabstop=4 set noet " 탭 -> 공백 변환기능 no " Turn off swap set noswapfile set nobackup set nowb set whichwrap+=<,>,h,l,[,] |
./.SpaceVim.d/init.toml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#============================================================================= # basic.toml --- basic configuration example for SpaceVim # Copyright (c) 2016-2020 Wang Shidong & Contributors # Author: Wang Shidong < wsdjeg at 163.com > # URL: https://spacevim.org # License: GPLv3 #============================================================================= # All SpaceVim option below [option] section [options] # set spacevim theme. by default colorscheme layer is not loaded, # if you want to use more colorscheme, please load the colorscheme # layer colorscheme = "onedark" colorscheme_bg = "dark" # Disable guicolors in basic mode, many terminal do not support 24bit # true colors enable_guicolors = false # Disable statusline separator, if you want to use other value, please # install nerd fonts statusline_separator = "nil" statusline_iseparator = "bar" buffer_index_type = 4 windows_index_type = 3 enable_tabline_filetype_icon = false enable_statusline_mode = false statusline_unicode_symbols = false # Enable vim compatible mode, avoid changing origin vim key bindings vimcompatible = true # Enable autocomplete layer [[layers]] name = 'autocomplete' auto_completion_return_key_behavior = "complete" auto_completion_tab_key_behavior = "cycle" [[layers]] name = 'shell' default_position = 'top' default_height = 30 |
|
|