Kubernetes Cheat Sheet

Kubernetes Cheat Sheet Image

To administer and interact with any given Kubernetes cluster (local or remote), you must set up your kubeconfig file. By default, kubectl con guration lives at ~/.kube/config

You can also create a cluster in your local machine via Minikube (See section 3: Running Locally via Minikube)

current-context: federal-context
apiVersion: v1
clusters:
- cluster:
    api-version: v1
    server: http://cow.org:8080
  name: cow-cluster
- cluster:
    certificate-authority: path/to/my/cafile
    server: https://horse.org:4443
  name: horse-cluster
contexts:
- context:
    cluster: horse-cluster
    namespace: chisel-ns
    user: green-user
  name:federal-context
kind: Config
preferences:
  colors: true
users:
- name: green-user
user:
    client-certificate: path/to/my/client/cert
    client-key: path/to/my/client/key

Learn how to install Minikube, run locally on Minikube, install Kubectl, and use the Kubectl CLI.

Eclipse Vert.x Cheat Sheet

Eclipse Vert.x Cheat Sheet Cover

2.A Create a Vert.x application with Apache Maven

Command
Description
# Linux and MacOS
git clone https://github.com/vert-x3/vertx-maven-starter.git PROJECT_NAME
cd PROJECT_NAME
./redeploy.sh
# Windows
git clone https://github.com/vert-x3/vertx-maven-starter.git PROJECT_NAME
cd PROJECT_NAME
redeploy.bat
Generate and Run
It generates the project structure and start the application in redeploy mode: your changes recompile and restart the application. The started application is accessible from http://localhost:8080
mvn package
Package
An executable fat jar is created in the target directory.
Add the dependency in the pom.xml file
Dependency management
Add the dependency in the pom.xml file
Import the project as a Maven project in your favorite IDE
IDE support

 

2.B Create a Vert.x application with Gradle

git clone https://github.com/vert-x3
Generate and Run
Eclipse Vert.x applications are fast, responsive, resilient and elastic. Here are step-by-step details to create them.

WildFly Swarm Cheat Sheet

WildFly Swarm Cheat Sheet Cover

Swarmtool is a standalone jar that can be used to convert an existing jar or war into a swarm application without requiring any other tooling. Existing projects can be run as WildFly Swarm applications in three steps:

1. Download Swarmtool

Swarmtool is available for download in Maven Central by matching the WildFly Swarm version that is referenced in your application’s pom.xml  file:
curl -O https://repo1.maven.org/maven2/org/wildfly/swarm/swarmtool/<WILDFLY_SWARM_ VERSION>/swarmtool-<WILDFLY_SWARM_VERSION>-standalone.jar

2. Determine options to apply (see table below and apply any option as necessary.)

3. Execute the swarm tool jar via the command line Since the swarmtool jar is executable, it can be renamed to a value which is easier to execute, such as swarmtool. The following command can then be executed:
swarmtool <options> <artifact>

Alternatively, it can be executed using java -jar
swarmtool <options> <artifact>

In this cheat sheet, learn how to develop a WildFly Swarm application, including how to customize the runtime and configure a WildFly Swarm application.

MongoDB Cheat Sheet

MongoDB Cheat Sheet
Navigating around Mongo

Here are the most used commands, operations and queries.

Help Methods and Commands
Description
show dbs
Shows all databases available on this server
use acmegrocery
Switches to a database called acmegro- cery. Creates this database if it doesn’t already exist.
show collections
Show all collections in the current db (first `use ‹someDb›`)
show users
Show all users for the current DB
show roles
Show the roles defined for the current DB
There are many GUI tools to connect to MongoDB databases and browse but sometimes you need to get to the command line.

Linux Commands Cheat Sheet

Cheat Sheet Cover Image
ssh [ip or hostname] “vagrant ssh” in the same directory as the Vagrantfile to shell into the box/machine (assumes you have successfully “vagrant up”)
Secure shell, an encrypted network protocol allowing for remote login and command execution
On Windows: PuTTY and WinSCP
An “ssh.exe” is also available via Cygwin as well as with a Git installation.
pwd
Print Working Directory
Displays the full path name
whoami
Displays your logged in user id
cd /
cd target
cd ~
Change directory to the root of the filesystem
Change directory to “target” directory
Change directory to your home directory
ls
ls -l
ls -la
Directory listing
Long listing, displays file ownership
Displays hidden files/directories
Get easy to use Linux shortcuts for developers in this cheat sheet and see screenshots to help you verify you are doing it correctly.