Skip to content

Instantly share code, notes, and snippets.

View sysbitnet's full-sized avatar

SysBitNet sysbitnet

View GitHub Profile
@sysbitnet
sysbitnet / get_public_ip.sh
Last active February 27, 2024 14:24
Get Public IP # Create a simple script to fetch your public IP address using the dig command. If you're using a Unix-like system (Linux or macOS), you can create a bash script.
#!/bin/bash
# Fetch public IP address using dig and OpenDNS resolver
ip_address=$(dig +short myip.opendns.com @resolver1.opendns.com)
# Print the public IP address
echo "Your public IP address is: $ip_address"
# Save this script in a file, for example, get_public_ip.sh. Make it executable using the following command: chmod +x get_public_ip.sh
@sysbitnet
sysbitnet / csftest.pl
Last active January 24, 2023 02:55
CSF Firewall testing script Testing ip_tables/iptable_filter...open3: exec of /sbin/iptables -I OUTPUT -p tcp --dport 9999 -j ACCEPT failed: No such file or directory at /usr/local/csf/bin/csftest.pl line 144
#!/usr/bin/perl
########################################################################################
# Just fix the code in this file to checking CSF service edit and update from sysbitnet
########################################################################################
# Copyright 2006-2018, Way to the Web Limited
# URL: http://www.configserver.com
# Email: sales@waytotheweb.com
###############################################################################
## no critic (ProhibitBarewordFileHandles, ProhibitExplicitReturnUndef, ProhibitMixedBooleanOperators, RequireBriefOpen)
# start main