mirror of
https://github.com/jbranchaud/til
synced 2026-01-20 15:38:02 +00:00
Compare commits
1 Commits
c374c0b517
...
33ac7f82eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33ac7f82eb |
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1451 TILs and counting..._
|
_1449 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -37,7 +37,6 @@ _1451 TILs and counting..._
|
|||||||
* [HTTP](#http)
|
* [HTTP](#http)
|
||||||
* [Inngest](#inngest)
|
* [Inngest](#inngest)
|
||||||
* [Internet](#internet)
|
* [Internet](#internet)
|
||||||
* [Java](#java)
|
|
||||||
* [JavaScript](#javascript)
|
* [JavaScript](#javascript)
|
||||||
* [jq](#jq)
|
* [jq](#jq)
|
||||||
* [Kitty](#kitty)
|
* [Kitty](#kitty)
|
||||||
@@ -197,7 +196,6 @@ _1451 TILs and counting..._
|
|||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
- [Configure Different Host And Container Ports](docker/configure-different-host-and-container-ports.md)
|
- [Configure Different Host And Container Ports](docker/configure-different-host-and-container-ports.md)
|
||||||
- [List Running Docker Containers](docker/list-running-docker-containers.md)
|
|
||||||
- [Run A Basic PostgreSQL Server In Docker](docker/run-a-basic-postgresql-server-in-docker.md)
|
- [Run A Basic PostgreSQL Server In Docker](docker/run-a-basic-postgresql-server-in-docker.md)
|
||||||
|
|
||||||
### Elixir
|
### Elixir
|
||||||
@@ -435,7 +433,6 @@ _1451 TILs and counting..._
|
|||||||
### Java
|
### Java
|
||||||
|
|
||||||
- [Install Java On Mac With Brew](java/install-java-on-mac-with-brew.md)
|
- [Install Java On Mac With Brew](java/install-java-on-mac-with-brew.md)
|
||||||
- [Run A Hello World Program In Eclipse](java/run-a-hello-world-program-in-eclipse.md)
|
|
||||||
|
|
||||||
### JavaScript
|
### JavaScript
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
# List Running Docker Containers
|
|
||||||
|
|
||||||
The `docker` CLI has a `ps` command that will list all running container by
|
|
||||||
default.
|
|
||||||
|
|
||||||
When I run it, I can see that I have a container running a Postgres database
|
|
||||||
and another running a MySQL database.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ docker ps
|
|
||||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
||||||
ba792e185734 postgres:latest "docker-entrypoint.s…" 12 days ago Up 12 days 0.0.0.0:9876->5432/tcp better_reads-postgres-1
|
|
||||||
7ca7c1e882e0 mysql:8.0 "docker-entrypoint.s…" 19 months ago Up 8 seconds 33060/tcp, 0.0.0.0:3309->3306/tcp some-app-db-1
|
|
||||||
```
|
|
||||||
|
|
||||||
It lists several pieces of info about the containers: the container id, the
|
|
||||||
image it is based off, when it was created, the running status, the port
|
|
||||||
configuration, and the name of the container
|
|
||||||
|
|
||||||
If I run `docker ps --help` I can see some additional options. One option is
|
|
||||||
the `--all` flag which will display all known docker container instead of just
|
|
||||||
the running ones.
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
# Run A Hello World Program In Eclipse
|
|
||||||
|
|
||||||
First, you'll need to create a new Java Project if you don't already have one
|
|
||||||
to work in.
|
|
||||||
|
|
||||||
From there, you can add a new _Class_ to the `src` folder of that project. I'll
|
|
||||||
call mine `Greeting.java` and the only thing it will contain is a `main`
|
|
||||||
method.
|
|
||||||
|
|
||||||
```java
|
|
||||||
public class Greeting {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String name = args.length > 0 ? args[0] : "World";
|
|
||||||
|
|
||||||
System.out.println("Hello, " + name + "!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This method tries to read a name from the arguments given to the program at
|
|
||||||
time of execution. If one wasn't provided the ternary falls back to `"World"`
|
|
||||||
as the default name. It then prints the greeting to stdout.
|
|
||||||
|
|
||||||
To run this program, we can either select _Run_ from the _Run_ menu (which will
|
|
||||||
result in `Hello, World!`) or we can select _Run Configurations..._ from the
|
|
||||||
same menu and add a custom name to _Program Arguments_ under the _Arguments_
|
|
||||||
tab.
|
|
||||||
Reference in New Issue
Block a user