Merged detached head into master
This commit is contained in:
parent
327886f703
commit
1886ad13e4
1 changed files with 4 additions and 20 deletions
24
functions.sh
24
functions.sh
|
@ -1169,26 +1169,10 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
urlencode() {
|
urlencode() { python3 -c "import sys; from urllib.parse import quote; print(quote(sys.argv[1]));" "$@"; }
|
||||||
# urlencode <string>
|
urldecode() { python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.argv[1]));" "$@"; }
|
||||||
|
urlencodeplus() { python3 -c "import sys; from urllib.parse import quote_plus; print(quote_plus(sys.argv[1]));" "$@"; }
|
||||||
local LANG=C
|
urldecodeplus() { python3 -c "import sys; from urllib.parse import unquote_plus; print(unquote_plus(sys.argv[1]));" "$@"; }
|
||||||
local length="${#1}"
|
|
||||||
for (( i = 0; i < length; i++ )); do
|
|
||||||
local c="${1:i:1}"
|
|
||||||
case $c in
|
|
||||||
[a-zA-Z0-9.~_-]) printf "$c" ;;
|
|
||||||
*) printf '%%%02X' "'$c" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
urldecode() {
|
|
||||||
# urldecode <string>
|
|
||||||
|
|
||||||
local url_encoded="${1//+/ }"
|
|
||||||
printf '%b' "${url_encoded//%/\\x}"
|
|
||||||
}
|
|
||||||
|
|
||||||
findlocallogins() {
|
findlocallogins() {
|
||||||
last -F -a $(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f $i ";done)|grep -v "pts/\|reboot\|wtmp"|awk '{print $4,$5,$7}'|uniq
|
last -F -a $(for i in $(find /var/log -maxdepth 1 -name "wtmp*"|sort -h);do echo -n "-f $i ";done)|grep -v "pts/\|reboot\|wtmp"|awk '{print $4,$5,$7}'|uniq
|
||||||
|
|
Loading…
Reference in a new issue