Skip to content

Instantly share code, notes, and snippets.

View Ehco1996's full-sized avatar
🎯
Brick Master

Ehco Ehco1996

🎯
Brick Master
View GitHub Profile
@Ehco1996
Ehco1996 / bash-cheatsheet.sh
Created October 25, 2017 00:31 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@Ehco1996
Ehco1996 / sqlrewriter.go
Created August 14, 2019 13:50
过滤掉除了select之外的语句,并且将所有select的语句加上/修改成 `limit 1`
package main
import (
"fmt"
"log"
"strings"
"github.com/pingcap/parser"
"github.com/pingcap/parser/ast"
"github.com/pingcap/parser/format"
@Ehco1996
Ehco1996 / 📊 Weekly development breakdown
Last active September 4, 2021 01:42
瞅瞅这周我都做了什么
Go 22 hrs 19 mins █████████████▊░░░░░░░ 65.9%
Python 2 hrs 44 mins █▋░░░░░░░░░░░░░░░░░░░ 8.1%
Bash 2 hrs 34 mins █▌░░░░░░░░░░░░░░░░░░░ 7.6%
YAML 2 hrs 18 mins █▍░░░░░░░░░░░░░░░░░░░ 6.8%
Makefile 1 hr 52 mins █▏░░░░░░░░░░░░░░░░░░░ 5.5%
@Ehco1996
Ehco1996 / redact_dm_log.py
Last active August 26, 2021 01:08
给 DM worker 的 log 脱敏
import sys
def redact_log(file_name):
new_file_name = file_name + ".redacted.log"
print("start to redact_log file=", file_name, "new file=", new_file_name)
f1 = open(file=file_name, mode="r")
f2 = open(file=new_file_name, mode="w")
for line in f1.readlines():
if "argument" in line: