FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
dotfiles/system/.function_network at main · STiXzoOR/dotfiles · GitHub
STiXzoOR
/
dotfiles
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
5
Code
Issues
0
Pull requests
3
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
dotfiles
/
system
/
.function_network
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (59 loc) · 1.87 KB
Breadcrumbs
dotfiles
/
system
/
.function_network
Copy path
File metadata and controls
65 lines (59 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# Webserver. Driven by local-web-server, which config/mise/config.toml installs;
# the previous implementation required superstatic, which is not installed
# anywhere in this repo, so srv() was a permanent no-op (audit shell#17).
srv() {
if ! command -v ws >/dev/null 2>&1; then
echo "ws not found. Install with: npm i -g local-web-server" >&2
return 1
fi
local DIR=${1:-.}
local AVAILABLE_PORT=$(get-port)
local PORT=${2:-$AVAILABLE_PORT}
if [ "$PORT" -le "1024" ]; then
sudo -v
fi
open "http://localhost:$PORT"
ws --directory "$DIR" --port "$PORT"
}
# Get information for a given ip address
# usage: ip-info 123.456.789.0
function ipinfo() {
curl "https://ipinfo.io/${1:-}"
}
# Get IP from hostname
# usage: hostname2ip google.com
hostname2ip() {
ping -c 1 "$1" | grep -E -m1 -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
}
# Find real from shortened url
unshorten() {
curl -sIL "$1" | sed -n 's/Location: *//p'
}
# Download youtube videos in a breeze
function yt-download() {
yt-dlp -o "${HOME}/Desktop/%(title)s.%(ext)s" "$1"
}
# Curlheader will return only a specific response header or all response headers for a given URL
# usage: curlheader $header $url
# usage: curlheader $url
function curlheader() {
if [[ -z "$2" ]]; then
echo "curl -s -D - $1 -o /dev/null"
curl -s -D - "$1" -o /dev/null
else
echo "curl -s -D - $2 -o /dev/null | grep $1:"
curl -s -D - "$2" -o /dev/null | grep "$1:"
fi
}
# Get the timings for a curl to a URL
# usage: curltime $url
function curltime() {
curl -w " time_namelookup: %{time_namelookup}\n\
time_connect: %{time_connect}\n\
time_appconnect: %{time_appconnect}\n\
time_pretransfer: %{time_pretransfer}\n\
time_redirect: %{time_redirect}\n\
time_starttransfer: %{time_starttransfer}\n\
--------------------------\n\
time_total: %{time_total}\n" -o /dev/null -s "$1"
}
Back
|
FazBrowse Home
|
New Git URL