Skip to content

Instantly share code, notes, and snippets.

View dollarkillerx's full-sized avatar
:shipit:
Co

Dollarkillerx dollarkillerx

:shipit:
Co
  • Tarlogic Security
  • 35.71569827,139.67271411
View GitHub Profile
@dollarkillerx
dollarkillerx / finding.job
Created March 17, 2020 12:40
Finding a new job
+--------------------+
| Finding a new job. |
+--------------------+
@dollarkillerx
dollarkillerx / img_colo.go
Created March 21, 2020 02:00
Go图片覆盖(图片加水印)(图片伸缩)(图片压缩)
/**
*@program: data-exfiltration
*@description: https://github.com/dollarkillerx
*@author: dollarkiller [dollarkiller@dollarkiller.com]
*@create: 2020-03-21 09:29
*/
package main
import (
"fmt"
@dollarkillerx
dollarkillerx / 模式匹配PatternMatching.md
Last active March 24, 2020 09:38
模式匹配PatternMatching

Naive朴素算法(暴力枚举)

场景

对大批量消息监控 发现违禁词 进行屏蔽

要点:

  • 消息多,每个消息体也大
  • 违禁词 也多

golang实现: 这个实现有点傻请君见谅

@dollarkillerx
dollarkillerx / 分布式系统基础理论.md
Last active March 24, 2020 09:38
分布式系统基础理论

分布式理论篇 面试吹牛必备

为什么开这个篇章,想让大家都了解下分布式背后的实现CAP理论 go的招聘大多要分布式和微服务经验 不会这个这么拿到高工资呢 (●'◡'●)

@dollarkillerx
dollarkillerx / grpc-gateway-build-error.md
Created March 24, 2020 12:02
grpc-gateway 编译的一些问题

grpc-gateway 编译的一些问题

grpc-gateway 是grpc的扩展工具 我安装玩protoc cli 参考grpc-gateway 的文档

build:
	protoc -I/usr/local/include -I./proto \
	-I$$GOPATH/src -I$$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
  	-I$$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway \
	--go_out=plugins=grpc:../pb \
	proto/*.proto
@dollarkillerx
dollarkillerx / 统计go方法耗时.md
Created March 28, 2020 15:31
统计go方法耗时
package main

import (
    "fmt"
    "time"
)

func StartCac() {
 t1 := time.Now() // get current time
@dollarkillerx
dollarkillerx / mongo统计.md
Last active March 29, 2020 02:18
mongo统计.md

机器:

4G DDR4 2400
4C8C Ryzen5 3500H

数据插入

插入25557752耗时232s 其中有几次插入耗时30s 平均2~3s 每次插入50w条数据

数据查询:

db.getClooection("ip").limit(100000).skip(0);

@dollarkillerx
dollarkillerx / Go数据结构实现.md
Last active March 30, 2020 02:41
Go数据结构实现

Go数据结构实现

@dollarkillerx
dollarkillerx / 获取IP地址和域名解析.md
Created April 2, 2020 01:45
获取IP地址和域名解析

获取IP地址和域名解析

IP 地址类型 在 net 包中,IP 地址类型被定义成一个 byte 型数组,即若干个 8 位组,格式如下:

type IP []byte

在 net 包中,有几个函数可以将 IP 地址类型作为函数的返回类型,比如 ParseIP() 函数,该函数原型定义如下:

func ParseIP(s string) IP
@dollarkillerx
dollarkillerx / cird.md
Last active April 2, 2020 05:37
golang 生成IP列表
package test

import (
	"fmt"
	"net"
	"testing"
)

func Cidr(cidr string) ([]string, error) {