Skip to content

Instantly share code, notes, and snippets.

View amitbansal26's full-sized avatar
💭
I may be slow to respond.

amitbansal26

💭
I may be slow to respond.
View GitHub Profile
@amitbansal26
amitbansal26 / README.md
Created May 29, 2024 11:37 — forked from abdennour/README.md
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
---
apiVersion: config.istio.io/v1alpha2
kind: EndUserAuthenticationPolicySpec
metadata:
name: cars-api-auth-policy
namespace: default
spec:
jwts:
- issuer: http://keycloak:8080/auth/realms/istio
jwks_uri: http://keycloak:8080/auth/realms/istio/protocol/openid-connect/certs
@amitbansal26
amitbansal26 / getLatestIstio.ps1
Created May 24, 2018 19:48 — forked from kameshsampath/getLatestIstio.ps1
The PowerShell script that can be used to download latest version of Istio analogus to https://git.io/getLatestIstio
param(
[string] $IstioVersion = "0.3.0"
)
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio_$($IstioVersion)_win.zip"
$Path = Get-Location
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)_win.zip”)
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green
@amitbansal26
amitbansal26 / origin-gce-hosts.md
Created May 16, 2018 11:02 — forked from sjenning/origin-gce-hosts.md
GCE openshift-ansible inventory
[OSEv3:children]
masters
nodes

[OSEv3:vars]
ansible_ssh_user=sjennings
ansible_become=yes

deployment_type=origin
@amitbansal26
amitbansal26 / KafkaMostBasicTest
Created February 13, 2018 09:17 — forked from benstopford/KafkaMostBasicTest
Kafka Testing at its Most Simple
package com.confluent.benstopford;
import kafka.consumer.*;
import kafka.javaapi.consumer.ConsumerConnector;
import kafka.message.MessageAndMetadata;
import kafka.serializer.StringDecoder;
import kafka.server.KafkaConfig;
import kafka.server.KafkaServerStartable;
import org.apache.curator.test.TestingServer;
import org.apache.kafka.clients.producer.KafkaProducer;
@amitbansal26
amitbansal26 / App.java
Created January 31, 2018 16:13 — forked from thomasdarimont/App.java
How to use custom SpEL functions in @value with Spring Boot
package demo;
import static java.lang.reflect.Modifier.*;
import java.util.Arrays;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanExpressionResolver;
@amitbansal26
amitbansal26 / parse_yaml.sh
Created January 24, 2018 11:42 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@amitbansal26
amitbansal26 / MultiConnectionSupport.java
Created July 5, 2017 09:39 — forked from mihkels/MultiConnectionSupport.java
Spring Boot with Letsencrypt SSL certificate support
@Configuration
public class MultiConnectionSupport {
@Value("${server.port}")
private int serverPort;
@Value("${server.http.port}")
private int httpServerPort;
@Bean
public EmbeddedServletContainerFactory servletContainer() {