暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

linux学习笔记

浪迹星辰 2022-12-09
727

更新apt的下载源

# apt-get update
# apt-get upgrade
1.sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
 
2.sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list
 
3.sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list
 
然后更新
apt update && apt upgrade

开启SSH服务

pkg install openssh
sshd
#查看IP,用户名,设置ssh密码,端口8022
ifconfig
whoami
passwd
#自动开启ssh
echo "sshd" >> ~/.bashrc
#申请存储卡权限
termux-setup-storage

安装依赖

pkg install proot git python -y
 
如果出错
(wrong sources.list URL?)
可使用下面命令解决
apt purge game-repo -y

安装Linux

pkg install proot-distro 
proot-distro install ubuntu
#启动Linux
proot-distro login ubuntu
#开机启动
cd ~/Termux-Linux/Ubuntu
./start-ubuntu.sh


缺少编译环境


apt-get update 
apt-get install sudo
apt-get install wget

apt install rust build-essential binutils cmake
#证书过期
git config http.sslVerify "false"
git config --global http.sslVerify "false"

阿里云动态解析

#安装python
apt-get install python3
wget -O caijin.py https://bootstrap.pypa.io/get-pip.py
python3 caijin.py 
apt-get install python3-pip
#安装包
pip install aliyun-python-sdk-core-v3
pip install aliyun-python-sdk-domain
pip install aliyun-python-sdk-alidns
pip install requests
#创建脚本
cd ~
touch dailyReport.py && chmod +x dailyReport.py && touch dailyReport.log

linux访问手机内存

cd /storage/emulated/0/

使用crontab进行定时任务

#安装周期执行工具
apt-get install cron
#防止设备休眠
termux-wake-lock
#开启crond
service cron start
#添加定时任务
crontab -e
#每天凌晨两点半开始运行命令python dailyReport.py >> dailyReport.log
30 2 * * * python3 ~/aliddns.py >> ~/dailyReport.log


termux学习链接:https://x-item.com/tag/termux

ipv6动态解析:https://blog.zeruns.tech/archives/507.html


文章转载自浪迹星辰,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论