✅ 1. 내부 IP (로컬 IP) 확인
터미널에서 다음 명령어 입력:
ip addr show
혹은 간단하게
ip a
인터페이스 별로 확인하려면:
ip -4 addr show eth0
✅ 2. 외부 IP (공인 IP) 확인
외부 서버에 요청해서 확인:
curl ifconfig.me
또는
curl ipinfo.io/ip
터미널에서 다음 명령어 입력:
ip addr show
혹은 간단하게
ip a
인터페이스 별로 확인하려면:
ip -4 addr show eth0
외부 서버에 요청해서 확인:
curl ifconfig.me
또는
curl ipinfo.io/ip
hostname 또는 cat /etc/hostname 을 입력하면 기존 호스트네임을 볼 수 있다. 새로 셋팅하고 싶다면 다음과 같이 한다.
sudo hostnamectl set-hostname my-new-hostname
그리고 빼먹기 쉬운 게 /etc/hosts 이다.
sudo vi /etc/hosts
127.0.0.1 localhost
127.0.1.1 my-old-hostname # 기존 호스트네임
이전 호스트 네임 부분을 새 호스트 네임으로 바꿔준다.
127.0.0.1 localhost
127.0.1.1 my-new-hostname
이제 reboot 해주자.
sudo reboot
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
Unattended Upgrade 설치
sudo apt update
sudo apt install unattended-upgrades
자동 업데이트 활성화
sudo dpkg-reconfigure --priority=low unattended-upgrades
설정 파일 편집: sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
Unattended-Upgrade::Allowed-Origins {
"Ubuntu stable";
"Ubuntu ${distro_codename}-security";
"Ubuntu ${distro_codename}-updates";
};
업데이트 주기 설정: sudo vi /etc/apt/apt.conf.d/20auto-upgrades
다음은 패키지 목록 업데이트 간격(1 = 매일), 자동 업데이트 실행 간격 (1 = 매일)
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
로그는 다음에서 확인 가능
less /var/log/unattended-upgrades/unattended-upgrades.log
자동 재부팅 설정: sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
다음은 새벽 2시에 자동 리부팅.
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
sudo apt-get install alien
근데, i386용 패키지라고 64비트에서 안될 때가 있는데, 다음 과정을 거치면 될 수도 있다.
sudo alien –to-tgz <rpm filename>
sudo alien –to-deb <tgz filename>
http://unetbootin.sourceforge.net/ 에서 unetbootin 을 다운받는다.
우분투 설치 ISO 파일을 http://www.ubuntu.com/getubuntu/download 에서 다운로드받는다.
미러를 통해 다운로드받는 것이 빠르다.
USB를 꽂고, unetbootin 을 실행시킨 후 Disk image의 ISO 에 다운로드 받은 ISO를 선택한 후 OK를 누른다.
1~4까지 진행된 후 뽑아서 쓰면 된다.
윈도우즈가 깨진 노트북에서 외장하드로 파일 복사(데이터 백업)가 필요해서 사용했다.
전 창을 이리저리 많이 움직이는 편입니다.
근데 자꾸만 창이 스크린 위아래로 들러붙어서 움직이기 힘들더라구요.
그래서 이게 뭐때문인가 하고 Visual Effect 플러그인들을 찾아보았습니다.
결론은 아래 것 때문이더군요..

꺼주시면 창이 위아래에 띵띵~ 붙어서 늘어나는 등이 되지 않습니다. 흐흐
오랜만에 iptables 설정을 하려니 어떻게 했었는지 하나도 기억이 안나더군요.
기억나는건 iptables -L 하나…;;;
할 때만 기억했다가 또 까먹고 또 까먹고.. 이 놈의 돌대가리..;;
암튼 그래서 검색을 해보니 우분투의 community 도움말에 설정 관련 글(https://help.ubuntu.com/community/IptablesHowTo)이 있네요~
참 편리하게 잘 만들어놨네요^^
1. Establicshed 세션 허용
$ sudo iptables -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
2. 특정 포트 허용
$ sudo iptables -A INPUT -p tcp –dport <포트 번호> -j ACCEPT
<포트 번호> 는 135:139 형식으로 범위를 조절할 수 있다.
3. 그 외 모두 막기
sudo iptables -A INPUT -j DROP
4. 현재 iptables 설정 파일로 저장하기
$ sudo sh -c “iptables-save > /etc/iptables.rules”
5. iptables 설정 파일로 부팅 시에 재설정하기
$ sudo vi /etc/network/interfaces
p.s : 본문의 etc 는 /etc 로 해주셔야 합니다. > 나 < 이후에 / 가 붙지 않는 버그가 텍스트큐브에 있는 듯 합니다. -> 티스토리로 이전 후 수정되었습니다.auto eth0
iface eth0 inet dhcp
pre-up iptables-restore < /etc/iptables.rules
post-down iptables-save -c > /etc/iptables.rules
예제)
1. 특정 IP 대역만 허용
우분투 8.04에서 Eclipse 사용 시 다음과 같은 메시지가 뜬다면!
Could not initialize the application’s security component. The most
likely cause is problems with files in your application’s profile
directory. Please check that this directory has no read/write
restrictions and your hard disk is not full or close to full. It is
recommended that you exit the application and fix the problem. If you
continue to use this session, you might see incorrect application
behaviour when accessing security features.
$HOME/.mozilla/eclipse 폴더를 수동으로 만들어 주시면 됩니다.
출처 : https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/188380