Skip to content
GitLab
Explore
Sign in
Register
nimrod
rcfiles
Compare revisions
01ee024ce207f243bab94f5659f3b95f5afc38c1 to 5aea62e8cf201587b771f72bdf9f22bca4b9b8c7
Commits on Source (2)
Better gcc flags.
· c3547642
nimrod
authored
Apr 30, 2023
Interface with make instead.
c3547642
ipinfo script.
· 5aea62e8
nimrod
authored
May 27, 2023
Get IP info from ipinfo.io.
5aea62e8
Hide whitespace changes
Inline
Side-by-side
.bashrc
View file @
5aea62e8
...
...
@@ -23,6 +23,7 @@ elif command -v w3m >/dev/null
then
export
BROWSER
=
w3m
fi
export
CFLAGS
=
"-g3 -Wall -Wextra -Wconversion -Wdouble-promotion -Wno-unused-parameter -Wno-unused-function -Wno-sign-conversion -fsanitize=undefined -fsanitize-trap"
export
CLOUDSDK_ACTIVE_CONFIG_NAME
=
'shore'
export
DOCKER_BUILDKIT
=
1
export
EDITOR
=
vim
...
...
@@ -49,6 +50,7 @@ export LESS_TERMCAP_ue=$'\E[0m'
export
LESS_TERMCAP_us
=
$'
\E
[01;32m'
export
LYNX_SAVE_SPACE
=
"
$HOME
/Downloads"
export
LYNX_TEMP_SPACE
=
"
$HOME
/.cache/lynx"
export
MAKEFLAGS
=
"-e -k -j4"
export
NODE_PENDING_DEPRECATION
=
'1'
export
NPM_CONFIG_USERCONFIG
=
"
$HOME
/.config/npmrc"
export
PATH
=
"
$GOPATH
/bin:
$PATH
"
...
...
@@ -104,7 +106,6 @@ alias df='df --output=source,fstype,size,used,avail,pcent,iavail,ipcent,target'
alias
diff
=
'diff --unified'
alias
dpkglog
=
"grep -v 'status
\\
|trigproc
\\
|configure' /var/log/dpkg.log"
alias
escape
=
'printf "%q"'
alias
gcc
=
'gcc --std=c99 -Wall -Wextra -Werror -pedantic'
alias
gen-mac
=
'hexdump -n5 -e '
\'
'"02" 5/1 ":%02X" "\n"'
\'
' /dev/urandom'
alias
gen-ssh-config
=
"rc_make .ssh/config"
alias
green
=
"printf '
\e
[1;92m%s
\e
[0m
\n
'"
...
...
@@ -230,7 +231,7 @@ gen_csr () {
jt
()
{
if
command
-v
pygmentize
>
/dev/null
then
python3
-m
json.tool
"
$@
"
| pygmentize
-l
j
avascript
python3
-m
json.tool
"
$@
"
| pygmentize
-l
j
son
else
python3
-m
json.tool
"
$@
"
fi
...
...
Documents/bin/ipinfo
0 → 100755
View file @
5aea62e8
#!/bin/sh
set
-eu
is_ip
()
{
echo
"
$1
"
|
grep
--extended-regexp
--quiet
'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
}
usage
()
{
echo
"USAGE:
$(
basename
"
$0
"
)
[-h] [hostname or IP address]"
>
&2
echo
"If no address is passed, the internet IP address is used instead."
>
&2
}
if
[
"$#"
-eq
0
]
then
address
=
"
$(
curl
--silent
--fail
--show-error
https://myip.shore.co.il/
)
"
elif
[
"$#"
-gt
1
]
then
usage
exit
1
elif
[
"
$1
"
=
"-h"
]
then
usage
elif
is_ip
"
$1
"
then
address
=
"
$1
"
else
address
=
"
$(
dig +short
"
$1
"
)
"
fi
if
command
-v
pygmentize
>
/dev/null
then
curl
--silent
--fail
--show-error
--header
"Accept: application/json"
"https://ipinfo.io/
${
address
}
"
| pygmentize
-l
json
else
curl
--fail
--show-error
--header
"Accept: application/json"
"https://ipinfo.io/
${
address
}
"
fi