semvec/pypi-packages huggingface dataset:
as-dev-essense-zh 2022.1.1.1
AndroidStudio 开发基础知识
Requires Python: >=3.6

# AndroidStudio 开发基础知识

> 协议：[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
> 
> 尔曹身与名俱灭，不废江河万古流。——杜甫《戏为六绝句·其二》

* [在线阅读](https://asde.apachecn.org)
* [在线阅读（Gitee）](https://apachecn.gitee.io/doc-template/)
* [ApacheCN 学习资源](http://docs.apachecn.org/)

## 贡献指南

本项目需要校对，欢迎大家提交 Pull Request。

> 请您勇敢地去翻译和改进翻译。虽然我们追求卓越，但我们并不要求您做到十全十美，因此请不要担心因为翻译上犯错——在大部分情况下，我们的服务器已经记录所有的翻译，因此您不必担心会因为您的失误遭到无法挽回的破坏。（改编自维基百科）

## 联系方式

### 负责人

* [飞龙](https://github.com/wizardforcel): 562826179

### 其他

*   在我们的 [apachecn/as-dev-essense-zh](https://github.com/apachecn/as-dev-essense-zh) github 上提 issue.
*   发邮件到 Email: `apachecn@163.com`.
*   在我们的 [组织学习交流群](https://www.apachecn.org/#/docs/join) 中联系群主/管理员即可.

## 下载

### Docker

```
docker pull apachecn0/as-dev-essense-zh
docker run -tid -p <port>:80 apachecn0/as-dev-essense-zh
# 访问 http://localhost:{port} 查看文档
```

### PYPI

```
pip install as-dev-essense-zh
as-dev-essense-zh <port>
# 访问 http://localhost:{port} 查看文档
```

### NPM

```
npm install -g as-dev-essense-zh
as-dev-essense-zh <port>
# 访问 http://localhost:{port} 查看文档
```

## 赞助我们

![](http://data.apachecn.org/img/about/donate.jpg)
fail2ban_importer 0.0.8
Downloads JSON-encoded lists from s3 or HTTPS endpoints and bans them
Keywords: fail2ban,security,s3

# fail2ban-from-s3

Grabs a JSON-encoded list of things to ban and bans them using [fail2ban](https://www.fail2ban.org).

# Configuration

Config file can be in one of the following paths:

 - `./fail2ban_importer.json`
 - `~/.config/fail2ban_importer.json`
 - `/etc/fail2ban_importer.json`

Fields 
| Field Name | Value Type | Default Value | Description | Required |
| --- | --- | --- | --- | --- |
| `source` | `str` | | Where to pull the file from, can be a `http(s)://` or `s3://` URL. | **Yes** |
| `fail2ban_client` | `str` | `fail2ban_client` | The path to the `fail2ban-client` executable, in case it's not in the user's `$PATH` | No |
| `jail_field` | `str` | `jail` | The field to pull the target fail2ban [jail] from in your file. | No |
| `jail_target` | `str` | `target` | The field to pull the target IP from in your file. | No |
| `schedule_mins` | `int` | 5 | How often to run the action. | No |
| `s3_endpoint` | `str` | | The endpoint URL if you need to force it for s3, eg if you're using minio or another S3-compatible store. | No |
| `s3_v4` | `bool` | `false`  | Whether to force `s3_v4` requests (useful for minio) | No |
| `s3_minio` | `bool` | `false` | Enable minio mode, force `s3_v4` requests | No |

## HTTPS Source

```json fail2ban_importer.json
{
    "source": "https://example.com/fail2ban.json",
    "jail_field": "service",
    "jail_target": "src",
    "fail2ban_client": "/usr/bin/fail2ban-client",
    "schedule_mins" : 1
}
```

## S3-compatible Source

You can use the usual [boto3 AWS configuration](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration), or put the options in the config file.

```json fail2ban_importer.json
{
    "source": "s3://my-magic-fail2ban-bucket/fail2ban.json",
    "AWS_ACCESS_KEY_ID" : "exampleuser",
    "AWS_SECRET_ACCESS_KEY" : "hunter2",
    "jail_field": "service",
    "jail_target": "src",
    "schedule_mins" : 1
}
```

If you're using minio as your backend, you should add the following additional options to the config file:

```json
{
    "s3_v4" : true,
    "s3_endpoint" : "https://example.com",
}
```

# Example source data file

```json data.json
[
  {
    "ban_time": "1640997884.011",
    "host": "host1.example.com",
    "service": "sshd",
    "src": "196.30.15.254"
  },
  {
    "ban_time": "1640996178.501",
    "host": "host2.example.com",
    "service": "https",
    "src": "119.13.89.28"
  }
]
```

# Thanks

 - [fail2ban](https://www.fail2ban.org)
 - [boto3](https://boto3.amazonaws.com)
 - [requests](https://docs.python-requests.org/en/master/index.html)
 - [schedule](https://schedule.readthedocs.io/en/stable/)