Skip to content

Instantly share code, notes, and snippets.

View cdot65's full-sized avatar
🐒
💨

Calvin Remsburg cdot65

🐒
💨
View GitHub Profile
@cdot65
cdot65 / delete_files_by_name.sh
Created July 15, 2023 13:38
Loop through the arguments and find the files and folders to be deleted
#!/bin/bash
# Check if there are arguments
if [ $# -eq 0 ]; then
echo "No arguments supplied. Please provide the names of the files or directories to be deleted."
exit 1
fi
# Loop through the arguments and find the files and folders to be deleted
for name in "$@"; do
@cdot65
cdot65 / file_sizes.sh
Created July 15, 2023 13:12
To iterate over all folders in your current directory, and display the sizes of files in each directory sorted by size, you can use the du and sort commands in Bash. The du command estimates file and directory space usage, while sort can sort lines in text files.
#!/bin/bash
for d in */ ; do
echo "Processing directory: $d"
find "$d" -type f -exec du -ah {} \; | sort -rh | head -n 10
done
@cdot65
cdot65 / search.sh
Created July 15, 2023 13:09
Search for files that contain a pattern within nested subdirectories. Example: ```./search.sh "search string"```
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "You must enter exactly 1 command line argument (the string to search for)"
exit 1
fi
grep -rnw './' -e "$1"
@cdot65
cdot65 / autofocus_enrich_subnet.py
Created April 3, 2023 21:51
Enrich as subnet and get reputation for IP addresses from AutoFocus
import os
import sys
from typing import Dict, Optional
import requests
import json
import gzip
import boto3
import botocore
@cdot65
cdot65 / ntp.py
Created March 29, 2023 21:16
ChatGPT update NTP server
# Import necessary libraries
from netmiko import ConnectHandler
# Define list of devices
devices = [
{
'device_type': 'cisco_ios',
'ip': '192.168.1.1',
'username': 'admin',
'password': 'password'
@cdot65
cdot65 / continuous_ping.py
Created March 29, 2023 20:32
Continuous Ping
import sys
import time
import platform
import subprocess
def continuous_traceroute(target, interval=1):
print(f"Starting continuous traceroute to {target} with an interval of {interval} seconds")
# Determine the appropriate command based on the operating system
command = "traceroute" if platform.system() != "Windows" else "tracert"

Reclaim your inbox

If you are being barraged by automated recruiter trash, consider using the list below when setting up your email filters.

List of inbox abusers

- thecroxgroup.com
- idctechnologies.com
- dice.com
@cdot65
cdot65 / VM-Series on Proxmox.md
Last active May 13, 2024 09:56
Short steps required to spin up Palo Alto Networks' VM-Series on Proxmox

VM-Series on Proxmox

Special thanks to Zach Forsyth

Order of operations

  1. SSH into your Proxmox server
ssh root@pve1

up-and-running-nautobot

A reference for spinning up Nautobot on top of a Kubernetes environment

k3s install

Install k3s with bash script

curl -sfL https://get.k3s.io | sh -
@cdot65
cdot65 / up-and-running-ansible-awx.md
Last active May 1, 2024 07:01
Install Ansible AWX on Rancher k3s

up-and-running-ansible-awx

A reference for spinning up Ansible AWX on top of a Kubernetes environment

k3s install

Install k3s with bash script

curl -sfL https://get.k3s.io | sh -