跳转到帖子
  • 篇帖子

    39
  • 篇意见

    10
  • 次查看

    2080

在此博客的帖子

自定义钩子(增加游客模糊效果) {{if !member.member_id}} <style> .content-blur { filter: blur(3px); pointer-events: none; user-select: none; } .blur-overlay { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; background: rgba(255,255,255,0.8); padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: center; font-size: 20px; color: #333; } .blur-overlay a { color: #00
问题调试 https://www.xxxx.chat/sidekiq/ (任务看板) https://www.xxxx.chat/logs/ (日志看板) https://www.xxxx.chat/safe-mode/(进入安全模式) 删除重复值 ./launcher enter app(进入容器) rails c(进入控制台) result = ActiveRecord::Base.connection.execute("SELECT * FROM post_hotlinked_media WHERE post_id = 67") (查询重复值)PostHotlinkedMedia.where(post_id: 67, url: 'bd419e11ddca94e73e9511cd77845384').first.destroy(删除重复值)修改域名 ./launcher enter app(进入容器) discourse remap www.old.com www.new.com (更换域名) rake posts:rebake (重新编译)
准备工作 下载 Golang 从官方网站下载并安装 Go 语言, 按默认设置安装即可。 安装npm和pnpm(版本要求npm>22) Clone Answer 项目 确保你已经克隆了 Apache Answer 到本地,如还未克隆,请阅读 Apache Answer 前端配置指南。 一、后端编译和初始化 在 Answer 项目根目录打开命令行终端运行以下命令。 go mod download go run cmd/answer/main.go init -C ./answer-data go run cmd/answer/main.go run -C ./answer-data如果报端口占用错误就修改/answer/internal/install/install_main.go文件端口 加入版本号编译 cd cmd/answer go build -ldflags "-X github.com/apache/answer/internal/base/constant.Version=1.5.1 -X github.com/apache/answer/internal/ba
一、安装Docker 1.更新系统软件包 sudo apt update sudo apt upgrade 2.安装所需的依赖库和工具: sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release 3.添加Docker官方GPT秘钥: curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 4.设置Docker稳定版存储库 echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/
location / { proxy_pass http://0.0.0.0:10443; # 设置反向代理到目标地址 proxy_set_header Host $host; # 转发 Host 头 proxy_set_header X-Real-IP $remote_addr; # 转发客户端真实 IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # 转发客户端 IP proxy_set_header X-Forwarded-Proto $scheme; # 转发协议 }
报错如图显示:   问题解决: 修改app.yml文件,新增一条配置代码引入国内镜像源配置文件 - "templates/web.china.template.yml" 如果出现github.com报错的话需要设置一下代理 vim /etc/profile # 添加自己实际情况,添加以下内容 export https_proxy=http://user:passwd@IP:58963 export all_proxy=socks5://IP:38476 # 执行生效 source /etc/profile   配置socks5代理 git config --global http.proxy socks5 127.0.0.1:7890 git config --global https.proxy socks5 127.0.0.1:7890 配置http代理 git config --global http.proxy 127.0.0.1:7890 git config --glob
# 使用全局定义的 $lowercase_uri 变量 # if ($request_uri ~ [A-Z]) { # return 301 $scheme://$host$lowercase_uri; # } # 合并版 # if ($request_uri ~* ^/(devops|note|code|video|guoxue)[0-9]*/(?:.*/)?([0-9a-zA-Z_-]+\.html)$) { # return 301 /$2; # } # 不合并版 # devops if ($request_uri ~* ^/devops[0-9]*/.*/([0-9a-zA-Z_-]+\.html)$) { return 301 /$1; } if ($request_uri ~* ^/devops[0-9]*/([0-9a-zA-Z_-]+\.html)$) { return 301 /$1; }
[HIDE]这是因为 FontAwesome 图标库升级了(FA5 → FA6),旧图标名 paint-brush 被换成了 paintbrush。[HIDE] ✅ 解决: 找到引用 paint-brush 的地方,改成 paintbrush 如果这是主题组件里的 icon(比如主题切换按钮上用的),就在组件设置或 JS 中更新图标名
分别在目录中新建不同的文件夹,例如discourse1 discourse2 discourse3(不同的命名为不同的容器项目) 重命名app.yml,例如app1.yml app2.yml app3.yml(不同的命名为不同的容器项目) 修改app.yml 中的配置文件(假如是第二个容器,其配置文件如下,仅修改示例中的,其他不变) volumes: - volume: host: /www/discourse2/shared/standalone2 guest: /shared - volume: host: /www/discourse2/shared/standalone2/log/var-log guest: /var/log
在 Linux 中,swappiness 是一个内核参数,用于控制系统在使用交换空间(Swap)时的倾向。其值范围为 0 到 100,值越低,系统越倾向于使用物理内存而不是交换空间。将 swappiness 设置为 10 可以减少对交换空间的依赖,适合内存充足的服务器或桌面环境。 调整步骤 1. 临时调整(重启后失效) 执行以下命令临时设置 swappiness 为 10: sudo sysctl vm.swappiness=10 验证设置是否生效: cat /proc/sys/vm/swappiness 2. 永久调整(重启后生效) 编辑系统配置文件: sudo nano /etc/sysctl.conf添加或修改以下行: vm.swappiness=10 保存并退出编辑器,然后使更改生效: sudo sysctl -p 3. 验证修改 再次检查当前的 swappiness 值: cat /proc/sys/vm/swappiness 现在,swappiness 应该被成功设置为 10。
我这里面是用的ubuntu的机器搭建的 安装Git: 先确保VPS上安装了Git,以便从GitHub克隆代码。运行以下命令: sudo apt update sudo apt install git 克隆GitHub仓库: 打开GitHub页面,找到仓库的URL(通常在仓库首页上方有“Code”按钮,可以复制HTTPS链接)。然后,在VPS上运行以下命令,将仓库代码下载到本地: git clone https://github.com/lemoex/oci-help 进入项目文件夹: 克隆完成后,进入下载的项目文件夹,通常这个文件夹的名称是仓库名。例如: cd oci-help 如果没有更改过位置,脚本文件夹默认位置就是:root/oci-help 4. 编译和运行程序: 该项目包含的文件如go.mod和main.go表明它是用Go语言编写的。确保Go已经在VPS上安装,您可以运行以下命令安装Go: sudo apt install golang 编译Go代码: 进入项目目录后,运行以下命令来编译和构建程序: go build -o oci-help main.go 这会在当前
/* 自定义内容字体 */ .ipsRichText{ font-family: "Georgia", "Times New Roman", serif; }/*自定义背景图像*/ .ipsLayout__main { background-image: url({resource="custom/yourimage.png" app="core" location="front"}); /*background-image: url(https://yoursite/images/pic.png);*/ width: 100%; background-position: center bottom; background-size: cover; background-repeat: no-repeat; }/* 作者在线状态 */ .ipsEntry__author-online { display: block; }/* 作者在线状态 */ .ipsEntry__author-online { border: 1.1em solid hsl(113deg
sudo -i (切换root用户) sudo passwd root(修改root密码) vim /etc/ssh/sshd_config(编辑配置文件) PermitRootLogin yes(修改为YES) PasswordAuthentication yes(修改为YES) cd /etc/ssh/sshd_config.d(进入目录) vim 60-cloudimg-settings.conf(编辑配置文件) PasswordAuthentication yes(修改为YES) sudo service ssh restart 或 sudo systemctl restart ssh (重启SSH)
#乾坤堂主站 location / { include enable-php-72.conf; index app.php; try_files $uri @rewriteapp; } location @rewriteapp { rewrite ^(.*)$ /app.php/$1 last; } #乾坤堂论坛 location /bbs { include enable-php-82.conf; try_files $uri $uri/ /bbs/index.php; } location ~^(/bbs/page/).*(.php)$ { include enable-php-82.conf; try_files $uri $uri/ /bbs/index.php; } # location /bbs/api/ { # include enable-php-82.conf; # if (!-e $request_filename){ # rewrite ^/bbs/api/
{{if !member.member_id}} <style> .content-blur { filter: blur(3px); pointer-events: none; user-select: none; } .blur-overlay { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; background: rgba(255,255,255,0.8); padding: 20px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: center; font-size: 20px; color: #333; } .blur-overlay a { color: #0066cc; text-d
./launcher enter app rails c admin_user = User.find_by(email: 'admin@example.com') 或 admin_user = User.find_by(username: 'admin') admin_user.email = 'newemail@example.com' (修改邮箱) admin_user.save (保存修改) admin_user.username = 'new_username' (修改用户名) admin_user.save (保存修改) admin_user.admin = true (将用户设置为管理员) admin_user.save (保存修改) 其余仿此类操作就可以 exit (退出控制台) …………………………………………………………………………………………
WP Acceleration for China 替换Google CDN文件、Gravatar头像链接,加快WordPress打开速度,为WordPress中国用户提供加速。 众所周知的一些原因,在国内使用WordPress建站会发现打开非常慢,所以就需要我们做一些优化工作了,WP Acceleration for China插件旨在为国内WordPress加速。 目前插件可以为常见的两种打开慢的情况进行提速: Google CDN国内无法访问; Gravatar头像国内无法访问。 加速原理: 谷歌的静态资源提供中国科学技术大学、360网站卫士、极客族三家可选替代方案; Gravatar的头像提供Gravatar https访问、Gravatar CN、V2EX、极客族三家可替代方案。 使用方法 将wp-acceleration-for-china.php里面的代码加入主题functions.php内; 将wp-acceleration-for-china.php文件上传到主题目录,在functions.php文件里使用include 'wp-acceleration-f
直接修改名称(通过数据库绕过校验) 适用于你 只是想改显示名称而不影响功能。 在容器中直接用 SQL 修改主题名称即可: 1. 进入容器: cd /var/discourse ./launcher enter app 2. 进入 PostgreSQL: sudo -u postgres psql discourse 3. 执行 SQL 修改主题名称: UPDATE themes SET name = 'H' WHERE id = -2; 然后退出: exit
Nginx配置文件 server { listen 80; listen [::]:80; server_name www.cxcblog.com ; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/www.cxcblog.com; location ^~ / { proxy_pass http://0.0.0.0:1080; proxy_set_header Host $host; } include rewrite/none.conf; #error_page 404 /404.html; # Deny access to PHP files in specific directory
linux常用的解压和压缩命令如下: 1、.tar 解包: tar xvf FileName.tar 打包:tar cvf FileName.tar DirName (注:tar是打包,不是压缩!) 2、.gz 解压1: gunzip FileName.gz 解压2:gzip -d FileName.gz 压缩: gzip FileName 3、.tar.gz 和 .tgz 解压: tar zxvf FileName.tar.gz 压缩:tar zcvf FileName.tar.gz DirName 4、.bz2 解压1: bzip2 -d FileName.bz2 解压2: bunzip2 FileName.bz2 压缩: bzip2 -z FileName 5、.tar.bz2 解压: tar jxvf FileName.tar.bz2 压缩: tar jcvf FileName.tar.bz2 DirName
网易:http://hub-mirror.c.163.com 中科大镜像地址:http://mirrors.ustc.edu.cn/ 中科大github地址:https://github.com/ustclug/mirrorrequest Azure中国镜像地址:http://mirror.azure.cn/ Azure中国github地址:https://github.com/Azure/container-service-for-azure-china DockerHub镜像仓库: https://hub.docker.com/  阿里云镜像仓库: https://cr.console.aliyun.com  google镜像仓库: https://console.cloud.google.com/gcr/images/google-containers/GLOBAL (如果你本地可以翻墙的话是可以连上去的 ) coreos镜像仓库: https://quay.io/repository/  RedHat镜像仓库: https://access.redhat.com/contain