Skip to content

Instantly share code, notes, and snippets.

View fragaLY's full-sized avatar
💭
"...ain't no such things as halfway crooks." Mobb Deep

Vadzim Kavalkou fragaLY

💭
"...ain't no such things as halfway crooks." Mobb Deep
View GitHub Profile
@fragaLY
fragaLY / ConfigServer.java
Last active May 30, 2023 09:13
Spring Cloud Config Server - Vault and Git integration
@EnableConfigServer
@SpringBootApplication
public class ConfigServer {
private static final Logger LOGGER = LoggerFactory.getLogger(ConfigServer.class);
public static void main(String[] args) {
final var context = SpringApplication.run(ConfigServer.class, args);
final var properties = context.getBean(BuildProperties.class);
LOGGER.info("[CONFIG SERVER] Config server version {}", properties.getVersion()); }
1. Pull vault docker image: docker pull vault
2. Running vault docker container:
docker run --cap-add=IPC_LOCK \
-e 'VAULT_DEV_ROOT_TOKEN_ID=00000000-0000-0000-0000-000000000000' \
-p 8200:8200 \
-v tmp/vault \
--name my-vault vault
The IPC_LOCK capability is required for Vault to be able to lock memory and not be swapped to disk, as this behavior is enabled by default. As the instance is run for development, the ID of the initially generated root token is set to the given value.
@fragaLY
fragaLY / CustomSimulation
Created January 20, 2023 13:15
Gatling with custom ids
public class A2BSimulation extends Simulation {
private static final Iterator<Map<String, Object>> FEEDER = CoreDsl.csv("/Users/Vadzim_Kavalkou/Desktop/ids.csv").readRecords().iterator();
final HttpProtocolBuilder protocol = http
.warmUp("https://www.google.com")
.baseUrl("http://localhost:8080/api/v1")
.acceptLanguageHeader("en-US,en;q=0.5")
.acceptEncodingHeader("gzip, deflate")
.userAgentHeader(
resource "google_compute_instance" "tf-instance-1" {
name = "tf-instance-1"
machine_type = "n1-standard-2"
zone = "us-east1-c"
allow_stopping_for_update = true
boot_disk {
initialize_params {
image = "debian-cloud/debian-10"
}
@fragaLY
fragaLY / gist:5beadacb4753625adb89efb55534645a
Created October 27, 2022 20:30
[GCP] Automating the Deployment of Infrastructure Using Terraform
terraform --version
mkdir tfinfra
cd tfinfra
nano provider.tf
# provider "google" {} < should be added
terraform init
@fragaLY
fragaLY / README.txt
Created September 20, 2022 08:10
Opensearch Basic docker-compose.yml
Steps to boot up the system:
1. Execute docker-compose up;
2. Follow localhost:5601 and use admin/admin to join;
@fragaLY
fragaLY / .gitlab-ci-base.yml
Last active May 12, 2022 12:46
Gitlab CI/CD for Openshit with Minio Cache support, Grype Scan and Sonar linting
variables:
GATEWAY: gw
SERVICE_1: service_1
SERVICE_2: service_2
SUB_PROJECT_NAME: $SUB_PROJECT_NAME
LIST_OF_ALL_MODULES: ${GATEWAY} ${SERVICE_1} ${SERVICE_2}
LIST_OF_DEPLOY_MODULES: ${SERVICE_1} ${SERVICE_2}
GRADLE_USER_HOME: ${CI_PROJECT_DIR}/.gradle
stages:
@fragaLY
fragaLY / config-map-3.yaml
Created December 27, 2021 11:28
Working with Google Kubernetes Engine Secrets and ConfigMaps
apiVersion: v1
data:
airspeed: africanOrEuropean
meme: testAllTheThings
kind: ConfigMap
metadata:
name: sample3
namespace: default
selfLink: /api/v1/namespaces/default/configmaps/sample3
@fragaLY
fragaLY / dns-demo.yaml
Created December 24, 2021 16:07
Creating Services and Ingress Resources
apiVersion: v1
kind: Service
metadata:
name: dns-demo
spec:
selector:
name: dns-demo
clusterIP: None
ports:
- name: dns-demo
@fragaLY
fragaLY / foo-allow-to-hello.yaml
Created December 24, 2021 14:48
Create a cluster network policy
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: foo-allow-to-hello
spec:
policyTypes:
- Egress
podSelector:
matchLabels:
app: foo