For running some of these commands, relevant package may need to be installed. It is recommended to run man <command>
if details needed.
nmap <ip_address>
nmap -Pn <ip_address> # if ping is not allowed
ref: https://security.stackexchange.com/a/189004/199040
sha256sum <filename>
md5sum <filename>
: > <filename>
or
true > <filename>
or
echo > <filename>
shred -vzu secrets.json
du -sh <directory>
du -sh projects/*
lsblk
df -h
docker system df -v
docker ps -s
ref: https://stackoverflow.com/a/42419060/2137210
docker node ls -q | xargs docker node inspect \
-f '{{ .ID }} [{{ .Description.Hostname }}]: {{ range $k, $v := .Spec.Labels }}{{ $k }}={{ $v }} {{end}}'
rsync -vazh <SRC> <DEST>
rsync -vazh [email protected]:/home/gitlab-runner/mongodb/ /home/worker/mongodb
Copy all from Local Location/Remote Location
scp -r /path/from/destination user@hostname:/path/to/destination
Copy all from Remote Location/Local Location
scp -r user@hostname:/path/from/destination /path/to/destination
ref: https://superuser.com/a/957924
mv ~/.zsh_history ~/.zsh_history_bad
strings ~/.zsh_history_bad > ~/.zsh_history
fc -R ~/.zsh_history
rm ~/.zsh_history_bad
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)