https://github.com/ethereumbook/ethereumbook 에서 최신판을 볼 수 있다.
현재 판매되는 서적은 이전 내용을 담고 있다.
https://github.com/ethereumbook/ethereumbook 에서 최신판을 볼 수 있다.
현재 판매되는 서적은 이전 내용을 담고 있다.
KVM 사용 시 Bridge mode로 GuestOS에 네트워크 셋팅을 해도 동작을 안하는 경우가 있다. 게이트웨이나 DNS로 ping조차 안가는데, docker 와 함께 사용 시 문제가 발생한다.
docker가 iptables 의 FORWARD chain의 정책을 DROP으로 해버리기 때문이다.
oot@justiny-desktop:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy DROP)
target prot opt source destination
DOCKER-USER all -- anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain DOCKER (1 references)
target prot opt source destination
Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all -- anywhere anywhere
RETURN all -- anywhere anywhere
Chain DOCKER-USER (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere
다음처럼 해주면 잘된다.
# iptables -A FORWARD -i br0 -o br0 -j ACCEPT
~/.bashrc 에 다음을 추가.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
# PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\]$ "
public project를 가져와서 혼자 몰래 뭘 해보고 싶을 때, Apache 2.0 License 등 derived works의 source code 공개 의무가 없는 프로젝트의 경우 private으로 바꿔서 작업을 해볼 수 있다.
다음과 같이 한다.
먼저 만들고 싶은 이름으로 github에서 project를 하나 private으로 만든다.
$ git clone --bare https://github.com/publicproject/project.git
$ cd project.git
$ git push --mirror https://github.com/myname/myproject.git
그리고 나서 실제로 clone해서 쓰면 된다.
$ git push https://github.com/myname/myproject.git
최신 코드로의 업데이트는 public repository를 여기다 remote로 추가해서 fetch & rebase하면 된다.
push는 public으로 fork해온 후 거기다 push 해서 pull request하면 될 듯.
참고: https://medium.com/@bilalbayasut/github-how-to-make-a-fork-of-public-repository-private-6ee8cacaf9d3
ssh 접속할 때마다 password 치기가 귀찮다…
클라이언트에서 키 생성
$ ssh-keygen -t rsa -N '' -q -f ~/.ssh/id_rsa
접속하려는 서버로 공개키 복사.
$ ssh-copy-id <account>@<server hostname>
위의 복사는 아래와 같은 동등하다. 위 명령을 했다면 아래를 할 필요는 없음.
$ scp ~/.ssh/id_rsa.pub <account>@<server hostname>:.ssh/authorized_keys
%localappdata%\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows어쩌고저쩌고\LocalState\rootfs\
예를 들어, C:\Users\dasom\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\rootfs
\\wsl$
를 입력하면 배포판이 보인다.
\\wsl$\Ubuntu-20.04
Xming 같은 Xserver를 사용해서 WSL로 설치한 Ubuntu 등에서 GUI 를 사용할 수 있다.
WSL로 설치한 항목은 다음으로 확인 가능하다.
wsl -l -v
여기서 WSL Version이 1인 것을 다음과 같이 2로 바꿀 수 있다. 예제로 Ubuntu-20.04
를 바꾸고 싶다면 다음과 같이 하면 된다.
wsl --set-version Ubuntu-20.04 2
명령 프롬프트에서 다음을 실행한다.
ubuntu config --default-user new_dasomoli
아래 글이 매우 정리가 잘 되어 있다.
Ubuntu 리눅스에서 go의 여러 버전을 심볼릭 링크로 사용할 때 update-alternatives로 셋팅해서 사용하자.
# update-alternatives --install /usr/local/go go /usr/local/go1.17.2 1
update-alternatives: using /usr/local/go1.17.2 to provide /usr/local/go (go) in auto mode
# update-alternatives --install /usr/local/go go /usr/local/go1.16.8 2
update-alternatives: using /usr/local/go1.16.8 to provide /usr/local/go (go) in auto mode
# update-alternatives --install /usr/local/go go /usr/local/go1.14.15 3
update-alternatives: using /usr/local/go1.14.15 to provide /usr/local/go (go) in auto mode
# update-alternatives --config go
대체 항목 go에 대해 (/usr/local/go 제공) 3개 선택이 있습니다.
선택 경로 우선순� 상태
------------------------------------------------------------
* 0 /usr/local/go1.14.15 3 자동 모드
1 /usr/local/go1.14.15 3 수동 모드
2 /usr/local/go1.16.8 2 수동 모드
3 /usr/local/go1.17.2 1 수동 모드
현재 선택[*]을 유지하려면 <엔터>를 누르고, 아니면 선택 번호를 입력하시오:
#
git remote branch를 삭제하고 싶을 때.
$ git push --delete origin new_ko_KR_translation
실행 중인 docker process (machine) 보기
docker ps
실행 중 + 실행 중이 아닌 docker process 보기
docker ps -a
docker 이미지 보기
docker images
docker process 삭제
docker rm -rf [container name]
docker 이미지 삭제
docker rmi [image name]
docker 이미지 가져오기
docker pull [image name]
docker process 시작
docker start [container name]
docker process 중지
docker stop [container name]
실행 중인 모든 컨테이너 강제 종료
docker kill $(docker ps -q -f status=running)
실행 중인 모든 컨테이너 중지
docker stop $(docker ps -q -f status=running)
종료된 모든 컨테이너 삭제
docker rm $(docker ps -q -f status=exited)
시스템 상의 모든 이미지 삭제
docker image rm -f $(docker image ls -q)
docker 로그 보기
docker logs [container name]
docker network 삭제
docker network prune -f
alias해서 간편히 사용하기
alias dockerkill='docker kill $(docker ps -q -f status=running)'
alias dockerstop='docker stop $(docker ps -q -f status=running)'
alias dockerrm='docker rm $(docker ps -q -f status=exited)'
alias dockerimgrm='docker image rm -f $(docker image ls -q)'
alias dockernetprune='docker network prune -f'
docker cli 실행
$ docker exec -it cli /bin/bash
키보드 길게 눌렀을 때 반복되지 않고 특수문자가 나타날 경우 아래 명령을 실행한다.
defaults write -g ApplePressAndHoldEnabled -bool false