[ debian12中appimage的使用 ]


使用插件管理appimageLauncher官方网站、

Release filename Build system Compatible distributions (版本兼任选择)
appimagelauncher-.xenial(amd64,i386).deb Ubuntu Xenial Ubuntu Xenial (16.04), Debian Stretch (9), Netrunner 17.01
appimagelauncher- bionic_(amd64,i386).deb Ubuntu Bionic Ubuntu Bionic (18.04), Ubuntu

< Read more >

[ traefik代理 ]


Traefik容器代理工具

代理原理

请求流程
客户端访问域名和端口

用户在浏览器中访问 https://local.chenhaifeng.top:8010/api/。
请求通过 HTTPS 协议到达 local.chenhaifeng.top,解析到本地机器(127.0.0.1)。
Traefik 接收请求

Traefik 监听了 443 端口(websecure entrypoint)。
由于你的 traefik.http.routers.django.rule 定义了 Host(local.chenhaifeng.top),Traefik 匹配到这个路由规则。
Traefik 判断

< Read more >

[ debian截图工具 ]


安装

sudo apt install flameshot

设置快捷键

设置->键盘->自定义快捷键

命令是, 启动截图

flameshot gui

设置完成快捷键后无法截图问题

vi /etc/gdm3/daemon.conf

WaylandEndble=false

!!!最新版本系统

官网使用deb安装[https://github.com/flameshot-org/flameshot]

debian13配置方案(主要问题是wayland默认是true情况下可能是开启了硬件加速之类的问题)导致无法打开

步骤 1:彻底卸载当前 Flameshot(清理所有配置 +

< Read more >

[ django下载文件浏览器显示进度条 ]


django使用流响应文件, 浏览器会有下载进度条, 可以点击进行暂停, 继续

后端

    @action(detail=False, methods=['get'], schema=AutoDocSchema())
    def get_big_files(self, request):
        def file_iterator(file_path, start_byte=0, chunk_size=256):
            with open(file_path, 'rb') as f:
                f.seek(

< Read more >

[ nginx的基础验证auth_basic "Restricted Access"; auth_basic_user_file /etc/nginx/.htpasswd; 如果我要用接口来代替应如何发送请求成功登陆获取数据 ]


在 Nginx 配置中,auth_basic 用于启用基本认证(Basic Authentication),而 auth_basic_user_file 用于指定存储用户名和密码的 .htpasswd 文件。如果你希望通过 API 来代替传统的浏览器认证,你需要通过 HTTP 请求头传递基本认证信息。

基本认证工作原理 基本认证使用的是 HTTP 头部中的 Authorization 字段,格式如下:

Authorization: Basic <base64(username:password)>
其中,username:password 是你用冒号分隔的用户名和密码,然后将其转化

< Read more >

[ django中使用mongodb,mongoengine ]


官方文档(http://docs.mongoengine.org/guide/querying.html)

安装模块

pip install mongoengine

可以完全替代django中的原本的mongodb

from mongoengine import Document, StringField, BooleanField, DateTimeField, DictField, connect
from datetime import datetime

connect(
    db="eform",
    username="debug"

< Read more >