-
github上你可以用别人的现成的代码 直接 git clone 即可了
-
然后你也想改代码或者贡献代码咋办?
This file contains hidden or 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 hidden or 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 hidden or 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
# vi: ft=dosini | |
[main] | |
# Enables context sensitive auto-completion. If this is disabled the all | |
# possible completions will be listed. | |
smart_completion = True | |
# Multi-line mode allows breaking up the sql statements into multiple lines. If | |
# this is set to True, then the end of the statements must have a semi-colon. | |
# If this is set to False then sql statements can't be split into multiple |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |