pymro 发布的文章

Installation

tar -C /usr/local -xzf go1.21.4.linux-amd64.tar.gz
vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile

设置GoProxy

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

修改节点分片数

# 临时增加分片数(重启es会设置时效)
PUT /_cluster/settings
{
  "transient": {
    "cluster": {
      "max_shards_per_node":900000
    }
  }
}

# 永久增加分片数(推荐)
PUT /_cluster/settings
{
  "persistent": {
    "cluster": {
      "max_shards_per_node":900000
    }
  }
}

删除镜像

docker rmi $(docker images | grep -E 'harbor.xxx.com/(qa|dev|prod)/' | awk -v OFS=":" '{print $1,$2}')

删除k8s中Evicted状态的pod

kubectl get po -A | grep 'Evicted' | awk 'NR>0 {print "kubectl delete po -n " $1,$2}' | bash

查看docker space

# overlay2无thin pool,devicemapper有thin pool。
docker info | grep Space

查看镜像和容器的空间

docker system df -v 或 docker system df -v | grep GB

方法一

test.py内容
mm="%s,%s,%s"%("aabbcc1",333,"cccc")
print(mm)

def retobj2 = "/usr/bin/python /data/script/test.py".execute().text.readLines()
retobj2.each{println it}

def retobj2 = "/usr/bin/python /tmp/11.py".execute().text.readLines()
return retobj2

方法二

test.py内容
jj = json.dumps({"name":"fulei.sssyang","age":"18"})
print(jj)

def respText = "/usr/local/python3/bin/python3 /data/script/py/test.py".execute().text
def slurper = new groovy.json.JsonSlurper() 
def branchs = slurper.parseText(respText) //parseText将json字符串转换为Map对象;JsonOutput类用于将Groovy对象转换为JSON字符串

方法三

python返回\n换行的字符串

"".execute().text.readLines()

方法4)
def html = "http://xxxxxx".toURL().text
def list = html.readLines()

升级pip到最新的版本

python -m pip install --upgrade pip
或
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip

镜像地址

清华镜像源
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

豆瓣镜像源
pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com some-package

阿里云镜像源
pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com some-package

中国科学技术大学镜像源
pip install -i http://pypi.mirrors.ustc.edu.cn/simple/ --trusted-host=pypi.mirrors.ustc.edu.cn some-package

导出wheel包

导出全部
pip wheel --wheel-dir=./wheelhouse -r requirements.txt -i http://mirrors.ustc.edu.cn/pypi/simple/ --trusted-host mirrors.ustc.edu.cn

导出指定的
pip wheel --wheel-dir=./wheelhouse fastapi==2.2.3 -i http://mirrors.ustc.edu.cn/pypi/simple/ --trusted-host mirrors.ustc.edu.cn --extra-index-url https://test.com/pypi/simple/

安装wheel包

安装全部
pip install wheelhouse/*.whl

安装指定的
pip install --no-index --find-links=wheelhouse fastapi==2.2.3

Debian安装python-ldap的依赖库

apt-get install gcc libldap2-dev libsasl2-dev