-
github上你可以用别人的现成的代码 直接 git clone 即可了
-
然后你也想改代码或者贡献代码咋办?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import os | |
import json | |
cmd = ''' | |
ceph pg dump | awk ' /^pg_stat/ { col=1; while($col!="up") {col++}; col++ } /^[0-9a-f]+\.[0-9a-f]+/ {print $1,$col}' | |
''' | |
body = os.popen(cmd).read() | |
SUM = {} | |
for line in body.split('\n'): |
I want to debug with CodeLLDB on CentOS 7, but get an error like this:
/home/xxx/.vscode/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/xxx/.vscode/extensions/vadimcn.vscode-lldb-1.6.1/adapter/codelldb)
LLDB requires a higher version of glibc.
I get it work by the following steps:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tap "adoptopenjdk/openjdk" | |
tap "grpc/grpc" | |
tap "homebrew/bundle" | |
tap "homebrew/cask", "https://mirrors.ustc.edu.cn/homebrew-cask.git" | |
tap "homebrew/core", "https://mirrors.ustc.edu.cn/homebrew-core.git" | |
tap "homebrew/services" | |
brew "autoconf" | |
brew "automake" | |
brew "bloaty" | |
brew "boost" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""" 文件编码 | |
set fileencodings=utf-8,gbk,gb2312 | |
set termencoding=utf-8 | |
set encoding=utf-8 | |
"""""" 缩进相关 | |
set ts=4 " tabstop 设置tab为4个空格 | |
set sw=4 " shiftwidth 每层缩进4个空格 | |
set expandtab " 输入的tab自动展开为空格. 设置后, 输入TAB, 需要Ctrl-V<TAB> | |
set softtabstop=4 | |
"set smarttab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from __future__ import print_function | |
__doc__ = """ | |
Put it to the machine deploy TiUP and add it to the crontab. | |
e.g. | |
> crontab -e | |
# clean up the patch caches for TiUP every day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from concurrent.futures import thread | |
from random import sample | |
import re | |
import hashlib | |
from pprint import pprint | |
import sys | |
import unittest | |
class Frame: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import json | |
import logging | |
def main(): | |
logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', datefmt='%Y/%m/%d %H:%M:%S', level=logging.INFO) | |
if len(sys.argv) < 2: | |
logging.error("Usage: {} path/to/grafana.json".format(sys.argv[0])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set -x | |
DOC="A tiflash alive detect helper script.\ | |
If tiflash is hanging, it receives the packets but doesn't respond. \ | |
Dropping the packets will slow down the queries caused by the tidb \ | |
alive detecting mechanism. \ | |
This script checks the status port to detect whether TiFlash is hanging. \ | |
Add a rule to iptables to REJECT the TCP packets once tiflash is hanging, \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import os | |
import sys | |
class UsageInfo(object): | |
def __init__(self, inode_used, bytes_used): | |
self.inode = inode_used |