Skip to main content

介绍

一些简单好用的命令

1. l0n0lsimplehttpserver

l0n0lsimplehttpserver -h
usage: l0n0lsimplehttpserver [-h] [--host HOST] [--port PORT] [-s] directory

启动一个 aiohttp 静态文件服务器。

positional arguments:
  directory         要提供静态文件的目录路径。

options:
  -h, --help        show this help message and exit
  --host HOST       服务器绑定的主机地址(默认:127.0.0.1)。
  --port PORT       服务器绑定的端口号(默认:8080)。
  -s, --show-index  显示索引目录

1.1 实例

l0n0lsimplehttpserver ./ -s
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)

1.2 浏览器访问

2. l0n0lsimplekvserver

l0n0lsimplekvserver -h
usage: l0n0lsimplekvserver [-h] [--host HOST] [--port PORT]

aiohttp Key-Value 服务器

options:
  -h, --help   show this help message and exit
  --host HOST  监听地址
  --port PORT  监听端口

2.1 实例

l0n0lsimplekvserver 
[INFO] 已创建 tokens.json,令牌: 8f35f0178c5596773f4e95459545f175c483e05b809181c136f95a2eda573f7d
[INFO] 已加载 tokens.json: ['8f35f0178c5596773f4e95459545f175c483e05b809181c136f95a2eda573f7d']
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)

2.2 存值

curl -X POST http://127.0.0.1:8080/set -H "Authorization: Bearer 8f35f0178c5596773f4e95459545f175c483e05b809181c136f95a2eda573f7d" -H "Content-Type: application/json"   -d '{"键":"年龄","值":28}'
{"状态": "ok"}

2.3 取值

curl -X POST http://127.0.0.1:8080/get -H "Authorization: Bearer 8f35f0178c5596773f4e95459545f175c483e05b809181c136f95a2eda573f7d" -H "Content-Type: application/json"   -d '{"键":"年龄"}'
{"键": "年龄", "类型": "int", "值": 28}

3. l0n0lsystemctltui(systemctl tui 界面)

l0n0lsystemctltui

4. l0n0lsystemctlgui (systemctl gui 界面)

l0n0lsystemctlgui

5. l0n0limg2base64

5.1 总的帮助

l0n0limg2base64 -h
usage: l0n0limg2base64 [-h] {encode,decode} ...

图片 Base64 编码/解码工具

positional arguments:
  {encode,decode}
    encode         图片转 Base64
    decode         Base64 转图片

options:
  -h, --help       show this help message and exit

5.2 encode

l0n0limg2base64 encode -h
usage: l0n0limg2base64 encode [-h] [-o OUTPUT] [-p] image

positional arguments:
  image                 输入图片路径

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        输出 Base64 文件
  -p, --prefix          输出可直接用于 <img src=""/> 的字符串

5.3 decode

l0n0limg2base64 decode -h
usage: l0n0limg2base64 decode [-h] -o OUTPUT base64file

positional arguments:
  base64file            输入 Base64 文本文件

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        输出图片路径

5.4 实例

l0n0limg2base64 encode image.png -p -o out.txt
l0n0limg2base64 decode out.txt -o image_back.png

5. l0n0lurlmap

用于 url 重定向, 家用nas ip变动时时重定向

l0n0lurlmap -h
usage: l0n0lurlmap [-h] [--host HOST] [--port PORT] [--ssl-cert SSL_CERT] [--ssl-key SSL_KEY] [--tokens-dir TOKENS_DIR]

options:
  -h, --help            show this help message and exit
  --host HOST
  --port PORT
  --ssl-cert SSL_CERT
  --ssl-key SSL_KEY
  --tokens-dir TOKENS_DIR
                        存放 token.json 文件的目录

5.1 启动服务

创建token.json

mkdir tokens
cd tokens
echo "{}" > 123.json 

其中123.json中的123就是我们的token, 是自定义的, 可以长一点比如asdjfkaj3492uf09jkdlsjfalsjf

  • token是我们访问服务器的密钥, 需要记下来. 我们的例子中使用123
l0n0lurlmap
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)

5.2 set接口, 编写如下shell脚本

setUrl.sh

SERVER=http://localhost:8080/set
TOKEN=123
NAME=$1
URL=$2
PUBLIC=$3

curl -X POST "$SERVER" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d "{\"name\":\"$NAME\",\"url\":\"$URL\", \"public\":\"$PUBLIC\"}"

执行

setUrl.sh baidu https://www.baidu.com 1
  • 上面的 1 如果不写,就不能使用http://localhost:8080/to/123/baidu跳转 返回
{"status": "ok", "data": {"baidu": "https://www.baidu.com"}}

现在我们就可以通过http://localhost:8080/to/123/baidu来访问到百度了 其中123是我们的token, baidu 是参数中的name

  • 访问 http://localhost:8080 可以进入管理页面进行url管理 l0n0lurlmap

输入token 123

l0n0lurlmap

Metadata

Release files for l0n0lsimple 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for l0n0lsimple 0.5.2
File Size Uploaded Provenance
l0n0lsimple-0.5.2.tar.gz 415.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for l0n0lsimple 0.5.2
File Interpreter ABI Platform
l0n0lsimple-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 565.8 kB

Release files / l0n0lsimple-0.5.2.tar.gz

Download URL l0n0lsimple-0.5.2.tar.gz
Size 415.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1a5479da1da0f4ec590ca2299a491f5176885a244816fb90f3f57d4ecd04494b
BLAKE2b-256 checksum
How to use checksums
084be0c19a26ea1c9ff79f9e188e52569498c6a01715f562bc7d8a98cbc7163f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / l0n0lsimple-0.5.2-py3-none-any.whl

Download URL l0n0lsimple-0.5.2-py3-none-any.whl
Size 150.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c5f964a2df0f4d14fae1a4c7fbb57a90f24336eeef7f2952de2ec696dbdc405
BLAKE2b-256 checksum
How to use checksums
901febc94895e66dccfa505e9c55c55831e8f51b965bd14cac94cf63e8a7b963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Security for l0n0lsimple 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page