ssh -N -L 3307:127.0.0.1:3306 <username>@<ssh-server-ip>
로컬 연결만 가능하도록 127.0.0.1 로 binding 된 MySQL 서버에 원격에서 접속하고 싶을 때, 해당 서버에 ssh 권한이 있다면 위의 명령을 통해 ssh 터널을 구성한 후 원격에서 3307로 접속하면 된다.
ssh -N -L 3307:127.0.0.1:3306 <username>@<ssh-server-ip>
로컬 연결만 가능하도록 127.0.0.1 로 binding 된 MySQL 서버에 원격에서 접속하고 싶을 때, 해당 서버에 ssh 권한이 있다면 위의 명령을 통해 ssh 터널을 구성한 후 원격에서 3307로 접속하면 된다.
ssh 서버 A를 거쳐 ssh 서버 B를 접속하고 싶다면 다음과 같이 ~/.ssh/config에 ProxyJump 를 쓰면 ssh b.dasomoli.org 명령으로 바로 접근하는 것처럼 쓸 수 있다.
Host a.dasomoli.org 11.22.33.44
Hostname 11.22.33.44
User dasomoli
IdentityFile ~/.ssh/a.dasomoli.org.pem
Host b.dasomoli.org 11.22.33.55
Hostname 11.22.33.55
User dasomoli
IdentityFile ~/.ssh/b.dasomoli.org.pem
ProxyJump dasomoli@a.dasomoli.org
~/.ssh/config 파일 안에 hostname을 지정한다면, 그 뒤에 IP 주소를 함께 지정하면 hostname이나 IP 둘 중 어느 하나로 접속해도 같은 설정이 적용된다. 항목을 여러개 만들 필요 없다. 공백으로 구분하면 다 같이 적용된다. 예를 들면 다음과 같다.
Host nas.dasomoli.org 112.145.250.152 192.168.0.204
HostName nas.dasomoli.org
User dasomoli
Port 2048
IdentityFile ~/.ssh/id_rsa_dasomoli_nas
1. OpenSSL을 이용한 랜덤 암호 생성
openssl rand -base64 16
2. pwgen 패키지 사용 (설치 필요)
brew install pwgen # 먼저 설치
pwgen -s 16 1
3. LC_ALL=C tr을 이용한 무작위 문자열 생성
LC_ALL=C tr -dc 'A-Za-z0-9!@#$%^&*()-_+=' < /dev/urandom | head -c 16
4. uuidgen을 활용한 암호 생성
uuidgen | tr -d '-' | head -c 16
파인더에서 다음 단축키를 누른다.
Command (⌘) + Shift (⇧) + . (마침표)
영구적으로 적용하고 싶다면 다음을 실행한다.
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
다시 되돌리고 싶다면 다음을 실행한다.
defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder
execution layer client로 geth를, consensus layer client로 Prysm을 사용한다.
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update
sudo apt install -y geth
확인
geth version
sudo vi /etc/systemd/system/geth.service
[Unit]
Description=Ethereum Geth Node
After=network.target
[Service]
Type=simple
User=dasomoli
ExecStart=/usr/bin/geth --mainnet --syncmode "snap" --datadir "/home/dasomoli/geth/data" --http --http.api web3,eth,txpool --http.addr 0.0.0.0
Restart=always
RestartSec=5
LimitNOFILE=8192
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start geth
sudo systemctl enable geth
sudo systemctl status geth
위에서는 “snap” 방식을 사용했다. sync mode로 “full”도 가능.
도메인을 연결한다면 설정에 다음 설정을 포함해야 한다.
--http.corsdomain "*" \
--http.vhosts "*"
IPC로 geth console 연결
geth attach ipc:/home/dasomoli/geth/data/geth.ipc
로그 확인
journalctl -u geth -f
mkdir prysm
cd prysm/
sudo apt update
sudo apt install -y wget
wget <https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh>
chmod +x prysm.sh
sudo vi /etc/systemd/system/prysm-beacon.service
[Unit]
Description=Prysm Beacon Chain Client
After=network.target
[Service]
Type=simple
User=dasomoli
ExecStart=/home/dasomoli/prysm/prysm.sh beacon-chain \
--execution-endpoint=http://localhost:8551 \
--datadir=/home/dasomoli/prysm/data \
--jwt-secret=/home/dasomoli/geth/data/geth/jwtsecret \
--accept-terms-of-use \
--mainnet \
--checkpoint-sync-url=https://beaconstate.info --genesis-beacon-api-url=https://beaconstate.info
Restart=always
RestartSec=5
LimitNOFILE=8192
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start prysm-beacon
sudo systemctl enable prysm-beacon
sudo systemctl status prysm-beacon
로그 확인
journalctl -u prysm-beacon -f
git push 를 했을 때, 내용이 많은 경우 다음과 같은 에러가 날 때가 있다.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
send-pack: unexpected disconnect while reading sideband packet
이 경우, http.postBuffer를 다음과 같이 늘려준다. 아래는 150MB.
git config --global http.postBuffer 157286400
아래와 같이 랜덤하게 키를 생성한다.
openssl rand -base64 64
apt-get install -y fonts-nanum
fc-cache -fv
rm ~/.cache/matplotlib -rf
혹은 Windows에서는
from matplotlib import font_manager, rc
font_path = 'C:/Windows/Fonts/NGULIM.TTF'
font = font_manager.FontProperties(fname=font_path).get_name()
rc('font', family=font)