Code Monkey home page Code Monkey logo

23233.github.io's Introduction

23233.github.io's People

Contributors

23233 avatar

Watchers

 avatar

23233.github.io's Issues

python版本的请求与golang版本的请求差别

对于query的escape处理策略不同

  • python 如果使用 urllib.parse.quote 默认会有一个safe 其中对于 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-~/ 这些字符默认是不进行转换的.
  • golang 使用 url.QueryEscape 默认是会把所有的符号和字符都会序列化 因为按照要求http标准的要求是要保证query没有特殊字符的
  • 但是这点在进行一些爬虫业务时候特别不友好 其中以 / 被序列化最为致命 所以在golang中可以使用以下方法进行序列化保证与python的一致
func CustomQueryEscape(s string) string {
	// 定义不需要转义的字符
	safeChars := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.-~/"

	// 创建一个字符串构建器
	var escaped strings.Builder

	// 遍历字符串中的每个字符
	for _, char := range s {
		// 如果字符在 safeChars 中,则直接添加到结果中
		if strings.ContainsRune(safeChars, char) {
			escaped.WriteRune(char)
		} else {
			// 否则,使用 url.QueryEscape 对字符进行编码
			escaped.WriteString(url.QueryEscape(string(char)))
		}
	}

	return escaped.String()
}

请求的区别

  • 如果使用requests 默认就是http1 因为没有http2
  • 而golang默认就是http2 自动协商的

nginx proxy manager 也就是npm如何重设密码以及忘了用户名如何找到用户名

本教程仅适用于使用docker部署

重设密码

这里面有两个镜像 一个是官方的 一个是 jlesage的 对比其中的话 jlesage 有快捷工具

官方镜像使用mysql

docker exec -it nginx-proxy-manager sh
mysql -u root -p
use nginxproxymanager;
UPDATE user SET is_deleted=1;

jlesage的镜像

 /opt/nginx-proxy-manager/bin/reset-password [email protected] newpassword

忘记邮箱/用户名

使用mysql

docker exec -it nginx-proxy-manager sh
mysql -u root -p
use nginxproxymanager;
select * from user;

使用sqlite

直接通过docker 把sqlite的db映射出去 然后随便拿一个软件 打开sqlite 就能看到 没加密

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.