263

263

V2EX 第 111351 号会员,加入于 2015-04-16 22:29:22 +08:00
不迫,出点东西。。。。
  •  1   
    二手交易  •  263  •  2020-08-25 17:23:07 PM  •  最后回复来自 wzq001
    8
    迫生,出点东西。
    二手交易  •  263  •  2019-05-16 16:16:35 PM  •  最后回复来自 ybz
    1
    魔都出个 iPhone 6 plus 64G 深空灰+罗技 MX MASTER
    二手交易  •  263  •  2016-05-05 22:31:44 PM  •  最后回复来自 bleaker
    7
    263 最近回复了
    2 天前
    回复了 tpxcer 创建的主题 宽带症候群 我上海电信上传好像 QOS 了
    上海电信,不是精品网和海外加速套餐,一直都有 QOS 的,并且是随机的,时好时坏。
    2 天前
    回复了 miaosl 创建的主题 Linux 怎么 zabbix 这么费劲啊,我要气哭了
    看你的参数,只有 HostnameItem ,没有 Hostname ,这是不正确的配置。
    zabbix 建议即使设置了 HostnameItem=system.hostname ,也需要是指正确的 Hostname= mha0 。HostnameItem=system.hostname 是用来指定获取 hostname 的方法,而不是设置 hostname 。
    agent 的部署推荐使用 ansible 等来批量部署,直接获取系统变量填写,不要使用 HostnameItem=system.hostname 这种方式
    普通版现在只能导 180 天,想要导出一年只能付费。或者之前就每 180 天导出备份一次
    skip_name_resolve
    import subprocess
    import requests


    def get_otp(dynamic_code):
    api_url = 'https://api.example.com/get_otp'
    response = requests.post(api_url, json={'dynamic_code': dynamic_code})
    return response.json()['otp']


    ssh_process = subprocess.Popen(
    ['ssh', '[email protected]'],
    stdin=subprocess.PIPE,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    universal_newlines=True,
    )

    dynamic_code = ''
    while True:
    output = ssh_process.stdout.readline()
    if 'Dynamic code:' in output:
    dynamic_code = output.split('Dynamic code:')[1].strip()
    break

    otp = get_otp(dynamic_code)

    ssh_process.stdin.write(f'{otp}\n')
    ssh_process.stdin.flush()

    while True:
    output = ssh_process.stdout.readline()
    print(output.strip())
    if 'Last login:' in output:
    print("登录成功!")
    break
    elif 'Permission denied' in output:
    print("登录失败!")
    break

    ssh_process.stdin.close()
    ssh_process.stdout.close()
    ssh_process.stderr.close()


    CLAUDE 3.5 SONNET
    import paramiko
    import hashlib
    import base64
    import getpass

    def get_host_key_fingerprint(hostname, port=22):
    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    try:
    client.connect(hostname, port=port, username='dummy', password='dummy')
    except:
    pass

    key = client.get_transport().get_remote_server_key()
    fingerprint = hashlib.sha256(key.get_fingerprint()).hexdigest()

    client.close()
    return ':'.join(a+b for a,b in zip(fingerprint[::2], fingerprint[1::2]))

    def ssh_login_with_otp(hostname, username, password, otp_func):
    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

    # 获取 fingerprint
    fingerprint = get_host_key_fingerprint(hostname)
    print(f"Host key fingerprint: {fingerprint}")

    # 验证 fingerprint
    if input("Verify fingerprint (y/n): ").lower() != 'y':
    print("Fingerprint verification failed")
    return

    # 获取动态密码
    otp = otp_func()

    try:
    client.connect(hostname, username=username, password=password+otp)
    print("Login successful!")

    # 执行命令
    stdin, stdout, stderr = client.exec_command('ls -l')
    print(stdout.read().decode())

    except Exception as e:
    print(f"Login failed: {str(e)}")

    finally:
    client.close()

    # 模拟获取动态密码的函数
    def get_otp():
    return input("Enter OTP: ")

    # 使用示例
    hostname = 'example.com'
    username = 'your_username'
    password = getpass.getpass("Enter password: ")

    ssh_login_with_otp(hostname, username, password, get_otp)


    gpt yyds
    11 天前
    回复了 HeiHeiDe 创建的主题 问与答 iOS 游戏 APP 接入实名认证
    首先你要有版号、软著,然后接入中宣部实名认证系统
    https://developers.weixin.qq.com/community/minigame/doc/000ecaf1354190701d0c53f7a5b401
    电信换新设备了,老的还没完全下架,目前可以通过 PPPoE Scan 查看对端设备,如果有多个设备,可以指定 AC Name 拨号,还能获取到老的 IP 段。
    iTop
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1125 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 14ms · UTC 23:42 · PVG 07:42 · LAX 16:42 · JFK 19:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.