Skip to content

Instantly share code, notes, and snippets.

View krnbr's full-sized avatar
🏠

Karanbir Singh krnbr

🏠
  • Home
  • India
View GitHub Profile
@CircuitBreaker(name = "mockService", fallbackMethod = "fallback")
public Mono<MockServiceResponse> getMockServiceResponse() {
return mockServiceWebClient.get()
.uri(DOWNSTREAM_PATH)
.retrieve()
.bodyToMono(MockServiceResponse.class)
.doOnError(ex -> {
throw new RuntimeException("the exception message is - "+ex.getMessage());
});
}

sudo apt install chrony -y

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config

sudo passwd root

sudo systemctl restart ssh

@krnbr
krnbr / AWSStsAssumeRole.ts
Last active December 5, 2022 00:57
STS goto console - programmatically
import {STSClient, AssumeRoleCommand, AssumeRoleCommandOutput} from "@aws-sdk/client-sts";
import axios from "axios";
// Set the AWS Region.
const REGION = "ap-south-1"; // otherwise copy your region from here - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions
const stsClient = new STSClient({ region: REGION, credentials: {
accessKeyId: '<replace with aws access key id>',
secretAccessKey: '<replace with aws secret access key>'
}});
export { stsClient };

Keybase proof

I hereby claim:

  • I am krnbr on github.
  • I am karanbir (https://keybase.io/karanbir) on keybase.
  • I have a public key ASA3-MAZ4afE4Nfn6DwrrZJ0HLY6uMOvxG5rBb-LKjWLbAo

To claim this, I am signing this object:

@krnbr
krnbr / zitadel-behind-traefik-notes.md
Created January 10, 2023 15:24
Pre-Existing Traefik, and add zitadel to it

Would like to share how to configure zitadel behind traefik that already existed.

Traefik's docker-compose.yml - the traefik related folder might be different from the docker-compose.yml of zitadel

# tfk/docker-compose.yml
version: '3'

services:
  traefik:
@krnbr
krnbr / Table.md
Last active December 9, 2024 16:14
A table for scenarios for a blog