-
Notifications
You must be signed in to change notification settings - Fork 0
/
libUtils
executable file
·61 lines (44 loc) · 1.09 KB
/
libUtils
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
#!/bin/bash
# url formatter/opener
url() {
if [[ -z "$1" ]]; then
echo "No input"
fi
if [[ ! "$1" =~ ^"http" ]]; then
input=`echo https://"$1"`
else
input="$1"
fi
echo "$input"
am start --user 0 -a android.intent.action.VIEW \
-d "$input" > /dev/null
}
furl() {
echo
wget -S --spider "$1" 2>&1 | sed -En 's/^--[[:digit:]: -]{19}-- https?:\/\/(.*)/> \1\n/p'
}
# minecraft account checker
acc() {
acc=(${1//:/ })
request=$(curl -s -m 10 -H "Accept:application/json" -H "content-Type:application/json" 'https://authserver.mojang.com/authenticate' \
-X POST --data '{"username": "'${acc[0]}'", "password": "'${acc[1]}'"}' | head -c 3)
if [[ "$request" == "{\"c" ]]; then
echo "> hit"
else
echo "> bad"
fi
}
# googler
gg() {
query=$(printf '%s' "$*" | tr ' ' '+' )
lynx --cookies "https://www.google.com/search?q=$query"
}
# c compile + auto rename outout
cc() {
name=$(echo "$1" | grep -Po '.*(?=\.)')
clang "$1" -o "$name".exe
}
# get ip config
myip() {
ip a | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort | uniq -u
}