在我们的工作中,遇到了一个关于Sitecore站点定义的问题,导致在Sitecore 10.1.3的CD环境中出现了链接生成错误的情况。在此,我将分享这个问题的细节以及解决方案。
https://archive.doc.sitecore.com/xp/en/SdnArchive/SDN5/Articles/Administration/Configuring%20Multiple%20Sites/Adding%20New%20Site/site%20Attribute%20Properties/targetHostName.html
https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB1000633
具体现象是在站点A引用站点B的节点时,链接里的/sitecore/content关键字没有被正确解析,导致链接生成错误。需要特别注意的是,这个问题只在CD环境中出现,而在CM环境中是正确的。
由于CD环境不能调试,我们创建aspx文件上传到测试CD环境中,来尝试打印一些关键属性
https://docs.flarum.org/install
参考官方安装文档就行,先把基本都安装好,
其中有一个URL Rewriting ,我使用的Nginx,
所以需要创建一个,nginx.site.config
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain.com;
root /path/to/flarum/public;
index index.html index.htm index.php;
include /path/to/.nginx.conf;
# URI 符合正则表达式 [\.php$] 的请求将进入此段配置
location ~ \.php$ {
# 配置 FastCGI 服务地址,可以为 IP:端口,也可以为 Unix socket。
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
# 配置 FastCGI 的主页为 index.php。
fastcgi_index index.php;
# 配置 FastCGI 参数 SCRIPT_FILENAME 为 $realpath_root$fastcgi_script_name。
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
# 引用更多默认的 FastCGI 参数。
include fastcgi_params;
}
#ssl_certificate xxx
#ssl_certificate_key yyy
}
https://github.com/sxyazi/free-hls
cd /var/www
git clone https://github.com/sxyazi/free-hls.git
cd free-hls
把APP 映射到宿主机/mnt/free-hls/app
- app:/var/app
+ - /mnt/hdd/free-hls/uploads:/var/app/web/uploads
....
volumes:
app:
这是94采集器下载链接最新版本5.2.4 下载
/var/www/94caiji
目录为例。virtualenv venv
创建虚拟环境。激活venv . venv/bin/activate
pip install -r requestments.txt
, 在安装的过程中可能提示错误如下,修改requestments.txt 为 pyppeteer==0.2.6
ERROR: Cannot install pyppeteer==0.2.5 and pyppeteer==0.2.6 because these package versions have conflicting dependencies.
cfscrape
, 错误如下, 需要安装 pip install cfscrape
ModuleNotFoundError: No module named 'cfscrape'
执行python3 index.py
看是否可以运行, 如果没有错误,可以正常运行,说明python环境依赖安装完成。
https://hostloc.com/thread-1154840-1-3.html
https://serverfault.com/questions/10811/how-to-add-a-script-to-startup-and-shutdown-in-debian
https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6
按照些教程准备在armbian安装,前面都很好,就是创建 /etc/init.d/cloudflared启动脚本时,Armbian不工作, 无法启动。
然后就查到了 init已经被systemd替换了,所以就使用systemd来启动cloudflared.
https://serverfault.com/a/946483
之前一直使用aria2来下载BT,PT,aria2的配置已经修改user-agent来伪装其它下载软件比如transmission.
最近再下载PT时,提示错误,errorCode=1 Tracker returned failure reason: Abnormal access blocked
看样应该是被识别并禁止下载了,
就那换一个吧, Transmission
https://blog.haibara.cn/archives/173
https://github.com/ronggang/transmission-web-control/issues/292
https://ld246.com/article/1556162494650
https://my.oschina.net/CasparLi/blog/830361?utm_source=ld246.com
apt install transmission transmission-daemon
一切正常
首先要停用transmission-daemon服务,执行下面的命令:
service transmission-daemon stop
Django Cache 默认并不区分Desktop和Mobile, 但是如果Desktop 视图和mobile视图不同,这时Django Cache就会有问题,
如果某个页面先被desktop模式访问之后,页面会被缓存,但手机端再访问这个页面时,发布页面已经被缓存,所以直接返回,
但是被缓存的内容是Desktop模式,在手机端显示会有些奇怪。
https://docs.djangoproject.com/zh-hans/4.0/topics/cache/
https://docs.djangoproject.com/zh-hans/4.0/topics/cache/#using-vary-headers
https://github.com/django/django/blob/main/django/utils/cache.py
https://github.com/Botir/Django-Mobile-Detector
Mobile Detector 请参考: https://github.com/Botir/Django-Mobile-Detector
Vary Header介绍: https://docs.djangoproject.com/zh-hans/4.0/topics/cache/#using-vary-headers
proxy pass static image to another host, most of requests are ok, but some requests return 400 (bad request).
edit /var/nginx/nginx.conf
error_log /var/log/nginx/error.log debug;
nginx config
location ~ ^/static/images/(.*) {
proxy_pass http://youranotherdomain/images/$1;
}
https://www.jianshu.com/p/95129aa88dfe
https://www.right.com.cn/forum/thread-4258977-1-1.html
https://www.right.com.cn/forum/thread-8227890-1-1.html
https://forums.fedoraforum.org/showthread.php?326268-Kernel-upgrades-making-WiFi-and-printer-drivers-incompatible
https://gist.github.com/bcastellano/ae63e9e2da2c3d068c0014ed6963a5a1
http://chee-yang.blogspot.com/2008/10/linux-install-hp-laserjet-1020-on-cups.html
最近孩子在家上网课,老师每天发的学习资料,有一部分打印出来比较方便,经常往打印店跑,感觉有点太麻烦。
网上查了一下,HP 1020 plus 激光打印机,挺好,耗材便宜,配合N1,实现共享打印很方便, 所以就在闲鱼上买了个二手的,成色一般
打印机直接插笔记本上,可以自动识别并正常打印,然后就是折腾N1打印服务, 遇到最主要的问题就是N1不能识别打印机,整个过程记录如下。
N1 需要安装Armbian(不是必须的,但本文是基于Armbian, 如果是其它系统,本文可能不适用)
https://goaccess.io/
https://github.com/allinurl/goaccess/issues/1328
https://github.com/allinurl/goaccess
https://www.jianshu.com/p/b134995ae16c
在搜索nginx log分析工具时,看到了GoAccess, 开源免费不仅有终端界面,也有Web界面,
本文主要讲解和记录一下,实时Web页面的更新及Nginx配置。