semvec/pypi-packages huggingface dataset:
rangify 0.0.8
cisco interface rangifier

README
======

This repo contains function that takes cisco config and turns its interface configurations
and makes ranged interfaces as it's much more compact. It compares every interface config block to others and extracts similar ones only. It also shortens the cisco interface names. ex: it prints `GigabitEthernet1/0/1` as `Gi1/0/1`

Installation
------------

Run the following to install:

```python
pip install rangify
```

Usage
-----

```python
from rangify import ranger

ranger("cisco_config.txt") # or ranger(interfaces_dict)

```
## **It can accept 2 types of inputs.**  
<br>

## Text config from file  
<br>

Let's say `test_config.txt` contains following text(abbreviated, for full text please check the `test_config.txt` file)

```
!
interface GigabitEthernet1/0/1
 ...any text config block..
!
interface GigabitEthernet1/0/2
 ...any text config block..
!
interface GigabitEthernet1/0/3
 ...any text config block..
!
```
Then following function will print to screen more compact ranged version of configuration:


```python
ranger("filename.txt")
```
Output:  

```
interface range Gi1/0/1-3
 ...any text config block...
```

## Interfaces as dictionary of dictionaries  
<br>

This takes dictionary of dictionaries as an input. Key for dictionary is interface name and the value is the configuration dictionary.  And returns same dictionary structure but this time the keys are in collapsed/ranged form. Example below.

```python
# input dictionary
sample_ints = {
        "GigabitEthernet1/0/1": {},
        "GigabitEthernet1/0/2": {},
        "GigabitEthernet1/0/4": {"mode": "access"},
        "GigabitEthernet3/4/2": {"mode": "access"},
        "GigabitEthernet3/4/3": {"mode": "access"},
        "GigabitEthernet3/5/3": {"mode": "trunk"},
        "GigabitEthernet3/6/3": {"mode": "trunk"},
}
# range them all
print(ranger(interfaces))
```

Output:
```python
    {'range Gi1/0/1-2': {}, 
    'range Gi1/0/4, Gi3/4/2-3': {'mode': 'access'}, 
    'range Gi3/5/3, Gi3/6/3': {'mode': 'trunk'}}
```
aws-cloud-instance-list 0.0.4
Aws cloud instance list

# aws-cloud-instance-list

Console command which show all instances from current VPC.
This command uses in bastion host for show list of instances and connection using this data to another instance in private network.

![list example](./example.png)

## Install
```bash
pip3 install aws-cloud-instance-list
```

To bastion instance need add managed role `AmazonEC2ReadOnlyAccess`

For using `mssh` need add to instance policy

```json
{ "Version": "2012-10-17", "Statement": [{"Condition": {"StringEquals": {"aws:ResourceTag/<tag-key>": "<tag-name>"}}, "Action": "ec2-instance-connect:SendSSHPublicKey", "Resource": "arn:aws:ec2:<region>:<profile_id>:instance/*", "Effect": "Allow"}]}
```

## Update
```bash
pip3 install aws-cloud-instance-list --upgrade
```

## Deploy to pypi

```
python setup.py register -r pypi
python setup.py sdist upload -r pypi
```

#### Check readme
```
python -m readme_renderer README.md -o /tmp/README.html
```
social-auth-backend-prologin 0.1.3
Prologin social auth backend
Requires Python: >=3.6

# social-auth-backend-prologin

This is Prologin's python social auth backend.

## How to use with django

1. Add this line to your requirements.txt

```
social-auth-backend-prologin==0.1.3
```

2. Add these in your settings.py

```python

# add the app to installed apps

INSTALLED_APPS = [
    ...
    "social_django",
    ...
]

# if you are not sure what to put here, see with a prologin root
SOCIAL_AUTH_PROLOGIN_SCOPE = [
    "email",
    "profile",
    "contest",
    "security_clearance",
]

# same thing

SOCIAL_AUTH_PIPELINE = (
    "social_core.pipeline.social_auth.social_details",
    "social_core.pipeline.social_auth.social_uid",
    "social_core.pipeline.social_auth.auth_allowed",
    "social_core.pipeline.social_auth.social_user",
    "social_core.pipeline.user.get_username",
    "social_core.pipeline.user.create_user",
    "social_core.pipeline.social_auth.associate_user",
    "social_core.pipeline.social_auth.load_extra_data",
    "social_auth_backend_prologin.pipeline.save_all_claims_as_extra_data",
    "social_core.pipeline.user.user_details",
    "social_auth_backend_prologin.pipeline.apply_upstream_security_clearances",
)

# if you want OIDC-only authentication you may remove the django... line

AUTHENTICATION_BACKENDS = (
    "social_auth_backend_prologin.backend.ProloginOpenIdConnect",
    "django.contrib.auth.backends.ModelBackend",
)

# These one are secret credentials, please do not commit them
# (They are given by prologin roots)

SOCIAL_AUTH_PROLOGIN_KEY = (
    "CHANGE_ME"  # This is the client ID given by a Prologin Root
)

SOCIAL_AUTH_PROLOGIN_SECRET = (
    "CHANGE_ME"  # This is the client secret given by a Prologin Root
)

```

3. add these in your `urls.py`

```

urlpatterns = [
    ...
    path('sso/', include('social_django.urls', namespace='social'),
    ...
]

```