自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(36)
  • 资源 (1)
  • 收藏
  • 关注

原创 2020-09-24

jmeter

2023-02-17 09:59:01 116

原创 Web for Pentester II安装时网络模式选择

物理机一直访问不了Web for Pentester II虚拟机环境,偶然参考以下内容,把虚拟机设置为桥接模式,竟然就搞定了!如果物理机是自动分配,就说明物理机本身处于子网(如IP为192.168.*.*),那可以选用桥接方式,虚拟机设为同网段的一个未用IP。如果物理机为固定MAC绑定IP,那就用NAT模式,虚拟机也选用DHCP自动分配。...

2023-02-17 09:55:51 181 1

原创 Mac下PyCharm快捷键

Mac键盘符号和修饰键说明⌘ Command ⇧ Shift ⌥ Option ⌃ Control ↩︎ Return/Enter ⌫ Delete ⌦ 向前删除键(Fn+Delete) ↑ 上箭头 ↓ 下箭头 ← 左箭头 → 右箭头 ⇞ Page Up(Fn+↑) ⇟ Page Down(Fn+↓) Home Fn + ← End Fn + → ⇥ 右制表符(T...

2023-02-17 09:54:54 903 1

原创 [: 0: unexpected operator

[: 0: unexpected operator

2022-07-19 09:57:56 418 1

原创 控制台执行python脚本报错问题:ModuleNotFoundError: No module named ‘xxx‘

报错日志:Traceback (most recent call last):File "/Users/xxx/xxx/Project/python/xxx/xxx_req/xxx.py", line 15, in <module>from xxx import xxx_pb2_grpc, xxx_pb2ModuleNotFoundError: No module named 'xxx'from xxx import xxx_pb2_grpc, xxx_pb2Modu

2021-12-31 11:39:32 740

原创 python3 grpc client添加metadata方式

metadata = [('xx-service','xxx_test')]stub = xxx_pb2_grpc.xxxStub(channel)request_data = xxx_pb2.Requestxxx(xxx_id=12345678, xxx_model="小")print(type(request_data))print(request_data)response = stub.xxx(request_data, metadata=metadata)

2021-12-21 20:13:41 660

原创 python3 grpc client 调用go grpc server的一种方式

第一步:安装依赖包googleapis-common-protos==1.54.0grpcio==1.42.0grpcio-tools==1.42.0protobuf==3.19.1six==1.16.0pip3.9 install grpcio pip3.9 install grpcio-toolspip install googleapis-common-protos第二步:写client# coding=utf-8ixxxort jsonixxxort g

2021-12-21 17:46:43 956

原创 django单元测试

可以用django自带脚本manage.py驱动执行例如:venv/bin/python3 manage.py TestService单元测试源码如下:from django.core.management.base import BaseCommandfrom xxx.services.user.UserService import UserServicefrom xxx.services.record.RecordService import RecordService.

2021-12-17 11:56:15 536

原创 django orm常见错误raise AppRegistryNotReady(“Apps aren‘t loaded yet.“)RuntimeError: Model class models等等

错误一:ValueError: Cannot assign "<QuerySet [<User: user>]>": "SwitchRecord.user_id" must be a "User" instance.原因:# 外键django用户idclass SwitchRecord(models.Model): user_id = models.ForeignKey('User', on_delete=models.SET(0))解决方法:传入.

2021-12-17 11:51:45 1396

原创 mac gcc在哪

mac gcc在哪执行:which gcc即可

2021-10-18 16:27:01 418

原创 django3.1发送邮件指定html正文:content_subtype = “html“

django3.1发送可替换内容类型在电子邮件中包含多个版本的内容可能很有用; 经典的例子是同时发送消息的文本格式版本和HTML格式版本。 Django的电子邮件库的EmailMultiAlternatives类可实现该功能。 作为EmailMessage的子类,它有一个attach_alternative()方法,用于在电子邮件中包含邮件正文的其它版本。它的所有其他方法(包括类初始化)直接继承EmailMessage。可以这样发送文本和HTML的组合:from django.core..

2021-06-01 11:50:35 234

原创 python字符串转成字典报错原因,必须使用单引号’‘

2021-05-31 11:12:45 520

原创 crontab+shell定时执行pytest

pytest必须使用绝对路径11 9 * * * sh /xxx.sh /xxx/xxx.html /xxx/usr/local/bin/pytest /xxx/xxxx

2021-04-27 15:35:26 248

原创 zookeeper安装报错:mkdir: illegal option -- e

报错日志:-e /tmp/zookeeper echo /tmp/zookeepermkdir: illegal option – eusage: mkdir [-pv] [-m mode] directory …-e /tmp/zookeeper echo /tmp/zookeeper/zookeeper_server.pid-n Starting zookeeper …zkServer.sh: line 176: -e /tmp/zookeeperecho /tmp/zookeeper/z

2020-12-14 18:59:13 964

原创 mac 安装nsq无法启动问题,版本不匹配

mac 安装nsq 先看go版本go versiongo version go1.10 darwin/amd64再安装对应的包

2020-12-14 16:08:04 152

翻译 python3读取txt行

1:readline() 1 2 3 4 5 6 7 file = open("sample.txt") while 1: line = file.readline() if not line: break pass # do something file.close() 一行一行得从文件读数据,显然比较慢;不过很省内存;测试读10M的sa...

2020-10-19 17:12:52 667

原创 jmeter常量吞吐定时器5QPS

稳定在100qps:

2020-09-24 21:18:29 358

原创 webtest遇到的问题window.navigator.webdriver如何设置为undefined

window.navigator.webdriver如何设置为undefined# 设置开发者模式options = webdriver.ChromeOptions()# 此步骤很重要,设置为开发者模式,防止被各大网站识别出来使用了Seleniumoptions.add_experimental_option('excludeSwitches', ['enable-automation'])# driver = webdriver.Chrome(options=options)bro.

2020-07-31 21:10:28 1282 1

原创 u盘大白菜装系统步骤

华硕主板f8u盘启动

2020-01-18 10:46:34 171

原创 python3占位符后跟浮点型保留小数位数意义%0.2f

要保留两位该用%0.2f这个点是区分宽度和几位小数而已,不是真正的小数点;即%a.bf表示宽度为a,若超出按照实际的来;b表示有b位小数

2019-07-18 11:34:53 7341

原创 ModuleNotFoundError: No module named 'HelloWorld.TestModel'解决方法

工程目录结构如下:└── HelloWorld ----------必须以此为工程根目录打开,即可解决报错 ├── HelloWorld │├── __init__.py │├── __pycache__ ││├── __init__.cpython-36.pyc ││├── settings.cpython-36...

2019-06-21 15:01:51 7332 1

原创 解决jmeter 请求参数中文乱码

本地存储的txt文件编码格式不对,检查是否是标准的utf-8编码文本。 

2018-11-08 10:58:41 1292 1

转载 ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

Traceback (most recent call last):File "/home/xiaoduc/.pyenv/versions/3.5.0/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 228, in _error_catcheryieldFile "/ho...

2018-08-08 19:54:46 26659 4

原创 redhat7.0系统配置lamp环境,Navicat远程连接mysql报错:2003-can't connect to mysql server on ' ' (10060)解决方案

报错:2003-can't connect to mysql server on ' ' (10060)一、分析原因:防火墙关闭了mysql服务,禁止远程访问mysql二、解决方法:关闭防火墙:systemctl stop firewalld.service             #停止firewallsystemctl disable firewalld.service        #禁止f...

2018-06-16 12:13:08 524

转载 linux上安装Mutillidae

XAMPP:下载地址(https://www.apachefriends.org/download.html)Mutillidae:下载地址(http://sourceforge.net/projects/mutillidae/)首先安装XAMPP1.  下载完成2.  cd Downloads3.  chmod +x xampp-linux-x64-5.6.12-0-installer.run4...

2018-06-13 23:25:26 796 1

原创 Windows系统hackazon安装过程,访问http://localhost/install页面404的解决办法

1、修改wamp64\bin\apache\apache2.4.33\conf目录下的httpd.conf文件为:DocumentRoot "C:/home/hackazon/web/"&lt;Directory "C:/home/hackazon/web/"&gt;2、有些Apache版本还需要做如下修改:\wamp\bin\apache\apache2.4.9\conf\extra目录中文件:...

2018-06-07 15:43:17 1201

原创 python爬取ajax请求,返回的json数据格式化报错json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

python爬取ajax请求,返回Json数据中带有&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;prestyle="word-wrap: break-word; white-space: pre-wrap;"&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;标签解决方

2018-05-25 20:32:46 45943

原创 python爬虫访问https网站报错解决方案ERROR:ssl_client_socket_impl.cc(1098)] handshake failed

报错信息:[3488:1356:0512/211222.342:ERROR:ssl_client_socket_impl.cc(1098)] handshake failed; returned -1, SSL error code 1, net_error -101Chrome浏览器解决方案:from selenium import webdriverif __name__ == '__mai...

2018-05-12 21:10:34 38891 2

原创 python核心编程,使用了twisted.internet类创建一个简单的半双工聊天程序

Server部分:'''Created on 2018年5月6日一个时间戳TCP服务器,他使用了twisted.internet类@author: Administrator'''from twisted.internet import protocol,reactorfrom time import ctimefrom hexinbiancheng.utils.tsTclntEntity imp...

2018-05-06 23:14:44 434

原创 正则表达式中的?表示匹配前面的正则表达式0次或者1次

"""匹配所有能够表示Python整数的字符串集"""patt = '[-+]?\d+' # "?"代表前面的正则表达式匹配0次或者1次m = re.match(patt,'98654')if m is not None: print(m.group())...

2018-05-04 17:11:34 24388

原创 AttributeError: 'callable_iterator' object has no attribute 'next',python3中迭代器的next()方法已变成__next__()

报错信息:Traceback (most recent call last):  File "F:/unit1/01_03.py", line 149, in &lt;module&gt;    g = it.next()AttributeError: 'callable_iterator' object has no attribute 'next'解决办法:将上述代码中调用next()的地方全...

2018-04-30 15:10:29 7120 2

原创 Specifying a namespace in include() without providing an app_name is not supported.

报错信息:Specifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_na...

2018-04-27 14:18:33 332

原创 编码错误UnicodeDecodeError at / 'utf-8' codec can't decode byte 0xb1 in position 30: invalid start byte

类似这种UnicodeDecodeError at / 'utf-8' codec can't decode byte 0xb1 in position 30: invalid start byte编码错误,分析解决方案如下:1、查看控制台报错,找出引发错误的文件,任何程序员自己编写的文件都可能存在编码不一致(统一utf-8为例)的问题2、去notepad+中,把引发错误的文件转换编码,格式-&g...

2018-04-26 00:11:59 2100

原创 eclipse+pydev 导入已有的Django项目

方法:1、打开eclipse,创建与需要导入的项目相同的项目名称,例如:项目名称为learning_log2.本地已有Django工程目录截图:3、打开eclipse创建的django工程本地目录:4、把步骤2标记的文件复制替换对应步骤3中的文件,重启eclipse即可...

2018-04-25 22:45:00 815

原创 Django学习官网指导文档:使用models.ForeignKey时python3.7一定要传入实参on_delete=models.CASCADE

网址:https://docs.djangoproject.com/en/2.0/Fields模型中最重要的部分——以及模型中唯一需要的部分——是它定义的数据库字段列表。字段由类属性指定。注意不要选择与模型API冲突的字段名称,如清除、保存或删除。from django.db import modelsclass Musician(models.Model): first_name =...

2018-04-25 20:35:57 3053

转载 Powershell直接脚本时出现无法加载文件因为在此系统中禁止执行脚本问题的解决方法

在Powershell直接脚本时会出现:无法加载文件 ******.ps1,因为在此系统中禁止执行脚本。有关详细信息,请参阅 "get-help about_signing"。 所在位置 行:1 字符: 17 + E:\Test\test.ps1 &lt;&lt;&lt;&lt; + CategoryInfo : NotSpecified: (:) [], PSSecurityException ...

2018-04-24 22:33:38 2204

标准txt文本备用文件

解决jmeter 请求参数中文乱码,标准的utf-8编码文本。

2018-11-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除