Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rcfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
rcfiles
Commits
3850ebf1
Commit
3850ebf1
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Replace color output functions with aliases.
parent
3675338a
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#312
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.bashrc
+7
-42
7 additions, 42 deletions
.bashrc
with
7 additions
and
42 deletions
.bashrc
+
7
−
42
View file @
3850ebf1
...
@@ -65,6 +65,8 @@ alias aptitude='aptitude --display-format %p --quiet'
...
@@ -65,6 +65,8 @@ alias aptitude='aptitude --display-format %p --quiet'
alias
bell
=
"printf '
\\
a'"
alias
bell
=
"printf '
\\
a'"
alias
bfg
=
'java -jar $HOME/.local/share/bfg/bfg.jar'
alias
bfg
=
'java -jar $HOME/.local/share/bfg/bfg.jar'
alias
black
=
'black --line-length 79'
alias
black
=
'black --line-length 79'
alias
blue
=
"printf '
\e
[1;94m%s
\e
[0m
\n
'"
alias
bold
=
"printf '
\e
[1m%s
\e
[0m
\n
'"
alias
cadvisor
=
'docker run --rm --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --publish=8080:8080 --detach=true --name=cadvisor google/cadvisor:latest'
alias
cadvisor
=
'docker run --rm --volume=/:/rootfs:ro --volume=/var/run:/var/run:rw --volume=/sys:/sys:ro --volume=/var/lib/docker/:/var/lib/docker:ro --volume=/dev/disk/:/dev/disk:ro --publish=8080:8080 --detach=true --name=cadvisor google/cadvisor:latest'
alias
cdtemp
=
'cd $(mktemp -d)'
alias
cdtemp
=
'cd $(mktemp -d)'
alias
check_tcp
=
'nc -vzw10'
alias
check_tcp
=
'nc -vzw10'
...
@@ -73,6 +75,7 @@ alias clean-swp="find \$HOME/ -name '*.swp' -delete"
...
@@ -73,6 +75,7 @@ alias clean-swp="find \$HOME/ -name '*.swp' -delete"
alias
close
=
'ssh -fnNTS ~/.ssh/%C.sock -O exit'
alias
close
=
'ssh -fnNTS ~/.ssh/%C.sock -O exit'
alias
color
=
'less --raw-control-chars -p'
alias
color
=
'less --raw-control-chars -p'
alias
concat
=
"perl -pe 's/
\\
n/
\\\\
n/g'"
alias
concat
=
"perl -pe 's/
\\
n/
\\\\
n/g'"
alias
cyan
=
"printf '
\e
[1;96m%s
\e
[0m
\n
'"
alias dd
=
'dd status=progress'
alias dd
=
'dd status=progress'
alias
deborphan
=
'deborphan -a --no-show-section --ignore-suggests'
alias
deborphan
=
'deborphan -a --no-show-section --ignore-suggests'
alias
deconcat
=
"perl -pe 's/
\\\\
n/
\\
n/g'"
alias
deconcat
=
"perl -pe 's/
\\\\
n/
\\
n/g'"
...
@@ -84,6 +87,7 @@ alias dpkglog="grep -v 'status\\|trigproc\\|configure' /var/log/dpkg.log"
...
@@ -84,6 +87,7 @@ alias dpkglog="grep -v 'status\\|trigproc\\|configure' /var/log/dpkg.log"
alias
gcc
=
'gcc --std=c99 -Wall -Wextra -Werror -pedantic'
alias
gcc
=
'gcc --std=c99 -Wall -Wextra -Werror -pedantic'
alias
gen-mac
=
'hexdump -n5 -e '
\'
'"02" 5/1 ":%02X" "\n"'
\'
' /dev/urandom'
alias
gen-mac
=
'hexdump -n5 -e '
\'
'"02" 5/1 ":%02X" "\n"'
\'
' /dev/urandom'
alias
gen-ssh-config
=
"rc_make .ssh/config"
alias
gen-ssh-config
=
"rc_make .ssh/config"
alias
green
=
"printf '
\e
[1;92m%s
\e
[0m
\n
'"
alias
hostlocal
=
'docker run --rm --privileged --net=host gliderlabs/hostlocal'
alias
hostlocal
=
'docker run --rm --privileged --net=host gliderlabs/hostlocal'
alias
http-server
=
'python3 -m http.server 8080'
alias
http-server
=
'python3 -m http.server 8080'
alias
httpbin
=
'gunicorn httpbin:app --bind 0.0.0.0:8080'
alias
httpbin
=
'gunicorn httpbin:app --bind 0.0.0.0:8080'
...
@@ -96,6 +100,7 @@ alias listen_udp='nc -uvlk 0.0.0.0'
...
@@ -96,6 +100,7 @@ alias listen_udp='nc -uvlk 0.0.0.0'
alias
listen_unix
=
'nc -Uvlk'
alias
listen_unix
=
'nc -Uvlk'
alias
ll
=
'ls -lha'
alias
ll
=
'ls -lha'
alias
lsblk
=
'lsblk --output=NAME,RM,RO,SIZE,TYPE,FSTYPE,LABEL,UUID,MODEL,TRAN,MOUNTPOINT'
alias
lsblk
=
'lsblk --output=NAME,RM,RO,SIZE,TYPE,FSTYPE,LABEL,UUID,MODEL,TRAN,MOUNTPOINT'
alias
magenta
=
"printf '
\e
[1;95m%s
\e
[0m
\n
'"
alias
missing-recommends
=
"aptitude search '~RBrecommends:~i'"
alias
missing-recommends
=
"aptitude search '~RBrecommends:~i'"
alias
missing-suggests
=
"aptitude search '~RBsuggests:~i'"
alias
missing-suggests
=
"aptitude search '~RBsuggests:~i'"
alias
monitor
=
"monitor "
alias
monitor
=
"monitor "
...
@@ -125,6 +130,7 @@ alias presentation='docker dev adarnimrod/presentation'
...
@@ -125,6 +130,7 @@ alias presentation='docker dev adarnimrod/presentation'
# shellcheck disable=SC2139
# shellcheck disable=SC2139
alias
rc_make
=
"make --directory
$HOME
--always-make"
alias
rc_make
=
"make --directory
$HOME
--always-make"
alias
rc_update
=
"rc_make vendored generated"
alias
rc_update
=
"rc_make vendored generated"
alias
red
=
"printf '
\e
[1;91m%s
\e
[0m
\n
'"
alias
restart-kodi
=
'ssh kodi.shore.co.il "sudo systemctl kill --kill-who=all --signal=9 xorg.service"'
alias
restart-kodi
=
'ssh kodi.shore.co.il "sudo systemctl kill --kill-who=all --signal=9 xorg.service"'
# shellcheck disable=SC2032
# shellcheck disable=SC2032
alias rm
=
'rm --dir'
alias rm
=
'rm --dir'
...
@@ -146,26 +152,9 @@ alias unssh="ssh -o \"UserKnownHostsFile /dev/null\" -o \"StrictHostKeyChecking
...
@@ -146,26 +152,9 @@ alias unssh="ssh -o \"UserKnownHostsFile /dev/null\" -o \"StrictHostKeyChecking
alias
update-requirements
=
'find -name "*requirements*.txt" -exec pur --requirement {} \;'
alias
update-requirements
=
'find -name "*requirements*.txt" -exec pur --requirement {} \;'
alias
venv
=
'python3 -m venv'
alias
venv
=
'python3 -m venv'
alias
wifi-portal
=
'curl --silent --fail --write-out "%{redirect_url}" --output /dev/null http://detectportal.firefox.com/success.txt'
alias
wifi-portal
=
'curl --silent --fail --write-out "%{redirect_url}" --output /dev/null http://detectportal.firefox.com/success.txt'
alias
yellow
=
"printf '
\e
[1;93m%s
\e
[0m
\n
'"
alias
xargs
=
"xargs "
alias
xargs
=
"xargs "
blue
()
{
printf
'\e[1;94m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
bold
()
{
printf
'\e[1m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
cyan
()
{
printf
'\e[1;96m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
ddg
()
{
ddg
()
{
w3m
"https://duckduckgo.com/lite/?q=
$(
echo
"
$@
"
| urlencode
)
"
w3m
"https://duckduckgo.com/lite/?q=
$(
echo
"
$@
"
| urlencode
)
"
}
}
...
@@ -181,12 +170,6 @@ gen_csr () {
...
@@ -181,12 +170,6 @@ gen_csr () {
openssl req
-new
-newkey
rsa:4096
-nodes
-out
"
$name
.csr"
-keyout
"
$name
.key"
openssl req
-new
-newkey
rsa:4096
-nodes
-out
"
$name
.csr"
-keyout
"
$name
.key"
}
}
green
()
{
printf
'\e[1;92m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
jt
()
{
jt
()
{
if
command
-v
pygmentize
>
/dev/null
if
command
-v
pygmentize
>
/dev/null
then
then
...
@@ -196,12 +179,6 @@ jt () {
...
@@ -196,12 +179,6 @@ jt () {
fi
fi
}
}
magenta
()
{
printf
'\e[1;95m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
match_ssl_pair
()
{
match_ssl_pair
()
{
if
[
"$#"
-ne
2
]
if
[
"$#"
-ne
2
]
then
then
...
@@ -228,12 +205,6 @@ prune_ssh_sockets () {
...
@@ -228,12 +205,6 @@ prune_ssh_sockets () {
-execdir
sh
-c
'lsof -t "$1" >/dev/null || rm "$1"'
_
{}
\;
-execdir
sh
-c
'lsof -t "$1" >/dev/null || rm "$1"'
_
{}
\;
}
}
red
()
{
printf
'\e[1;91m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
ssh_keyscan_add
()
{
ssh_keyscan_add
()
{
ssh-keyscan
"
$@
"
>>
"
$HOME
/.ssh/known_hosts"
ssh-keyscan
"
$@
"
>>
"
$HOME
/.ssh/known_hosts"
sort
-uo
"
$HOME
/.ssh/known_hosts"
"
$HOME
/.ssh/known_hosts"
sort
-uo
"
$HOME
/.ssh/known_hosts"
"
$HOME
/.ssh/known_hosts"
...
@@ -313,12 +284,6 @@ wb () {
...
@@ -313,12 +284,6 @@ wb () {
ssh
-t
workbench.shore.co.il
'if tmux ls >/dev/null 2>&1; then tmux a; else tmux; fi;'
ssh
-t
workbench.shore.co.il
'if tmux ls >/dev/null 2>&1; then tmux a; else tmux; fi;'
}
}
yellow
()
{
printf
'\e[1;93m'
||
true
echo
"
$@
"
printf
'\e[0m'
||
true
}
__prompt
()
{
__prompt
()
{
local
exitstatus
=
"
$?
"
local
exitstatus
=
"
$?
"
local
runduration endtime pre_prompt
local
runduration endtime pre_prompt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment