2018年11月15日
摘要: package main import ( "net/http" "github.com/gin-gonic/gin" ) func response() gin.HandlerFunc { return func(c *gin.Context) { c.Next() if c.Writer.Written() { ... 阅读全文
posted @ 2018-11-15 23:27 漫步的影子 阅读(9229) 评论(0) 推荐(0) 编辑
  2018年10月26日
摘要: 1.开启SSH长连接 openssh版本高于5.6(multiplexing) ControlPersist=5d 设置整改长连接保持5天, 2.开启pipelinling 目标机器需要编辑/etc/sudoers文件 3.开启accelerate模式 使用python在被控机器上运行一个守护进程, 阅读全文
posted @ 2018-10-26 00:09 漫步的影子 阅读(378) 评论(0) 推荐(0) 编辑
  2018年10月18日
摘要: 一行代码实现树结构 from collections import defaultdict def tree() return defaultdict(tree) 阅读全文
posted @ 2018-10-18 23:56 漫步的影子 阅读(198) 评论(0) 推荐(0) 编辑
  2018年3月20日
摘要: In [1]: import docker In [2]: client = docker.from_env(version='1.24', timeout=6) In [3]: # client print(dir(client)) ['__class__', '__delattr__', '__ 阅读全文
posted @ 2018-03-20 23:04 漫步的影子 阅读(223) 评论(0) 推荐(0) 编辑
  2017年9月13日
摘要: snippet/url.py 一、使用基本类视图API snippet/views.py s二、使用Mixins snippet/views.py 三、使用generator基础视图类 snippet/views.py 阅读全文
posted @ 2017-09-13 21:51 漫步的影子 阅读(103) 评论(0) 推荐(0) 编辑
  2017年9月7日
摘要: In [1]: import itertools In [2]: dir(itertools) Out[2]: ['__doc__', '__file__', '__name__', '__package__', 'chain', 'combinations', 'combinations_with_replacement', 'compress', 'count', 'c... 阅读全文
posted @ 2017-09-07 23:57 漫步的影子 阅读(169) 评论(0) 推荐(0) 编辑
摘要: itertools 阅读全文
posted @ 2017-09-07 23:42 漫步的影子 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python # coding: utf-8 import six from functools import partial from itertools import groupby def sort_items_by_key(items, key): result = {} for k, v in key.items(): ... 阅读全文
posted @ 2017-09-07 22:30 漫步的影子 阅读(1416) 评论(1) 推荐(0) 编辑
  2017年8月19日
摘要: 看下list的append和+= 阅读全文
posted @ 2017-08-19 21:16 漫步的影子 阅读(177) 评论(0) 推荐(0) 编辑
  2017年8月18日
摘要: 一、请求对象 二、响应对象 三、状态码 四、装饰API视图 snippets/views.py snippets/urls.py 五、测试 阅读全文
posted @ 2017-08-18 23:04 漫步的影子 阅读(323) 评论(0) 推荐(0) 编辑