2021. 11. 28. 20:44ㆍOS
- Termux 설치
https://m.blog.daum.net/kyoud2/15837534
[Termux 앱을 이용해 안드로이드를 스마트 서버로 사용하기]
지난 프로젝트가 x86 아키텍처 기반의 컴퓨터에 안드로이드를 설치하는 과정이었다면 이번 프로젝트는 보다 실용적인 목적을 가지고 있습니다. 이번 단원에서는 구형 안드로이드 기기이든, x86
blog.daum.net
- 백그라운드에서 계속 작동하도록 설정
https://m.blog.naver.com/aurum95/222591243522
갤럭시 백그라운드 앱 유지하는 방법 (실행 허용)
안드로이드 9.0 이상에서 백그라운드에서 실행중이던 앱이 멈추거나 종료된다면 아래의 설정을 확인해 보시...
blog.naver.com
설정 > 일반 > 배터리 > 절전 기능 예외 앱
- 시간 설정
핸드폰의 시간을 따라감
export TZ=Asia/Seoul
- SSH Server 설치
pkg install openssh -y
# 403 Forbidden 에러 발생
pkg remove game-repo -y
pkg remove science-repo -y
pkg update -y
pkg upgrade -y
# Enter 3번
pkg install openssh -y
sshd
에러: sshd: no hostkeys available -- exiting.
https://typingdog.tistory.com/101
[Error] sshd: no hostkeys available -- exiting.
sshd: no hostkeys available -- exiting. Ubuntu 20.04 에서 SSH 서비스를 실행시킬 때, 위와 같은 에러가 뜰 경우, 해결 방법이다. sudo ssh-keygen -A
typingdog.tistory.com
ssh-keygen -A
- 원격 PC에서 접속
# IP 확인 및 비밀번호 셋팅
whoami
passwd
비밀번호 입력, 확인
ip addr
# ip addr 작동 안하는 경우
pkg install iproute2
# 원격PC에서 접속
ssh 계정@IP -p 8022
# Host key verification failed.
#원격 PC 계정 디렉토리/.ssh/ 디렉토리 아래 파일 삭제
ssh 계정@IP -p 8022
yes
# 비밀번호 입력
- 파일 공유를 위한 storage 셋팅
# 접근권한 설정 : 설정 > 애플리케이션 > Termux 선택 > 권한 > 저장공간 부여
# 핸드폰에서 직접 명령을 수행해야 함(ssh로 원격에서 접속하면 안됨)
termux-setup-storage
ls
cd storage
ls -alt
# /storage/emulated/0이 핸드폰에서 보는 루트임
- vi 설치
pkg install x11-repo
pkg install vim-gtk
# vim-gtk 설치시 에러 발생시, 아래 내용 수행
apt-get upddate
pkg install vim-gtk --fix-missing
- ubuntu 설치
원격으로는 설치 안됨
cd ~
git clone https://github.com/MFDGaming/ubuntu-in-termux.git
cd ubuntu-in-termux
chmod +x ubuntu.sh
./ubuntu.sh -y
./startubuntu.sh
- unbuntu에서 xmrig 셋팅
apt update
apt upgrade
apt install git
apt install wget
apt install proot
apt-get install git build-essential cmake libuv1-dev libmicrohttpd-dev libssl-dev
git clone https://github.com/xmrig/xmrigcd xmrig
mkdir build
cd build
cmake -DWITH_HWLOC=OFF ..
make
- sudo 설치
# 아래 3개는 필요한 경우만 하면 됨
pkg install root-repo
pkg install unstable-repo
pkg install x11-repo
pkg install tsu
- Alpine 설치
참조 : https://github.com/Hax4us/TermuxAlpine
GitHub - Hax4us/TermuxAlpine: Use TermuxAlpine.sh calling to install Alpine Linux in Termux on Android. This setup script will a
Use TermuxAlpine.sh calling to install Alpine Linux in Termux on Android. This setup script will attempt to set Alpine Linux up in your Termux environment. - GitHub - Hax4us/TermuxAlpine: Use Termu...
github.com
cd ~
git clone https://github.com/Hax4us/TermuxAlpine.git
GitHub - Hax4us/TermuxAlpine: Use TermuxAlpine.sh calling to install Alpine Linux in Termux on Android. This setup script will a
Use TermuxAlpine.sh calling to install Alpine Linux in Termux on Android. This setup script will attempt to set Alpine Linux up in your Termux environment. - GitHub - Hax4us/TermuxAlpine: Use Termu...
github.com
cd TermuxAlpine
chmod 755 TermuxAlpine.sh
./TermuxAlpine.sh
startalpine
apk update
apk upgrade
# 기본 설치(실패)
apk add git make cmake libstdc++ gcc g++ libuv-dev openssl-dev hwloc-dev
git clone https://github.com/xmrig/xmrig
cd xmrig
mkdir build
cd build
cmake ..
make
# Advanced 설치(실패)
apk add git make cmake libstdc++ gcc g++ automake libtool autoconf linux-headers
cd ../scripts
chmod 755 build_deps.sh
./build_deps.sh
cd ../build
cmake .. -DXMRIG_DEPS=scripts/deps -DBUILD_STATIC=ON
make -j$(proc)
# java 설치
apk add openjdk8
cp /storage/0/Downloads/*.jar ./
java -jar *.jar
- Debian 설치
https://github.com/wahasa/Debian
GitHub - wahasa/Debian: Welcome To Debian Termux For Android
Welcome To Debian Termux For Android. Contribute to wahasa/Debian development by creating an account on GitHub.
github.com
사전조건: pkg updage & pkg upgrade
# 스크립트 다운로드
pkg install wget -y ; wget https://raw.githubusercontent.com/wahasa/Debian/main/install.sh ; chmod +x install.sh ; ./install.sh
# Debian13 버전 설치
Install Debian13
# Debian 실행
debian
# 필요한 경우만, 삭제
rm -rf debian-fs
참고 : https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=sky930425&logNo=221562017606
[JAVA] JAVA로 웹 크롤링하기
지금 사용하는 언어가 주로 파이썬이다 보니, 웹 크롤링이라고 하면 아무래도 파이썬으로 코딩하는 프로세...
blog.naver.com
# 에러 : epository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
https://zetawiki.com/wiki/Changed_its_%27Suite%27_value_from_%27stable%27_to_%27oldstable%27
Changed its 'Suite' value from 'stable' to 'oldstable' - 제타위키
다음 문자열 포함...
zetawiki.com
- java 설치
https://www.youtube.com/watch?v=QNvGCPLovWU
사전조건 : 업데이트, 업그레이드
pkg install openjdk-17 -y
java --version
패키지 목록 확인
pkg list-all
- DNS 정보 변경
직접 파일을 수정하는 것은 불가능함
루팅을 통해서 root 권한을 얻어도 불가능함
https://www.youtube.com/watch?v=JDeFl4J_GZo
DNS Changer라는 툴을 사용하는 방법이 있음
WiFi인 경우, 아래와 같이 작업하면 됨 : 적용되는데 시간이 좀 걸림
설정 > 연결 > Wi-Fi
연결된 네트워크 선택 > 고급 > 고정
DNS정보 변경
- 다른 Session으로 이동
https://github.com/termux/termux-app/issues/106
How to switch between sessions via keyboard shortcut? · Issue #106 · termux/termux-app
Is it possible to switch to next and previous session/tab via ctrl+tab and ctrl+shift+tab respectively? Or is there already some shortcut to do with this?
github.com
Ctrl + Alt + N : 새로운 세션
Ctrl + Alt + P : 이전 세션
- 일시정지된 프로세스 돌아가기
https://codeheart.tistory.com/72
linux - ctrl+z 로 일시정지된 프로세스 돌아가기
ctrl+z 의 기능은 해당 프로세스를 일시 정지하는 것이다. 일시정지된 프로세스를 보는 방법 >> jobs 일시정지된 프로세스를 foreground 로 돌리는 방 >> fg 일시정지된 프로세스를 background 로 돌리는
codeheart.tistory.com
ctrl+z로 해당 프로세스 일시 정지됨
ctrl+z
[1]+ Stopped
job 목록 확인
jobs
일시 정지된 프로세스로 돌아가기
fg
- 환경변수 설정
직접 설정 : 1회성
export TZ="Asia/Seoul"
환경변수설정 파일에 적용 : 지속
~/.bashrc
export TZ="Asia/Seoul"
- 사용하려는 명령어 검색
pkg install apt-file
apt-file update
apt-file showmount
- on7prime
루팅도 어렵고, 네트워크 관련해서 제약이 있어서 적요을 못함(제일 거지 같음)
cifs, nfs 적용 안됨
핸드폰 디렉토리 파일 접근하기
storage > shared로 접속하면 됨
cd storage
pkg install c-script
cd shared
- DNS Server 설정
DNS Servrer 설치 안됨
# 필요한 프로그램 설치
pkg install bind bind-util -y
Unable to locate package bind
Unable to locate package bind-util
Debian 설치(실패): Debian 설치 참조
아래 ubuntu 내용을 참고했을 때, Debian도 dnsmasq 잘 될 것으로 예상됨(bind9는 모르겠음)
bind9을 설치해야 함
Bind9 - Debian Wiki
Translation(s): English - French Introduction Putting a DNS server on a network allows for the replacement of IP addresses of individual machines by a name. As a result, it's even possible to associate multiple names to the same machine to update the diffe
wiki.debian.org
# 사전 필요한 프로그램 설치
# vi 설치
apt install vim
# nslookup 설치
apt install dnsutils
# curl 설치
apt install curl
# netstat 설치
apt install net-tools
# 설치
apt install bind9
# 설정
cd /etc/bind
Ubuntu 설치
위에 있는 ubuntu-in-termux는 'ps -ef'이 작동안하기 때문에 사용 안함
https://github.com/termux/proot-distro
GitHub - termux/proot-distro: An utility for managing installations of the Linux distributions in Termux.
An utility for managing installations of the Linux distributions in Termux. - GitHub - termux/proot-distro: An utility for managing installations of the Linux distributions in Termux.
github.com
# 설치
pkg install proot-distro
proot-distro ubuntu
# 실행
proot-distro login ubuntu
dnsmasq 설치
외부에서 접근하기 위해서는 interface를 외부와 통하는 것으로 잡아줘야 접속이 가능함
핸드폰을 rooting하지 않는 이상 53 port 사용 못함(해당 폰이 거지 같아서 rooting 안되서 패스)
# 설치
apt install dnsmasq
# 환경설정
cd ~
vi dnsmasq.conf
----------------------
# 무선랜 사용
interface=wlan0
# 53 port는 이미 사용중임
port=5353
----------------------
확인: 윈도우 nslookup은 거지 같아서 포트 변경이 안됨(변경해도 wireshark로 보면 53 port로 나감)
DNS에 'dnsmasq가 설치된 서버 IP'를 등록한 경우, IP정보는 별도로 기술할 필요 없음
nslookup -port=5555 abc 'dnsmasq가 설치된 서버 IP'
nslookup
> set port=5555
> abc 'dnsmasq가 설치된 서버 IP'
'OS' 카테고리의 다른 글
핸드폰 루팅 (0) | 2021.12.11 |
---|---|
Alpine 명령어 (0) | 2021.12.11 |
Centos 명령어 (0) | 2021.12.11 |
Alpine 설치 (0) | 2021.12.11 |
wifi 연결 (0) | 2021.06.27 |