-
Notifications
You must be signed in to change notification settings - Fork 2
/
_universal_util
65 lines (55 loc) · 1.85 KB
/
_universal_util
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Pull all URLs from a sitemap.xml file
function siteurls() {
curl -s $1/sitemap.xml | grep -e loc | sed 's|<loc>\(.*\)<\/loc>$|\1|g'
}
# Get the date of an SSL certificate
function datecert() {
echo | openssl s_client -connect $1:443 2>/dev/null | openssl x509 -noout -dates
}
# Network Monitoring
function watch_requests() {
sudo ngrep -q -W byline "^(GET|POST|PUT) .*"
}
# Misc Networking
alias hazip="curl --ipv4 http://icanhazip.com"
# Lookup public IP address
function public_ip() {
# dig -4 @ns1-1.akamaitech.net -t a whoami.akamai.net +short
# dig -4 @resolver1.opendns.com -t a myip.opendns.com +short
dig @ns1.google.com -t txt o-o.myaddr.l.google.com +short | sed 's/\"//g'
}
# Docker Based Functions
alias rustscan='docker run -it --rm --name rustscan rustscan/rustscan:2.1.1'
function dinghy_proxy() {
docker kill dinghy-http-proxy
docker run --rm -d \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-v ~/.dinghy/certs:/etc/nginx/certs \
-p 80:80 -p 443:443 -p 19322:19322/udp \
-e DNS_IP=127.0.0.1 -e CONTAINER_NAME=dinghy-http-proxy \
--name dinghy-http-proxy \
ltvco/dinghy-http-proxy:latest
}
function ollama-web() {
docker kill open-webui
docker run -d \
-p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
}
function ccdaemon() {
docker kill cyberchef
docker run --rm -d -e CONTAINER_NAME=cyberchef --name cyberchef -p 8000:8000 mpepping/cyberchef
echo "Cyberchef is now running at http://localhost:8000"
}
function druby() {
if [[ $1 != "" ]] ; then
ruby_version=":$1"
else
ruby_version=""
fi
docker run -it --rm --network host --name "`basename "$PWD"`-`date +%s`" --mount src=`pwd`,target=/usr/src/myapp,type=bind -w /usr/src/myapp ruby$ruby_version bash
}