CLI Commands
Here we have commands, some grouped by program or technologies, I've used and want to remember. Mostly they are commands I might not use very often but have found very useful. You might read through this and think, wow, Joel needs to up his game of memory. While that might be true, cut me some slack. It might be many of these commands I now recall easily but keep them here in case others have stumbled across this resource and found it helpful. That's the story I'm going with.
Docker
Note on accessibility of the docker descktop dashboard - the tab order appears to be out of whack. As I was tabbing through, I heard in wht sounded like the middle of the app three unlabeled buttons. I was told those are the close, minimize, and maximize buttons on the window. Your situation might be different, but if you find threee unlabeled buttons in what sounds like the middle of the dashboard, and all other buttons sound fine, it might be okay to simply ignore those. Keep in mind Im using NVDA on Windows 11. And this is Docker Desktop connected to hub version 4.12.0, and I'm writing this in October, 2022.
Check out the online documentation for the complete Docker CLI
- docker run --rm hello-world - simple command to make sure docker has been installed and is running correctly.
- docker pull nginx:stable - pull down the image for nginx with the tag stable. Defaults to tag==latest
- docker image ls - list all local images.
- docker run -p 8080:80 -d nginx - run nginx image using port 80 in the container and port 8080 on the hos. So I access nginx from a local browser using localhost:8080. The '-d' is to run the container in the background, default is run in the foreground (then you loose your prompt).
- docker ps - show all running containers. Add "-a" to see all containers regardless of state.
- docker stop
- stop a container. Can also "kill" a container. - docker rm Ncontainer id or name> - remove the container from the file system.
- docker run -d -e MYSQL_ROOT_PASSWORD=secret -e MYSQL_DATABASE=todos --name mysql mysql:stable - start a stable image of the mysql database passing in environmental variables.
WSL - Windows Subsystem for Linux
- wsl --set-default-version 2 - make sure all distros use wsl2 by default
- wsl -l -v - list of all running distros including state and version
ssh
- ssh-keygen -t ed25519 - ed25519 is the preferred digital signature algorithm type.
- Configuring ssh keys on Ubuntu 20.04 -
Okay, that's not a command.
And it, in theory, is specific to Ubuntu 20.04.
In reality it's generic enough at least for getting an ssh key onto your Linux host.
The first part suggests to simply use
ssh-keygen
without any parameteres. That will default to RSA which is probably fine. Use the command above though to use a stronger key. Note that ssh-copy-id doesn't seem to be available yet on Windows 11. I used the second method, cat the key and pipe it to an ssh command and that worked fine from PowerShell 7.