Collection of Python utilities for DNS record checking, batch email domain processing, and GitHub organization automation including Dependabot enablement across repositories.
A collection of Python-based system administration and automation utilities for DNS operations and GitHub organization management.
This skill helps you work with a suite of standalone Python scripts for common sysadmin tasks:
1. **Verify Python version and dependencies**:
- Check that Python 3.10 is available
- Verify Pipenv is installed for dependency management
- Install dependencies: `pipenv install`
- Activate virtual environment: `pipenv shell`
2. **Key dependencies**:
- `dnspython` - DNS operations
- `pandas` - Data manipulation and CSV export
- `requests` - GitHub API interactions
#### Single Domain MX Record Lookup (py_dns.py)
1. **Usage pattern**: `python py_dns.py <domain>`
2. **What it does**: Queries and prints MX records for the specified domain
3. **Output**: Console display of MX records
**Example**:
```bash
python py_dns.py example.com
```
#### Batch Email Domain Processing (py_dns_from_list.py)
1. **Prepare input**: Create `emails.txt` with one email address per line
2. **Run the script**: `python py_dns_from_list.py`
3. **Processing behavior**:
- Extracts domains from email addresses
- Queries MX records using Google DNS (8.8.8.8)
- Includes 200ms rate-limiting delay between requests
- Handles lookup failures gracefully
4. **Output**: Results exported to `emails2.txt` in CSV format
**Example workflow**:
```bash
cat > emails.txt <<EOF
EOF
python py_dns_from_list.py
cat emails2.txt
```
#### Enable Dependabot Across Organization (gh_org_enable_dependabot.py)
1. **Prerequisites**:
- GitHub personal access token with appropriate permissions
- Organization name
2. **Usage**: `python gh_org_enable_dependabot.py <org> <token>`
3. **What it does**:
- Iterates through all repositories in the organization
- Creates a new branch named `enable-dependabot`
- Adds `dependabot.yml` configuration for GitHub Actions
- Creates a pull request for review
4. **Security note**: Tokens are passed as command-line arguments, not stored
**Example**:
```bash
python gh_org_enable_dependabot.py myorg ghp_token123456789
```
When modifying these scripts:
1. **DNS tools**:
- Each script is standalone - no shared framework
- DNS operations use `dnspython` library
- CSV exports use `pandas` DataFrames
2. **GitHub automation**:
- Uses `requests` library for GitHub API v3
- Branch names and file paths are configurable
- Error handling should account for API rate limits
3. **Dependencies**:
- Python version is pinned to 3.10
- Use Pipenv for dependency management
- Repository has Dependabot enabled for automated updates
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/system-administration-tools/raw