网站首页 > 开源技术 正文
一、设置ll
vim ~/.bashrc
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi
source ~/.bashrc
二、更改端口
1. 编辑配置
vim /etc/ssh/sshd_config
2. 设置参数
Port 8022
PermitRootLogin yes
3. 重启服务
systemctl restart ssh
4. 设置root密码
passwd root
passwd123
三、修改数据源(清华大学)
网站
cp /etc/apt/sources.list /etc/apt/sources.list.bak
vim /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
apt-get update && apt-get upgrade -y
四、配置固定IP
nmcli -p connection show
nmcli con mod "Wired connection 1" ipv4.addresses 192.168.1.100/24 ipv4.method manual
nmcli con mod "Wired connection 1" ipv4.gateway 192.168.1.1
nmcli con mod "Wired connection 1" ipv4.dns "223.5.5.5,114.114.114.114,8.8.8.8"
nmcli con up "Wired connection 1"
hostname -I
五、自动更新外网ip
安装软件
apt-get install python3-pip python3-venv
1、阿里云
cd /usr/local/
mkdir aliyun_update_dns
cd aliyun_update_dns/
python3 -m venv aliyun
source aliyun/bin/activate
pip install aliyun-python-sdk-core
pip install aliyun-python-sdk-alidns
pip install requests
python -c "import requests; print(requests.__version__)"
vim update_dns.py
python update_dns.py
2、cloudflare
cd /usr/local/
mkdir cloudflare_update_dns
cd cloudflare_update_dns/
python3 -m venv cloudflare
source cloudflare/bin/activate
pip install requests cloudflare
python cloudflare-ddns.py
定时器
crontab -e
# */5 * * * * /usr/local/aliyun_update_dns/myenv/bin/python /usr/local/aliyun_update_dns/update_dns.py >> /usr/local/aliyun_update_dns/update_dns.log 2>&1
*/5 * * * * /usr/local/cloudflare_update_dns/cloudflare/bin/python /usr/local/cloudflare_update_dns/cloudflare-ddns.py
六、挂在硬盘
1. 临时挂载
apt install ntfs-3g samba samba-common-bin
mkdir /mnt/ntfs
mount -t ntfs-3g /dev/sda1 /mnt/ntfs
2. 获取磁盘信息
blkid
vim /etc/fstab
UUID=50CE4302CE42E038 /mnt/ntfs ntfs-3g defaults,nofail 0 0
3. 设置权限,重启服务
chmod -R 777 /mnt
systemctl restart samba
七、安装apparmor
apt install apparmor apparmor-utils
vim /boot/firmware/cmdline.txt
末尾添加
apparmor=1 security=apparmor systemd.unified_cgroup_hierarchy=false
八、安装JAVA
cd /usr/local/
wget https://download.oracle.com/java/17/archive/jdk-17.0.12_linux-aarch64_bin.tar.gz
tar -zxvf jdk-17.0.12_linux-aarch64_bin.tar.gz
vim /etc/profile
export JAVA_HOME=/usr/local/jdk-17.0.12
export PATH=$JAVA_HOME/bin:$PATH
source /etc/profile
java -version
九、安装ngixn
apt-get install nginx
vim /etc/nginx/nginx.conf
十、安装redis
1. 安装
apt-get install redis-server
2. 修改密码
vim /etc/redis/redis.conf
注释bind 127.0.0.1 -::1
requirepass passwd123
3. 重启服务
systemctl restart redis
systemctl enable redis
十一、安装postgresql
1. 安装
apt install postgresql postgresql-client
2. 修改密码
sudo -u postgres psql
ALTER USER postgres PASSWORD 'passwd123';
\q
3. 更改postgresql.conf权限
vim /etc/postgresql/15/main/postgresql.conf
listen_addresses = '*'
4. 更改pg_hba.conf权限
vim /etc/postgresql/15/main/pg_hba.conf
host all all 0.0.0.0/0 md5
5. 重启服务
systemctl restart postgresql
apt-get remove --purge postgresql-15
apt-get autoremove
apt-get update
apt-get install postgresql-15
十二、安装home-assistant
1. 停用ModemManager
systemctl stop ModemManager
systemctl disable ModemManager
2. 安装依赖
apt install apparmor bluez cifs-utils curl dbus jq libglib2.0-bin lsb-release network-manager nfs-common systemd-journal-remote systemd-resolved udisks2 wget -y
3. 安装docker
curl -fsSL https://get.docker.com | sh
4. 修改docker源
vim /etc/docker/daemon.json
{
"log-driver": "journald",
"storage-driver": "overlay2",
"ip6tables": true,
"experimental": true,
"log-opts": {
"tag": "{{.Name}}"
},
"registry-mirrors": [
"https://docker.1panel.live",
"https://hub.rat.dev/",
"https://docker.chenby.cn",
"https://docker.m.daocloud.io"
]
}
5. 安装代理(必须重启)
wget https://github.com/home-assistant/os-agent/releases/download/1.6.0/os-agent_1.6.0_linux_aarch64.deb
dpkg -i os-agent_1.6.0_linux_aarch64.deb
6. 安装homeassistant-supervised
wget -O homeassistant-supervised.deb https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb
apt install ./homeassistant-supervised.deb
7. 安装HACS
wget -O - https://hacs.vip/get | bash -
8. home assistant 网关配置
nmcli -p connection show
nmcli con mod "Supervisor eth0" ipv4.addresses 192.168.1.100/24 ipv4.method manual
nmcli con mod "Supervisor eth0" ipv4.gateway 192.168.1.1
nmcli con mod "Supervisor eth0" ipv4.dns "223.5.5.5,114.114.114.114,8.8.8.8"
nmcli con up "Supervisor eth0"
十三、安装immich
1. 安装postgresql插件
pgvecto.rs插件,用于向量搜索,支持 AI 驱动的照片搜索功能
2. 安装依赖
apt-get install libjemalloc-dev
3. 修改配置
vim /boot/firmware/config.txt
kernel=kernel8.img
4. 下载依赖
wget https://github.com/tensorchord/pgvecto.rs/releases/download/v0.3.0/vectors-pg15_aarch64-unknown-linux-gnu_0.3.0.zip
5. 解压安装
unzip vectors-pg15_aarch64-unknown-linux-gnu_0.3.0.zip -d vectors
cp vectors/vectors.so $(pg_config --pkglibdir)/
cp vectors/vectors--* $(pg_config --sharedir)/extension/
cp vectors/vectors.control $(pg_config --sharedir)/extension/
6. 编辑配置文件
vim /etc/postgresql/15/main/postgresql.conf
shared_preload_libraries = 'vectors.so'
search_path = '"$user", public, vectors'
7. 重启服务
systemctl restart postgresql
8. 验证
DROP EXTENSION IF EXISTS vectors;
CREATE EXTENSION vectors;
pg_trgm 插件,用于模糊文本搜索
apt install postgresql-contrib
9. 验证,进入immich库
CREATE EXTENSION IF NOT EXISTS vectors;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
2、安装immich
cd /usr/local
mkdir immich-app
cd immich-app
1. 获取 docker-compose.yml 文件
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
2. 获取 .env 文件
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
3. (可选)获取 hwaccel.transcoding.yml 文件
wget -O hwaccel.transcoding.yml https://github.com/immich-app/immich/releases/latest/download/hwaccel.transcoding.yml
4. (可选)获取 hwaccel.ml.yml 文件
wget -O hwaccel.ml.yml https://github.com/immich-app/immich/releases/latest/download/hwaccel.ml.yml
5. 启动
docker compose up -d
6. 更新
docker compose pull && docker compose up -d
十四、安装dify
cd /usr/local/
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
启动
docker compose up -d
十五、安装npm
# 下载并安装nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.2/install.sh | bash
# 代替重新启动外壳
\. "$HOME/.nvm/nvm.sh"
# 下载并安装Node.js
nvm install 22
# 对Node.js版本进行验证
node -v # 应该打印 "v22.14.0".
nvm current # 应该打印 "v22.14.0".
# 验证npm版本
npm -v # 应该打印 "10.9.2".
猜你喜欢
- 2025-05-02 Linux基础运维篇:Linux系统监控工具(第015课)
- 2025-05-02 CentOS 7安装TCP BBR拥塞算法(centos7开启bbr加速)
- 2025-05-02 Emacs 折腾日记(十八)——改变Emacs的样貌
- 2025-05-02 Linux man 命令使用教程(linux man -k)
- 2025-05-02 qemu linux内核(5.10.209)开发环境搭建
- 2025-05-02 Linux 源代码makefile文件功能解析
- 2025-05-02 Emacs 折腾日记(十五)——窗口(emacs切换窗口)
- 2025-05-02 空间电推进技术概览及评述(连载之四)
- 2025-05-02 每天LINUX学习:Linux开启VLAN的支持及配置方法
- 2025-05-02 用云存储30分钟快速搭建APP,你信吗?
你 发表评论:
欢迎- 最近发表
-
- 10款鲜为人知的PHP框架(10款鲜为人知的php框架代码)
- 3分钟搞懂反弹shell(反弹shell的常用命令)
- 计算机专业必须掌握的脚本开发语言—shell
- shell 基本语法(shell基本语法set)
- 学习Shell 教程(shell编程学习)
- 一个有意思的PHP Webshell,利用伪协议执行代码
- Linux入门-shell编程-适合小白(linux shell编程是什么)
- GrayLog开源日志管理平台技术文章合集【共58篇】
- AI大模型 MiniMax 基于 Apache Doris 的日志系统,PB 级秒级查询响应
- 互联网大厂后端必看!手把手教你替换 Spring Boot 中的日志框架
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)