Linux Collection

Common command and note

Alist & Aria2

It needs fullchain cert to prevent certification error.

Nextcloud

##maintenancemode
sudo -u www-data php occ maintenance:mode
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:mode --off

##repair
sudo -u www-data php occ maintenance:repair

Apache2

ufw allow 'Apache Full'
apt install apache2 php libapache2-mod-php

##mod
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod proxy_wstunnel
sudo a2enmod proxy_http
sudo a2enmod rewrite
sudo a2enmod headers

# 监控进程crontab
* * * * * /bin/bash apachedamon.sh

#监控进程
#!/bin/bash
# Apache httpd进程监控shell

# 如果你在使用RHEL / CentOS / Fedora Linux,使用这个重启命令
#RESTART="/sbin/service httpd restart"

# 如果你在使用 Debian / Ubuntu Linux,把上面的RHEL的注释掉,换用这个
RESTART="/etc/init.d/apache2 restart"

#path to pgrep command
PGREP="/usr/bin/pgrep"

# Httpd daemon name,
# Under RHEL/CentOS/Fedora it is httpd
# Under Debian 4.x it is apache2
#HTTPD="httpd"

# Debian / Ubuntu Linux 下进程名是apache2
HTTPD="apache2"

# find httpd pid
$PGREP ${HTTPD}

if [ $? -ne 0 ] # if apache not running
then
	echo "restart"
	$RESTART # restart apache
fi

DDNS (3322)

vi /etc/crontab
//添加一行 每分钟刷新一次
1 * * * * wget "http://用户名:密码@members.3322.org/dyndns/update?system=dyndns&hostname=域名" && rm -r update?system=dyndns*

youtube-dl

youtube-dl --proxy socks5://127.0.0.1:1080 url

Last updated