智谱最新的模型

GLM-Z1-AirX(极速版):定位国内最快推理模型,推理速度可达 200 tokens / 秒,比常规快 8 倍;

GLM-Z1-Air(高性价比版):价格仅为 DeepSeek-R1 的 1/30,适合高频调用场景;

GLM-Z1-Flash(免费版):支持免费使用,旨在进一步降低模型使用门槛。

佛洛依德冰山理论

“本我” 代表欲望,受意识遏抑, (完全潜意识)
“自我” 负责处理现实世界的事情; (大部分有意识)
“超我” 是良知或内在的道德判断。 (部分有意识)

豆包代写的代码

import requests
import json
import sys

url = 'http://x.x.x.x/v1/chat-messages'
headers = {
  'Authorization': 'Bearer app-KT4yNocX6Bzey6mZ5Jxxxx',
    'Content-Type': 'application/json'
}
conversation_id = ""

while True:
    try:
        # 获取系统默认编码
        encoding = sys.getdefaultencoding()
        query = input("请输入你的问题(输入 '退出' 结束对话):").encode(encoding).decode(encoding)
        if query == "退出":
            break

        data = {
            "inputs": {},
            "query": query,
            "response_mode": "streaming",
            "conversation_id": conversation_id,
            "user": "ts",
            "files": [
                {
                    "type": "image",
                    "transfer_method": "remote_url",
                    "url": "https://cloud.dify.ai/logo/logo-site.png"
                }
            ]
        }

        try:
            response = requests.post(url, headers=headers, json=data, stream=True)
            response.raise_for_status()

            full_response = []
            full_api_response = []
            for chunk in response.iter_lines(decode_unicode=True):
                if chunk.startswith('data:'):
                    chunk_data = chunk[5:].strip()
                    if chunk_data:
                        full_api_response.append(chunk_data)
                        try:
                            event = json.loads(chunk_data)
                            if event.get('event') == 'message':
                                answer = event.get('answer', '')
                                print(answer, end='', flush=True)
                                full_response.append(answer)
                            elif event.get('event') == 'message_end':
                                print()
                                final_answer = ''.join(full_response)
                                print(f"完整回复: {final_answer}")
                                conversation_id = event.get('conversation_id', conversation_id)
                        except json.JSONDecodeError:
                            print(f"解析错误: {chunk_data}")
            print("\nAPI 接口返回的完整信息:")
            for line in full_api_response:
                print(line)

        except requests.exceptions.RequestException as e:
            print(f"请求错误: {e}")
    except UnicodeDecodeError:
        print("输入解码时出现错误,请检查终端编码设置。")

su 与 su – 切换root变量

[ceshizhangzhao@ceshizhangzhao1 ~]$ whoami #确认当前用户为ceshizhangzhao   root
ceshizhangzhao
[ceshizhangzhao@ceshizhangzhao1 ~]$ su #不加用户就表示切换到root,当然也可以su root root
Password:
[root@ceshizhangzhao1 ceshizhangzhao]# env
HOSTNAME=ceshizhangzhao1
SHELL=/bin/bash
HISTSIZE=500
USER=ceshizhangzhao <--
MAIL=/var/spool/mail/ceshizhangzhao
PWD=/home/ceshizhangzhao <--
HOME=/root
LOGNAME=ceshizhangzhao
以下省略无关内容…
提示:使用su而不加上“-”这个参数,切换前的用户的相关信息还会存在。切换用户时,“su - 用户名”。
[root@ceshizhangzhao1 ceshizhangzhao]# exit #退出当前用户,这个命令也可以用ctrl+d
[ceshizhangzhao@ceshizhangzhao1 ~]$ su - root
Password:
[root@ceshizhangzhao1 ~]# env | egrep "USER|MALL|PWD|LOGNAME"
USER=root <--
PWD=/root <--
LOGNAME=root

总结:请su –

人生的感悟

一花一一花一木一世界,一朝一夕一浮生,一生一世一轮回。一悲一喜一枯荣,一真一假一尘缘,一起一落一平生。 一直一念一徒然,一心一念一清净,一梦一醒一凡尘。

定期清理日志

!/bin/bash
设置变量
LOG_DIR="/a/b/c" # 替换为实际的日志目录
ARCHIVE_DIR="/a/b/c/history_archive" # 替换为存储归档的目录
DAYS_TO_KEEP=30 # 保留日志的天数
LOG_FILE="/a/b/c/history_archive/op_record.log" # 替换为实际的日志文件路径
创建归档目录(如果不存在)
mkdir -p "$ARCHIVE_DIR"
获取当前日期
CURRENT_DATE=$(date +%Y-%m-%d)
记录开始时间
echo "[$CURRENT_DATE] 开始压缩和归档日志…" >> "$LOG_FILE"
压缩并归档日志
for dir in "$LOG_DIR"/20*; do
if [ -d "$dir" ]; then
# 获取目录名
dir_name=$(basename "$dir")
# 压缩目录 tar -zcf "$ARCHIVE_DIR/${dir_name}.tar.gz" -C "$LOG_DIR" "$dir_name" # 检查压缩是否成功 if [ $? -eq 0 ]; then echo "[$CURRENT_DATE] 已压缩并归档: $dir_name" >> "$LOG_FILE" # 删除原始日志目录 rm -rf "$dir" echo "[$CURRENT_DATE] 已删除原始日志目录: $dir_name" >> "$LOG_FILE" else echo "[$CURRENT_DATE] 压缩失败: $dir_name" >> "$LOG_FILE" fi fi
done
清理超过指定天数的归档文件
find "$ARCHIVE_DIR" -type f -name "*.tar.gz" -mtime +$DAYS_TO_KEEP -exec rm -f {} \;
echo "[$CURRENT_DATE] 已删除超过 $DAYS_TO_KEEP 天的归档文件" >> "$LOG_FILE"
记录结束时间
echo "[$CURRENT_DATE] 完成压缩和归档日志." >> "$LOG_FILE"

模糊的命令

1、命令$(basename $n)

n="/data/path-a/path-b/2024-log-dir"
COMPRESS_DIR=$(basename "$n")
echo $COMPRESS_DIR
2024-log-dir

2、tar -C目录路径

/data/abcp/access-mo-dispatch/2025-01-01
LOG_DIR="/data/abcp/access-mo-dispatch"
COMPRESS_DIR="2025-01-01"
tar -zcf "/data/abcp/access-mo-dispatch/2025_history_archive/2024-03-14_2024-log-dir.tar.gz" -C "/data/abcp/access-mo-dispatch" "2025-01-01"
归档压缩的结果
[root@k8s-node02 access-mo-dispatch]# tree
.
├── 2025-01-01
├── 2025-01-02
├── 2025-01-03
└── 2025_history_archive
└── 2024-03-14_2024-log-dir.tar.gz
4 directories, 1 file

解决docker镜像仓库下载慢

{
"registry-mirrors": [
"https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com",
"https://docker.m.daocloud.io",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://your_preferred_mirror",
"https://dockerhub.icu",
"https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://dockerproxy.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc"
]
}

ansible-playbook 被管理主机网络测试


  • name: Test connectivity to 61.139.2.69:80 from managed hosts
    hosts: all # 测试被管理主机的连通性
    gather_facts: no # 不需要收集主机信息以加快执行速度
    tasks:
    • name: Wait for port 80 on 61.139.2.69 to become reachable
      wait_for:
      host: 61.139.2.69
      port: 80
      timeout: 10 # 超时时间为10秒
      ignore_errors: yes
      register: port_status
    • name: Report connectivity status
      debug:
      msg: >
      {{ ‘Connectivity to 61.139.2.69:80 is reachable’ if port_status.state == ‘started’
      else ‘Connectivity to 61.139.2.69:80 is not reachable’ }}