分类: 未分类

  • pip和poetry安装python依懒包慢

    已经使用了本地缓存仓库但还是很慢,后灰发现是指定的版本号范围比较大导致的,如果不指定精确的版本号则会花费很多时间用来匹配最优版本,在依懒层次和数量都比较多的时候会尤其明显,在安装numpy和pandas包的时候就是这样。如果在poetry中指定*号匹配所有版本那就更慢了。
    在kylin系统上还要执行

    echo ‘export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring’ >> ~/.bashrc
    echo ‘export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring’ >> ~/.profile
    这个环境变量还能解决报Failed to create the collection: Prompt dismissed.的问题

    Views: 88

  • pve安装Kylin-Server-V10 arm版本

    • 下载kylin iso
      https://sx.ygwid.cn:4431/
      我下载的是:Kylin-Server-V10-SP3-General-Release-2303-ARM64.iso
    • 创建虚拟机




      virtiogpu显卡类型
    • BIOS关闭安全启动
      在虚拟机启动的时候按F2进行BIOS



      在Attempt Secure Boot菜单下按空格键禁用安全启动,然后按F10保存
    • 启动虚拟机



      CPU是瑞芯微RK3588,大核是A76

    注意:

    • 显卡类型不能选串口和framebuffer,以前装ubuntu和windows 11用的是串口和framebuffer,以为装kylin也是,结果用framebuffer和串口始终会在进入引导界面的的时候卡死。
    • 对于大小核的板子要绑定纯大核或纯小核,有些系统不支持大小核

    Views: 47

  • 峰火HG5143F超级密码获取

    • 获取光猫mac地址
      可以看路由器背面,也可以从arp表中看到
    • 转换mac地址
      把mac地址中分隔符去掉,然后转为大写,不足2位的数字要补0
      54:e0:5:2a:4f:20 转换后就是54E0052A4F20
    • 启用光猫telnet
      浏览器打开http:/192.168.1.1/cgi-bin/telnetenable.cgi?telnetenable=1&key=54E0052A4F20
      如果浏览器显示telnetenable=1 或 telnet开启 ,则表示开启成功。
    • 登录telnet
      telnet 192.168.1.1
      账号是admin,密码是Fh@转换后MAC地址后6位,在这里就是FH@2A4F20
    • 获取超级密码
      进入telnet后执行
      load_cli factory
      show admin_name # 显示超级帐号
      show admin_pwd # 显示超级密码
    • 获取PPPOE密码
      进入宽带配置页,浏览器按F12打开开发工具栏,在下面找到文档类型是JSON的异步请求,里面已经包含了PPPOE的账号密码
    • 开启桥接模式
      把路由模式改为桥接模式,绑定接口选择全部lan口,确认后会断网,然后到路由器上配置PPPOE连接。

    Views: 44

  • macos命令行安装xcode command line tools

    • 在这里下载 xcode command line tools
      https://developer.apple.com/download/all/?q=Command%20Line%20Tools%20for%20Xcode
    • 挂载dmg
      hdiutil attach Command_Line_Tools_for_Xcode_15.3.dmg
    • 安装pkg包
      `sudo installer -package /Volumes/Command\ Line\ Developer\ Tools/Command\ Line\ Tools.pkg -target /“
    • 卸载dmg
      hdiutil detach /Volumes/Command\ Line\ Developer\ Tools

    Views: 45

  • macos命令行配置网卡

    • 后面的3个IP地址分别是网卡IP地址,子网掩码,网关IP地址
      networksetup -setmanual "USB 10/100/1000 LAN" 192.168.1.100 255.255.255.0 192.168.1.1
    • 配置网卡DNS服务器
      networksetup -setdnsservers "USB 10/100/1000 LAN" 192.168.1.1
    • 清除网卡DNS服务器
      networksetup -setdnsservers "USB 10/100/1000 LAN" empty

    Views: 16

  • 安装Collabora Online并与nextcloud集成

    1. 安装Collabora Online
    cd /usr/share/keyrings
    sudo wget https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg
    cd /usr/share/keyrings
    sudo wget https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg
    

    编辑/etc/apt/sources.list.d/collaboraonline.sources,添加如下内容:

    Types: deb
    URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb
    Suites: ./
    Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg

    sudo apt update && sudo apt install coolwsd code-brand
    sudo systemctl restart coolwsd
    2. 申请证书
    
    我是使用acme.sh申请证书的,过程略
    
    3. 配置collwsd
    
    在/etc/coolwsd/coolwsd.xml中添加
    >        <remote_font_config>
                    <url>https://pan.hetao.me/apps/richdocuments/settings/fonts.json</url>
            </remote_font_config>
    
    ```shell
    ln -s /opt/certs/hetao.me/hetao.me.key key.pem
    ln -s /opt/certs/hetao.me/hetao.me.cer cert.pem
    ln -s /opt/certs/hetao.me/fullchain.cer ca-chain.cert.pem
    coolconfig set ssl.enable true
    coolconfig set ssl.termination false
    sudo systemctl restart coolwsd
    
    1. 配置nextcloud

    首先安装Nextcloud Office扩展
    然后

    1. 使用效果

    Views: 97

  • 安装ONLYOFFICE Docs Community Edition并与next cloud集成

    ONLYOFFICE Docs是onlyoffice的server端,可以通过onlyoffice api和WOPI两种方式与客户端连接。
    下面是onlyoffice docs的安装:

    1. 安装onlyoffice docs
    sudo add-apt-repository ppa:5-sergey/nginx-quic
    sudo apt update
    sudo apt-get install postgresql
    sudo -i -u postgres psql -c "CREATE USER onlyoffice WITH PASSWORD 'onlyoffice';"
    sudo -i -u postgres psql -c "CREATE DATABASE onlyoffice OWNER onlyoffice;"
    sudo apt-get install rabbitmq-server
    sudo apt-get install nginx-extras
    mkdir -p -m 700 ~/.gnupg
    curl -fsSL https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE | gpg --no-default-keyring --keyring gnupg-ring:/tmp/onlyoffice.gpg --import
    chmod 644 /tmp/onlyoffice.gpg
    sudo chown root:root /tmp/onlyoffice.gpg
    sudo mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg
    echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" | sudo tee /etc/apt/sources.list.d/onlyoffice.list
    sudo apt-get update
    sudo apt-get install ttf-mscorefonts-installer
    sudo apt-get install onlyoffice-documentserver
    

    参考:
    https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx?_ga=2.121380878.782359554.1594636128-1157782750.1587541027
    https://github.com/ONLYOFFICE/onlyoffice-nextcloud

    1. 申请证书

    我这里是用acme.sh申请的,过程略

    1. 配置nginx

    编辑/etc/nginx/conf.d/ds.conf

    include /etc/nginx/includes/http-common.conf;
    server {
      listen 0.0.0.0:80;
      listen [::]:80 default_server;
      server_tokens on;
    
      set secure_link_secret 123456;
      include /etc/nginx/includes/ds-*.conf;
    }
    server {
        listen 443 quic reuseport;
        listen       443 ssl;
        listen [::]:443 quic reuseport;
        listen       [::]:443 ssl;
        http2 on;
        http3 on;
        quic_retry on;
    
    
        # Use Mozilla's guidelines for SSL/TLS settings
        # https://mozilla.github.io/server-side-tls/ssl-config-generator/
        ssl_certificate     /opt/certs/hetao.me/fullchain.cer;
        ssl_certificate_key /opt/certs/hetao.me/hetao.me.key;
        ssl_protocols TLSv1.3;
    
        # Prevent nginx HTTP Server Detection
        server_tokens on;
    
        # HSTS settings
        # WARNING: Only add the preload option once you read about
        # the consequences in https://hstspreload.org/. This option
        # will add the domain to a hardcoded list that is shipped
        # in all major browsers and getting removed from this list
        # could take several months.
        add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload" always;
        add_header Alt-Svc 'h3=":443"; ma=86400';
        setsecure_link_secret 123456;
        include /etc/nginx/includes/ds-*.conf;
    }
    
    1. 配置域名

    配置onlyoffice.hetao.me指向onlyoffice docs服务器
    过程略
    5. nextcloud中安装onlyoffice扩展

    新版本nextcloud似乎不能在线安装onlyoffice扩展了,所以用下面的方法离线安装。
    在 https://apps.nextcloud.com/apps/onlyoffice 这个页面上下载扩展的tar包,解压到/var/www/nextcloud/apps文件夹中,然后在nextcloud的app管理页面启用onlyoffice扩展。

    1. 配置nextcloud


    其中秘钥就是JWT私钥,可以在/etc/onlyoffice/documentserver/local.json文件中配置。
    inbox,outbox,session三个私钥设置一样并且与nextcloud中的配置一致。

    1. 使用效果

    参考:
    https://www.collaboraoffice.com/code/linux-packages/

    Views: 68

  • dnsdist记录查询和应答日志

    dnsdist中做如下配置

    addAction(AllRule(), LogAction(“/var/log/dnsdist.log”, false, true, false, true, true))
    addResponseAction(AllRule(), LogResponseAction(“/var/log/dnsdist.log”, true, false))

    Views: 95

  • dnsdist远程控制台

    • dnsdist中做如下配置

    controlSocket(‘0.0.0.0:5199’)
    setKey(‘mykey’)
    setConsoleACL({‘0.0.0.0/0’, ‘::1/128’})

    • 然后运行console客户端
      dnsdist -c dns.hetao.me -k mykey

    Views: 90

  • linux物理终端(framebuffer)设置字体颜色

    setterm –foreground green –store
    此命令需要在物理终端上执行,ssh不支持

    Views: 293