Skip to content

Instantly share code, notes, and snippets.

View toxi22's full-sized avatar

Roman toxi22

View GitHub Profile
@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 / 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 / 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 / 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