linux下常用的工具包
Project description
linux 小工具
目录结构
➜ 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plum_tools-0.6.1.tar.gz.
File metadata
- Download URL: plum_tools-0.6.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c74456543c5e8a9d9755c33c7959184509684f6100773865278d6740aef8d342
|
|
| MD5 |
ad8703d87a612bc0dd208eac496c920e
|
|
| BLAKE2b-256 |
0160745b21e5af8bf2db4627917d8bd9593ca195de9c2854c77092201fd24da8
|
Provenance
The following attestation bundles were made for plum_tools-0.6.1.tar.gz:
Publisher:
release.yml on seekplum/plum_tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plum_tools-0.6.1.tar.gz -
Subject digest:
c74456543c5e8a9d9755c33c7959184509684f6100773865278d6740aef8d342 - Sigstore transparency entry: 1675479350
- Sigstore integration time:
-
Permalink:
seekplum/plum_tools@080aa7cd395f2eea827c1fbd0594716024e1ae5a -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/seekplum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080aa7cd395f2eea827c1fbd0594716024e1ae5a -
Trigger Event:
push
-
Statement type:
File details
Details for the file plum_tools-0.6.1-py3-none-any.whl.
File metadata
- Download URL: plum_tools-0.6.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1499645d22bc23e09ac84d7513020013d5bfafa0b5bb0e00e5e410fd96a9e69
|
|
| MD5 |
b51d39cb4be1ef147b18c7b61d483cb2
|
|
| BLAKE2b-256 |
2a21eff51ce69e8a6af8488e7252766136e519e83ebe485d9bdc5b39a8dcc872
|
Provenance
The following attestation bundles were made for plum_tools-0.6.1-py3-none-any.whl:
Publisher:
release.yml on seekplum/plum_tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
plum_tools-0.6.1-py3-none-any.whl -
Subject digest:
f1499645d22bc23e09ac84d7513020013d5bfafa0b5bb0e00e5e410fd96a9e69 - Sigstore transparency entry: 1675479353
- Sigstore integration time:
-
Permalink:
seekplum/plum_tools@080aa7cd395f2eea827c1fbd0594716024e1ae5a -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/seekplum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@080aa7cd395f2eea827c1fbd0594716024e1ae5a -
Trigger Event:
push
-
Statement type: