Skip to main content

linux下常用的工具包

Project description

linux 小工具

LICENSE codecov CI pypi version pyversions Checked with mypy Code style: black

目录结构

➜  tree -L 1 -a
.
├── .bumpversion.cfg    # `bumpversion`工具的配置文件,用于自动更新版本
├── .gitignore          # 维护git仓库需要忽略文件
├── .gitlab-ci.yml      # gitlab ci的配置文件
├── .pylintrc           # pylint 配置文件
├── CHANGELOG.md        # 记录模块的变化
├── README.md           # 项目自述文件
├── bin                 # 项目二进制程序
├── docs                # 项目文档
├── plum_tools          # 核心代码模块
└── tests               # 单元测试目录

安装环境依赖

1.安装 uv

# 推荐
curl -LsSf https://astral.sh/uv/install.sh | sh

# 或
pip install uv

2.安装项目依赖环境

uv sync

运行单元测试

uv run poe test

检查 Python 代码规范

uv run poe lint

更新版本

# 小版本
bumpversion patch

# 中版本
bumpversion minor

gitrepo

查找指定路径下所有被改动的 git 仓库

  ~ gitrepo -h
usage: gitrepo [-h] [-p--path PATH [PATH ...]] [-d--detail] [-t--test]

optional arguments:
  -h, --help            show this help message and exit
  -p--path PATH [PATH ...]
                        The directory path to check
  -d--detail            display error details
  -t--test              run the test function

pssh

通过 ip 简写或别名快速登录机器

  ~ pssh -h
usage: pssh [-h] [-t--type TYPE] [-i--identityfile IDENTITYFILE]
            [-u--username USER] [-p--port PORT]
            host

positional arguments:
  host                  specify server

optional arguments:
  -h, --help            show this help message and exit
  -t--type TYPE         host type
  -i--identityfile IDENTITYFILE
                        ssh login identityfile path
  -u--username USER     ssh login username
  -p--port PORT         ssh login port

gitstash

外部传入一个 branch,保存本地未提交的修改,然后切换到 branch,将上次该 branch 保存的未提交的结果 stash pop 出来

  ~ gitstash -h
usage: gitstash [-h] branch

positional arguments:
  branch      specify branch

optional arguments:
  -h, --help  show this help message and exit

pipmi

对指定机器进行远程执行 ipmitool 相关操作

  ~ pipmi -h
usage: pipmi [-h] -l HOST -s SERVERS [SERVERS ...] [-u USER] [-pass PASSWORD]
             [-p--port PORT] [-i--identityfile IDENTITYFILE] [-t--type TYPE]
             [-U USERNAME] [-c COMMAND] [-P PASSWORD]

optional arguments:
  -h, --help            show this help message and exit
  -l HOST, --login HOST
                        specify login ip
  -s SERVERS [SERVERS ...], --servers SERVERS [SERVERS ...]
                        specify server
  -u USER, --username USER
                        specify username
  -pass PASSWORD, --password PASSWORD
                        specify password
  -p--port PORT         ssh login port
  -i--identityfile IDENTITYFILE
                        ssh login identityfile path
  -t--type TYPE         host type
  -U USERNAME, --Username USERNAME
                        specify ipmi username
  -c COMMAND, --command COMMAND
                        specify ipmi command
  -P PASSWORD, --Password PASSWORD
                        specify ipmi password

prn

上传文件到服务器

  ~ prn -h
usage: prn [-h] -s SERVERS [SERVERS ...] [-p PROJECT] [-t--type TYPE]
           [-i--identityfile IDENTITYFILE] [-u--username USER] [-p--port PORT]
           [-l--local LOCAL] [-r--remote REMOTE] [-d--delete DELETE]
           [-e--exclude EXCLUDE [EXCLUDE ...]]

optional arguments:
  -h, --help            show this help message and exit
  -s SERVERS [SERVERS ...], --servers SERVERS [SERVERS ...]
                        specify server
  -p PROJECT, --project PROJECT
                        specify project
  -t--type TYPE         host type
  -i--identityfile IDENTITYFILE
                        ssh login identityfile path
  -u--username USER     ssh login username
  -p--port PORT         ssh login port
  -l--local LOCAL       local path
  -r--remote REMOTE     remote path
  -d--delete DELETE     delete remote path other file
  -e--exclude EXCLUDE [EXCLUDE ...]
                        exclude file

pping

ping 指定网段所有 ip 是否能 ping 通

  ~ pping -h
usage: pping [-h] [-t--type TYPE]

optional arguments:
  -h, --help     show this help message and exit
  -t--type TYPE  host type

详细文档

项目文档目录

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plum_tools-0.6.2.tar.gz (159.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plum_tools-0.6.2-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file plum_tools-0.6.2.tar.gz.

File metadata

  • Download URL: plum_tools-0.6.2.tar.gz
  • Upload date:
  • Size: 159.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plum_tools-0.6.2.tar.gz
Algorithm Hash digest
SHA256 85888433502327add46bb0bdbe74877d6121ff79724db0a2920665f046169131
MD5 4755fa5b00bbd37b4a54bc2be33eb062
BLAKE2b-256 b95c0f7c86e095ab21aeab181900adffbbe62b4815d36d5e75e028e09a9c297e

See more details on using hashes here.

Provenance

The following attestation bundles were made for plum_tools-0.6.2.tar.gz:

Publisher: release.yml on seekplum/plum_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plum_tools-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: plum_tools-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for plum_tools-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 acce33144ceac90617633d99dba0de217d328bcf04fe19c657d024f56e7006f2
MD5 e23cd86e76d48d9ae7ca5cf5eb6e6a66
BLAKE2b-256 379153cc99037222df068f6f9a93814efb3a308d5a18cbdb080b7d26e7d1904e

See more details on using hashes here.

Provenance

The following attestation bundles were made for plum_tools-0.6.2-py3-none-any.whl:

Publisher: release.yml on seekplum/plum_tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page