nextcloud删除文件是用的DELETE
http://NAS_URL/remote.php/dav/files/NAS_USER_NAME/FILE_PATH
DELETE
http://NAS_URL/remote.php/dav/files/NAS_USER_NAME/FILE_PATH
DELETE
把文件直接上传到用户目录下,但是在nextcloud并不能识别,看不到。因为没建索引,没入库。
重新扫描下就行了。
用户名
dockerming
occ的位置
要指定好。
/usr/bin/docker exec --user www-data MyNextCloud php -f /var/www/html/occ files:scan --all
/usr/bin/docker exec --user www-data MyNextCloud php -f /var/www/html/occ memories:index
插件安装http://NAS_URL/settings/apps/installed/memories
/usr/bin/docker exec --user www-data MyNextCloud php -f /var/www/html/occ preview:pre-generate -vvv
/usr/bin/docker exec --user www-data MyNextCloud php -f /var/www/html/occ preview:generate-all -vvv
默认显示都出来了。
Apache/2.4.54 (Debian)
直接进docker
docker exec -it nextcloud bash
因为docker里面没有vi,直接用sed来替换
sed -i 's/ServerTokens OS/ServerTokens Prod/g' /etc/apache2/conf-available/security.conf
apachectl -k graceful
这下只显示Apache了。
报错是:
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception</s:exception>
<s:message>Failed to rename /xiaomi/DCIM/Camera/IMG_XXXX.JPEG to /xiaomi/DCIM/Camera/IMG_XXX.jpg</s:message>
</d:error>
其实是目录权限的问题。
上服务器chown -R www-data:www-data /XXXXX/xiaomi/就好了/
1,每天从APNIC下载
http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest
2,然后用如下代码:
with open('delegated-apnic-latest') as f:
data = f.read()
for line in filter(lambda x: x.startswith('apnic|CN|ipv4'), data.splitlines()):
item = line.split('|')
print('{}/{}'.format(item[3], 33 - int(item[4]).bit_length()))
可以得到如下格式的IP段信息:
218.104.0.0/17
3,转换成IP范围格式:
import ipaddress
ip = ipaddress.IPv4Network('223.255.0.0/17')
start_ip = ip.network_address
end_ip = ip.broadcast_address
print(f"IP Range: {start_ip} - {end_ip}")
或者:
ip = '223.255.0.0/17'
# 将IP地址和掩码分开
ip_addr, mask_len = ip.split('/')
mask_len = int(mask_len)
# 将IP地址转换为32位二进制字符串
ip_bin = ''.join([bin(int(x)).lstrip('0b').rjust(8, '0') for x in ip_addr.split('.')])
# 获取网络地址和广播地址
net_addr_bin = ip_bin[:mask_len] + '0' * (32 - mask_len)
bcast_addr_bin = ip_bin[:mask_len] + '1' * (32 - mask_len)
net_addr = '.'.join([str(int(net_addr_bin[i:i+8], 2)) for i in range(0, 32, 8)])
bcast_addr = '.'.join([str(int(bcast_addr_bin[i:i+8], 2)) for i in range(0, 32, 8)])
print("IP Range: {} - {}".format(net_addr, bcast_addr))