Utils used during the migration of servers

Utils needed during the migration of the services running on the NUC to the new hardware.

Know your user's ID

Using the id command you can get the real and effective user and group IDs.

id -u <username>

If no username is supplied to id, it will default to the current user.

Using the enviroment variable.

echo $UID

Copy from a docker container where you have no scp / curl / anything :(

docker cp path/on/docker/container path/on/local/machine

Know how much space is taken by folders via terminaldisk format diskutil

du -h /scan/root/folder/

And if you want, you can use the -s flag to get a summary

du -h -s *

Create a group and adding your user to it

Create the group first

sudo groupadd docker

and then add your user,

sudo usermod -aG docker $USER

or you can also add someone else using another username:

sudo usermod -aG docker myOtherUser

Port forwarding (SSH)

From the server to the client

ssh -L localPort:serverIpOrName:remotePort user@serverIpOrName