编程日志 | nohup.net

实践是检验真理的唯一标准

mysql的binlog同步解析工具canal

传送门:

https://zhuanlan.zhihu.com/p/177001630


python命令行操作:Click包

这个包确实方便开发python命令行工具。就算不开发,如果真碰到命令行工具是用这个写的,也可以有所积累。

https://blog.csdn.net/liuweiyuxiang/article/details/106872954

iptables正确打开和关闭姿势

1) 重启后生效 

开启: chkconfig iptables on 

关闭: chkconfig iptables off 


2) 即时生效,重启后失效 

开启: service iptables start 

关闭: service iptables stop 



元数据治理平台

第一代:

https://github.com/akhandoker/WhereHows

第二代:

关于递归

前言

递归是算法中一种非常重要的思想,应用也很广,小到阶乘,再在工作中用到的比如统计文件夹大小,大到 Google 的 PageRank 算法都能看到,也是面试官很喜欢的考点

最近看了不少递归的文章,收获不小,不过我发现大部分网上的讲递归的文章都不太全面,主要的问题在于解题后大部分都没有给出相应的时间/空间复杂度,而时间/空间复杂度是算法的重要考量!递归算法的时间复杂度普遍比较难(需要用到归纳法等),换句话说,如果能解决递归的算法复杂度,其他算法题题的时间复杂度也基本不在话下。另外,递归算法的时间复杂度不少是不能接受的,如果发现算出的时间复杂度过大,则需要转换思路,看下是否有更好的解法 ,这才是根本目的,不要为了递归而递归!

ip138转ipplus360的适配接口

更换数据提供服务商,较少代码修改成本,来个适配器不是美滋滋?

# -*- coding: utf-8 -*-
import requests
from flask import Flask, request, Response
import json


app = Flask(__name__)
app.config['JSON_AS_ASCII'] = False
# https://api.ip138.com/ip/?callback=jQuery19009134867113191836_1676369680238&ip=&oid=57263&mid=116495&token=XXXXXXXXXXXXXXXXXXXXXXXX&_=1676369680239
@app.route('/ip/', methods=['GET'])
def copy138():
    callback = request.args.get("callback")
    # ip = request.remote_addr
    ip = "0.0.0.0"
    key = request.args.get("token")
    r = requests.get("https://api.ipplus360.com/ip/geo/v1/district/?ip="+ip+"&key="+key)
    result = r.json()
    r.close()
    print(result)

    orignal_data = result["data"]
    custom_data = { "ret":"ok",
                    "ip": ip,
                    "data": [orignal_data["country"],
                            orignal_data["prov"].replace("省", ""),
                            orignal_data["city"].replace("市", ""),
                            orignal_data["district"],
                            orignal_data["isp"],
                            orignal_data["adcode"],
                            ""]}
    # {"ret":"ok","ip":"0.0.0.0","data":["中国","河南","郑州","管城","电信","450000","0371"]}
    
    return Response(callback+"("+json.dumps(custom_data, ensure_ascii=False)+")",
        content_type='application/json; charset=utf-8')


if __name__ == "__main__":
    app.run(
    host = '0.0.0.0',
    port = 80,
    debug = True
)

阿里Quick BI各种可视化图表

数据可视化,是个科学研究分支,不同类型的数据用不同类型的图来展示。

那么常见的图表有哪几类的,大差不差,一睹为快。

https://help.aliyun.com/document_detail/53072.html

报错Host is blocked because of many connection errors. Unblock with mysqladmin flush hosts.

一个英文回答,意思就不翻译了,也很好懂。

Solution:

The error faced while creating a MySQL data source "Database Reported: Null message from the server. Host is blocked because of many connection errors. Unblock with mysqladmin flush hosts" is a database side error and occurs due to multiple connections created while connecting the database. To resolve the above error, you need to execute "Flush hosts " command. You can execute the command as per below syntax.

tcp三次握手丢包后会发生什么(转)

扫描工具中,有些工具为了提高扫描速度,故意不处理三次握手,通过两次握手即达到了目的。

那么会发生什么?平常其实也不好观察,但是通过iptables设置包过滤,即可比较清楚的观察到。


测试工具

本片文章会用到以下工具来学习tcp三次握手:


tcpdump,一个运行在用户态的应用程序,它本质上是通过调用 libpcap 库的各种 api 来实现数据包的抓取功能。数据包到达网卡后,经过数据包过滤器(BPF)筛选后,拷贝至用户态的 tcpdump 程序,以供 tcpdump 工具进行后续的处理工作,输出或保存到 pcap 文件。我们用tcpdump来抓取三次握手的报文

如何通俗地解释什么是网桥?(知乎)

网桥这个计算机网络概念,从大学出现到未来10年的工作中。这个概念总是懵里懵逼,这次又碰到了,继续看看吧。

知乎有个回答,各路高手百花齐放。

https://www.zhihu.com/question/67473683

其中有个回答,言简意赅,一语中的。

<< 1 2 3 4 5 > >>

Powered By Z-BlogPHP 1.7.2

© 2013-2022 nohup.net , All Rights Reserved. 豫ICP备20020372号-1