Skip to content

Instantly share code, notes, and snippets.

View devinci-it's full-sized avatar
🐢

.vince devinci-it

🐢
View GitHub Profile
@devinci-it
devinci-it / subnet_vlsm.py
Last active January 16, 2023 07:16
Subnetting and VLSM/
from ipaddress import IPv4Network
from math import log2
#TO_SUBNET = IPv4Network("10.0.0.0/8")
#NEW_PREFIX=[24,24,24]
#COUNT=8
def vlsm(TO_SUBNET,NEW_PREFIX):
CUR_NETWORKS = []
@devinci-it
devinci-it / vlan_database.py
Created January 16, 2023 12:15
Generates a CISCO IOS config to setup a VTP Server and fill-in the VLAN Database.
def vtp_database_L3 (vtp_domain, vtp_mode, vtp_password, vlan_ids, vlan_names):
"""
:param vtp_domain: str
:param vtp_mode:
:param vtp_password: str
:param vlan_ids: lst
:param vlan_names: lst
:param interface_ip: ipaddress.IPv4Address
@devinci-it
devinci-it / config_lacp.py
Created January 16, 2023 15:00
Generate BASIC LACP configuration.
def config_lacp(base,port_range,channel_group_id,mode):
"""
CONFIG BASIC ETHERCHANNEL-LACP
:param base: "G1/0/"
:param port_range: "0-2,5-6"
:param channel_group_id: 1
:return: str
"""
@devinci-it
devinci-it / config_dhcp.py
Created January 22, 2023 02:24
IOS DHCP config generator.
from ipaddress import IPv4Network,IPv4Address
def config_dhcp(dhcp_pool_name, network_address, dns_address=None,dg=None,dns=None,exclude_ips=None):
"""
"BY DEFAULT WILL EXCLUDE THE FIRST 100 USABLE HOST IP"
AND SUBNET'S FIRST USABLE ADDRESS AS DG
AND THE 10th as DNS
if not defined : DEFAULT GATEWAY : FIRST USABLE HOST ADDRESS
:
:param excluded_addresses:(min, max)
@devinci-it
devinci-it / certbot-and-csr.sh
Created January 13, 2024 12:30
Script that covers the installation and setup of Certbot, generation of a Certificate Signing Request (CSR), and issuing and installing an SSL/TLS certificate. The script assumes the use of Apache on an Ubuntu system.
#!/bin/bash
# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root or using sudo."
@devinci-it
devinci-it / ssh-clean-install.sh
Created January 17, 2024 11:20
This script performs a clean installation and basic setup of the SSH service on a Debian system.
#!/bin/bash
: '
This script performs a clean installation and basic setup of the SSH service on a Debian system.
Usage:
1. Save this script in a file (e.g., ssh_setup.sh).
2. Make it executable (chmod +x ssh_setup.sh).
3. Run the script with ./ssh_setup.sh.
@devinci-it
devinci-it / scapy-cartography.py
Created January 17, 2024 16:34
This script uses Scapy to perform an ARP scan on the specified IP range
"""
This script uses Scapy to perform an ARP scan on the specified IP range
and retrieves a list of devices connected to the network.
Make sure to replace "your_network_ip_range" with the actual IP range of your network, e.g., "192.168.1.1/24".
Requirements:
- Scapy library (install with: pip install scapy)
"""
@devinci-it
devinci-it / typography.css
Last active January 18, 2024 21:42
Typographic styles and variables for consistent styling across various elements in a web project. It includes variables for font family, font weights, and specific styles for display text, body text in different sizes, code blocks, titles, subtitles, and captions.
/**
* Typography Styles
*
* This CSS document defines a consistent and modular typography system
* using Google Fonts for the 'Outfit' font family. It includes variables
* for font family, font weights, and specific styles for various text elements.
* Each style is defined with associated font sizes, line heights, font weights,
* and font families where applicable.
*
* Typography Variables:
@devinci-it
devinci-it / reset.css
Created January 18, 2024 21:38
This CSS reset normalizes default styling across HTML elements for improved consistency.
/**
* CSS Reset
*
* This CSS reset normalizes default styling across HTML elements for improved consistency.
* It includes adjustments for box sizing, font size, margins, padding, font weight, and list styles.
* Additionally, it ensures responsive behavior for images.
* Feel free to customize or extend based on specific project requirements.
*
* Reset includes:
* - Box sizing normalization
@devinci-it
devinci-it / emptystate.css
Created January 18, 2024 23:01
This collection of CSS files includes modular styling for various layout structures and reusable component templates. It provides a consistent and flexible styling system for building web pages and applications.
/**
* EmptyState Component Layout System
*
* This CSS document defines a layout system for the EmptyState component,
* including the anatomy elements such as illustration, main text, supporting text,
* primary button, secondary link, border, and variations. The system provides
* a modular approach for consistent styling and customization of EmptyState components.
*
* EmptyState Anatomy Elements:
* - Illustration, Main Text, Supporting Text, Primary Button, Secondary Link, Border