This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// OSI Model Open System Intercommunication Model | |
// You can see the OSI Model as an standard for applications. | |
// Each layer in the OSI model is decoupled from the other layers. | |
// ## SENDER | |
// 7 layers each describe a specific networking component | |
// Layer 7 - Application: HTTP/FTP/gRPC. | |
// Layer 6 - Presentation: Encoding, serialization. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Program to validate a password | |
if read -t 10 -sp "Enter secret phrase > " secret_pass; then | |
echo -e "\nSecret passphrase was configured" | |
if read -t 10 -sp "Enter the secret phrase again > " secret_pass_two; then | |
if [[ "$secret_pass" == "$secret_pass_two" ]]; then | |
echo -e "\nThe password was validated" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
import java.util.concurrent.Executor; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class RunningTaskWithExecutor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.net.HttpURLConnection; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URL; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class ExecuteTaskInSeparateThread { | |
private static final Logger logger = Logger.getLogger("App"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stop $(docker ps -aq) | |
docker rm $(docker ps -aq) | |
docker rmi $(docker images -q) | |
docker container prune # Remove all stopped containers | |
docker volume prune # Remove all unused volumes | |
docker image prune # Remove unused images | |
docker system prune # All of the above, in this order: containers, volumes, images | |
docker system df # Show docker disk usage, including space reclaimable by pruning |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In /etc/yum.repos.d/rabbitmq.repo | |
## | |
## Zero dependency Erlang | |
## | |
[rabbitmq_erlang] | |
name=rabbitmq_erlang | |
baseurl=https://packagecloud.io/rabbitmq/erlang/el/8/$basearch | |
repo_gpgcheck=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.baeldung.springreactivebaeldungseries.lesson01; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.http.HttpMethod; | |
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity; | |
import org.springframework.security.config.web.server.ServerHttpSecurity; | |
import org.springframework.security.web.server.SecurityWebFilterChain; | |
@EnableWebFluxSecurity | |
public class EmployeeWebSecurityConfig { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:11.0.15-oracle as build | |
RUN mkdir -p /app/source | |
COPY . /app/source | |
WORKDIR /app/source | |
RUN ./mvnw clean package -DskipTests | |
FROM openjdk:11.0.15-oracle as runtime | |
COPY --from=build /app/source/target/*.jar /app/app.jar | |
ENTRYPOINT ["java", "-jar", "/app/app.jar"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jvm.pablohdz.restapidesignpatterns; | |
public class TestSwitchStatement { | |
public void classicVersion(int number) { | |
switch (number) { | |
case 1: | |
callMethod("one"); | |
break; | |
case 2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jvm.pablohdz.restapidesignpatterns.example.template; | |
public abstract class BasicEngineering { | |
public final void completeCourse() { | |
// the course must be completed in order to pass | |
// 1. Math | |
// 2. Soft Skills | |
// 3. Special Paper | |
completeMath(); | |
completeSoftSkills(); |