首页
在线工具
统计
Search
1
创建自签名 ssl 证书
140 阅读
2
Windows 11还原右键经典菜单
101 阅读
3
全国DNS服务器IP
77 阅读
4
typecho添加打赏功能
75 阅读
5
躲避校园网客户端的检测实现移动热点开启
72 阅读
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
登录
Search
标签搜索
Huawei
HCNA
web
Linux
Python
PC
Blog
Network
Virus
DNS
LOVE
Docker
typecho
MySQL
HCNP
Smilinghan
累计撰写
46
篇文章
累计收到
10
条评论
首页
栏目
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
页面
在线工具
统计
搜索到
15
篇与
的结果
2023-06-04
使用 pyi-set_version 为 Python EXE 文件添加版本信息的方法
在开发软件时,为了方便用户了解软件的版本信息,我们通常会在软件的可执行文件(EXE 文件)中添加版本号等信息。而在 Python 开发中,我们可以使用 pyi-set_version 工具来为 EXE 文件添加版本信息。1. 要使用 pyi-set_version ,您需要先安装PyInstaller。您可以使用pip来安装它。在命Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 准备我们的 本版内容文件 可以引荐我之前的发布的模板 从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息3. 我们需要在 Windows终端 中进入您要添加版本的程序目录下,执行以下命令操作:pyi-set_version file_version_info.txt yourprogramname.exe打开程序的属性在详细信息就可以查看我们添加的版本信息了。
2023年06月04日
10 阅读
0 评论
1 点赞
2023-06-04
从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息
1. 要使用pyi-grab_version,您需要先安装PyInstaller。您可以使用pip来安装它。在Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 我们需要在 Windows终端 中进入您要获取版本的程序目录下,执行以下命令操作。pyi-grab_version yourprogramname.exe3.当命令执行完成后,会在目录下生成一个file_version_info.txt名称的文件。# UTF-8 # # For more details about fixed file info 'ffi' see: # http://msdn.microsoft.com/en-us/library/ms646997.aspx VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. filevers=(1, 0, 0, 0), prodvers=(1, 0, 0, 0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x16, # Contains a bitmask that specifies the Boolean attributes of the file. flags=0x0, # The operating system for which this file was designed. # 0x4 - NT and there is no need to change it. OS=0x40004, # The general type of file. # 0x1 - the file is an application. fileType=0x1, # The function of the file. # 0x0 - the function is not defined for this fileType subtype=0x0, # Creation date and time stamp. date=(0, 0) ), kids=[ StringFileInfo( [ StringTable( '080404b0', [StringStruct('CompanyName', 'Smilinghan'), StringStruct('FileDescription', 'Smilinghan-PC'), StringStruct('FileVersion', '1.0.0.0'), StringStruct('InternalName', 'Smilinghan-PC.exe'), StringStruct('LegalCopyright', 'Copyright (C) 2023-2023 by Smilinghan (nihaotang.com)'), StringStruct('OriginalFilename', 'Smilinghan-PC'), StringStruct('ProductName', 'Smilinghan-PC'), StringStruct('ProductVersion', '1.0.0.0')]) ]), VarFileInfo([VarStruct('Translation', [2050, 1000])]) ] )
2023年06月04日
7 阅读
0 评论
1 点赞
2023-05-11
爬取图片
爬取星巴克图片但是后面无法下载!from bs4 import BeautifulSoup import urllib.request import os url = 'https://www.starbucks.com.cn/menu/' try: response = urllib.request.urlopen(url) except: print("Error: 无法检索到 URL") exit() content = response.read().decode('utf-8') soup = BeautifulSoup(content, 'lxml') image_list = [(a.find('div', class_='preview')['style'].split('url("')[1].split('")')[0], a.find('strong').text) for a in soup.find_all('a', class_='thumbnail')] folder_path = os.path.join(os.getcwd(), "starbucks") if not os.path.isdir(folder_path): os.makedirs(folder_path) for url, name in image_list: try: urllib.request.urlretrieve(url="https://www.starbucks.com.cn" + url, filename=os.path.join(folder_path, name + '.jpg')) except: print(f"Error: 无法检索到 {name}")
2023年05月11日
30 阅读
2 评论
2 点赞
2023-05-10
Python爬取 淘票票信息
刚入手还没捂热的爬虫,如有不足的地方望大佬指点一番import urllib.request import json import re url = 'https://dianying.taobao.com/showAction.json?_ksTS=1683089742953_64&jsoncallback=jsonp65&action=showAction&n_s=new&event_submit_doGetSoon=true' headers = { 'accept':' text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01', 'accept-language':' zh-CN,zh;q=0.9,en;q=0.8', 'cookie':' ', 'referer':' https://dianying.taobao.com/?spm=a1z21.3046609.city.222.32c0112alijvBz&city=441800', 'user-agent':' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36', 'x-kl-ajax-request':' Ajax_Request', 'x-requested-with':' XMLHttpRequest', } request = urllib.request.Request(url=url, headers=headers) response = urllib.request.urlopen(request) content = response.read().decode('utf-8') # 使用正则表达式提取 JSON 数据 match = re.search(r'\((.*)\)', content) json_data = match.group(1) # 将JSON数据写入文件 with open('D:\\taopiaopiao.json', 'w', encoding='utf-8') as fp: json.dump(json.loads(json_data), fp, ensure_ascii=False) # 从文件中加载 JSON 数据 with open('D:\\taopiaopiao.json', 'r', encoding='utf-8') as fp: obj = json.load(fp) # 打印演出名称和演出时间 for item in obj['returnValue']: print(item['showName'], ":", item['openDay'])
2023年05月10日
14 阅读
0 评论
3 点赞
2023-04-08
pygame 添加背景音乐
from pygame import mixer if __name__ == '__main__': # 音频文件路径 Mp4Path = r"./music/jijitaimei.mp3" mixer.init() # 加载音乐 mixer.music.load(Mp4Path) mixer.music.play(start=0.0) # 音乐停止播放 mixer.music.stop()
2023年04月08日
16 阅读
1 评论
0 点赞
2023-02-15
docker 安装出现 [Errno 14] HTTPS Error 404 - Not Found
在使用上篇部署 docker 文章命令过程中,在tencentos server 中出现报错!搞拢了半天发现 docker 一个YUM存储库文件有问题.解决办法:1. 打开编辑配置文件.vim /etc/yum.repos.d/docker-ce.repo2. 找到这个位置,并找到 [docker-ce-stable] 这个位置. 3. 把 baseurl=https://download.docker.com/linux/centos/$releasever/$basearch/stable 替换一下的地址:baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
2023年02月15日
57 阅读
0 评论
1 点赞
2023-01-11
Windows 11还原右键经典菜单
在更新Windows 11之后,改动了不少功能,其中右键菜单可能是变动最大的一个选项也是影响我们这些已经对经典右键的老油条来说很不适应,特别是需要点击显示更多选项才能展开的骚操作。右击桌面左下角的微标(开始),在弹出菜单中选择 Windows 终端(管理员)粘贴如下命令,回车即可完成设置。此操作会强制重启资源管理器!或者快捷键 win+R 进入运行框,输入cmd 进入命令框输入如下命令!reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f taskkill /F /IM explorer.exe explorer.exe
2023年01月11日
101 阅读
0 评论
4 点赞
2022-12-22
explorer 服务无法正常启动
有很多网友是之前发的黑屏修复不太管用,所以这次是经过官方建议的修复方法Win + R 键打开运行窗口输入 msconfig点击 “服务” 选项卡,勾选 ”隐藏所有 Microsoft 服务”,点击 “全部禁用”点击 “启动” 选项卡,点击 ”打开任务管理器”,然后禁用全部启动项并确定重启电脑DISM 和 SFC 检查工具修复系统:Win + S 键搜索栏输入 CMD 找到 “命令提示符”,右键以管理员身份打开,然后在依次执行以下条命令(需要联网操作):DISM.exe /Online /Cleanup-Image /ScanHealthDISM.exe /Online /Cleanup-Image /CheckHealthDISM.exe /Online /Cleanup-image /Restorehealth无论上面命令是否有显示错误或成功,最后再执行入以下命令:sfc /scannow完成后重启。
2022年12月22日
11 阅读
0 评论
1 点赞
2022-09-14
暴力破解忘记的zip,rar, pdf等文件密码
有时候忘了自己对文件设置的密码,又想不起来,可能就有人就对此文件放弃,但有人就巧妙的利益其他技术暴力破解这里向大家推荐一种利用GPU的算力的破解工具:hashcathttps://github.com/hashcat/hashcatJohn the Ripperhttps://github.com/openwall/john使用用John the Ripper中的工具获取hash,然后用hashcat破解。以test.zip文件为例:然后用john软件获取hash (其它类型文件需要找对应的,比如rar就用zip2john.exe),命令行界面类似于john-1.9.0-jumbo-1-win64\run>zip2john.exe C:\Users\用户名\Downloads\test.zip执行完后得到并提取:隐藏内容,请前往内页查看详情有了哈希值,我们就可以使用 hashcat 进行暴力破解在使用hashcat中我需要使用几个参数:(详细请参考 hashcat wiki ):-a 选择攻击方式,即掩码攻击(有规则约束的暴力穷举)-m 选择攻击模式,针对不同的 hash 算法选择规定的值m 指定文件类型为17225 因为这里是 $pkzip2$可以由 zip2john 提取出的 hash 值分辨出--increment 代表自动增加位数 --increment-max=9 代表最大到9位 。复制 zip2john 得到的哈希值,执行:隐藏内容,请前往内页查看详情注意在 Bash 和 Powershell 中,$ 的含义为变量,需要用单引号括起来才可以使用执行完后:隐藏内容,请前往内页查看详情上面的 smiling 即为密码
2022年09月14日
60 阅读
0 评论
0 点赞
2022-09-03
Centos 部署Docker
Docker是开发人员和系统管理员使用容器开发、部署和运行应用程序的平台。在部署前需配置 yum 源,可以看以前我发过一篇: 小笔记1. 如果你曾经安装过 docker,请先删掉:Fedora/CentOS/RHEL:sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine2. 安装yum-util 依赖sudo yum install -y yum-utils device-mapper-persistent-data lvm23. 下载docker-ce的yum源。阿里镜像:wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo清华镜像(把官方替换成 TUNA):sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.reposudo sed -i 's+download.docker.com+mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo4. 安装Docker更新源sudo yum makecache fast安装sudo yum -y install docker-ce如安装指定版本:sudo yum install docker-ce-20.10.9{lamp/}配置Docker镜像加速1.编辑daemon.jsonvim /etc/docker/daemon.json2.Docker官方提供的中国镜像库{ "registry-mirrors": ["https://registry.docker-cn.com"] }国内其他镜像库(推荐){ "registry-mirrors": [ "https://hub-mirror.c.163.com", "https://mirror.baidubce.com", "https://registry.docker-cn.com", "https://reg-mirror.qiniu.com", "https://dockerhub.azk8s.cn", "https://docker.mirrors.ustc.edu.cn" ] }3.加载配置和重启docker服务systemctl daemon-reloadsudo systemctl enable docker && sudo systemctl start docker验证 Docker 是否安装成功:sudo docker run hello-world{lamp/}Docker进程管理:运行Dockersystemctl start docker停止Dockersystemctl stop docker重启Dockersystemctl restart docker开机自启动Dockersystemctl enable dockerDocker查看运行状态systemctl status dockerDocker查看容器ID。docker ps
2022年09月03日
18 阅读
0 评论
1 点赞
1
2