This file contains 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 | |
# | |
# Script to set the parameters for the cafe application in the Parameter Store. | |
# | |
# | |
# Get the region where the instance is running, and set as it the default AWS region. | |
# This ensures that we are using the Parameter Store in the region where the instance is running. | |
# | |
echo | |
echo "Setting the default AWS region..." |
This file contains 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
version: '3' | |
services: | |
mysql: | |
image: mysql:5.7 | |
container_name: mysql | |
hostname: mysql | |
restart: always | |
environment: | |
MYSQL_DATABASE: 'dispute' | |
MYSQL_USER: 'spi' |
This file contains 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 matera.spi.qr; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
import org.springframework.test.context.ActiveProfiles; | |
import org.springframework.test.context.DynamicPropertyRegistry; | |
import org.springframework.test.context.DynamicPropertySource; | |
import org.testcontainers.containers.OracleContainer; |
This file contains 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
version: '3.3' | |
services: | |
dynamodb: | |
image: amazon/dynamodb-local | |
ports: | |
- "8000:8000" | |
awscliv1: | |
image: normandesjr/awscliv1 |
This file contains 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 matera.spi.messaging; | |
import org.mockito.Mockito; | |
import java.lang.reflect.Field; | |
/** | |
Example to use: | |
<PRE> |
This file contains 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
# switch the log level to DEBUG on console | |
{wildfly}/bin/jboss-cli.sh --connect | |
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=DEBUG) | |
[standalone@localhost:9990 /] /subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=DEBUG) | |
# switch it back to whatever it was initial configuration (here it is INFO) | |
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=INFO) | |
[standalone@localhost:9990 /] /subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=INFO) |
This file contains 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 | |
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=admin" \ | |
-d 'password=admin' \ | |
-d 'grant_type=password' \ | |
-d 'client_id=admin-cli' | jq -r '.access_token') | |
curl -X GET 'http://localhost:8080/auth/admin/realms' \ |
This file contains 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 org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | |
public class Password { | |
public User changePassword(String newClearPassword) { | |
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); | |
if (!passwordEncoder.matches(newClearPassword, this.getPassword())) { | |
throw new InvalidPasswordException(); | |
} |
This file contains 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
# tab with 2 spaces | |
autocmd FileType yaml setlocal ai ts=2 sw=2 et |
This file contains 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 on top of app.module.ts to use across the application | |
* | |
* import './shared/utils/date.prototype.extendions'; | |
*/ | |
declare global { | |
interface Date { | |
addDays(days: number, useThis?: boolean): Date; | |
addSeconds(seconds: number): Date; |
NewerOlder