- 博客(8)
- 收藏
- 关注
原创 golang 3DES加解密示例
package mainimport ( "bytes" "crypto/cipher" "crypto/des" "encoding/base64" "fmt")func main() { const inputData = `{"aaa": "111", "bbb": "222"}` const des3key = "lk3u2w17jc3TSA8QOn7AfaiT" fmt.Println("原始数据:", inputData) //加密 result, _ := Tri
2021-10-12 17:00:28
733
原创 grep查询日志上下文
grep查询日志上下文grep单独使用grep -C 5 'xxxxx' ***.log # 匹配到xxxxxx内容+前5行+后5行grep -B 5 'xxxxx' ***.log # 匹配到xxxxxx内容+前5行grep -A 5 'xxxxx' ***.log # 匹配到xxxxxx内容+后5行配合tail一起使用tail -n 10000 log/***.log | grep -C 5 'xxxxx' # 匹配到xxxxxx内容+前5行+后5行tail -n 100
2021-06-17 16:54:39
1323
原创 Python继承+单例模式
两个类如果需要相同的初始化,而且都是单例模式,但是又有自己的区别,那么都继承一个基类,子类自己做单例模式。比如像连两个地址的MySQL,基本的查询、插入等方法都可以写到基类里,两个地址的MySQL都继承该基类同时可以有自己的单例模式,互不影响。# 基类class People(object): def __init__(self, arg="Single"): print(arg) def speak(self): print("hello")#
2021-03-28 08:40:11
651
原创 使用Python向mysql导.sql、.xlsx、.csv方法
import pymysqlimport pandasfrom subprocess import Popenfrom sqlalchemy import create_engineimport pandas as pd# 导入sql数据 def mysql_import(self, relative_file_path): # sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin cmd = "mys
2021-03-25 16:31:38
209
原创 Python代码格式化工具-Black
Black是facebook提供的一个python formatter工具,为规范、统一代码风格,建议大家统一安装并配置,git地址:https://github.com/psf/black1、安装Black
2021-01-25 17:02:10
1577
原创 nginx出现504 Gateway Time-out
问题nginx访问出现504 Gateway Time-out常见原因:程序在处理大量数据,接口超过1分钟(默认的)未返回数据,导致等待超时。出现这种情况,我们可以先优化程序,缩短执行时间。可以调大nginx超时限制的参数,使程序可以正常执行。解决方法nginx配置nginx.conf中,设置以下几个参数,增加超时时间配置:如果使用了Nginx的代理,可以在块里加上下面三个配置:location /foo { proxy_pass http://xxx.xxx.xxx...
2020-10-22 17:56:45
2878
3
墨菲安全Jetbrains插件
2022-09-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人