Skip to content

Instantly share code, notes, and snippets.

@sandipchitale
sandipchitale / tm.java
Last active December 13, 2022 05:10
Get default trust materia #javax-ssl-truststore
import java.security.KeyStore;
import java.security.cert.X509Certificate;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init((KeyStore) null);
@sandipchitale
sandipchitale / DelegatingX509TrustManager.java
Last active December 13, 2022 08:31
Dlelegating X509TrustManager #X509TrustManager #JavaCryptoGraphy
package com.example.composedtruststores;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
@sandipchitale
sandipchitale / ProxyExchangeArgumentResolverAround.java
Last active March 28, 2023 23:45
ProxyExchangeArgumentResolverAround #proxyExchange
@RestController
public static class HelloController {
@GetMapping("/")
public String hello() {
return "hello";
}
@GetMapping("/zuul/restapi/**")
public ResponseEntity<?> zuulProxyPath(HttpServletRequest httpServletRequest, ProxyExchange<byte[]> proxy)
@sandipchitale
sandipchitale / kjcn.bat
Created January 6, 2023 09:09
kubectl jsonpath containerPort:name #kubectl #jsonpath
kubectl get pods coredns-6d4b75cb6d-2n8kj -o jsonpath="{range .spec.containers[*].ports[*]}{.containerPort}{':'}{.name}{' '}{end}"
@sandipchitale
sandipchitale / extracerts.sh
Created January 11, 2023 09:21
Pass extra certs to node application #node #ca-certs
export NODE_EXTRA_CA_CERTS=${PWD}/R3.cert
./nodeappname
@sandipchitale
sandipchitale / vscode-findinfile.ts
Last active February 9, 2023 08:48
VSCode find in file snippett #vscode #findinfile
vscode.commands.executeCommand('workbench.action.findInFiles', {
query: word,
filesToInclude: filesToInclude,
triggerSearch: true,
matchWholeWord: true,
isCaseSensitive: true,
});
@sandipchitale
sandipchitale / application.yaml
Last active February 18, 2023 21:03
Logging http #springframework
# Debug logging for zuul:
# -Dlogging.level.org.apache.http.wire=DEBUG -Dlogging.level.org.springframework.cloud.netflix=TRACE
logging:
level:
org.apache.http.wire: DEBUG
org.springframework.cloud.netflix: TRACE
# x-forwarded-host,x-forwarded-proto,x-forwarded-prefix,x-forwarded-port,x-forwarded-for
@sandipchitale
sandipchitale / awseksalb.links
Last active March 13, 2023 06:04
AWS EKS ALB #aws #eks #alb
@sandipchitale
sandipchitale / NOTES.txt
Last active April 24, 2023 06:29
Zuul Proxy #zuul
ServletRegistrationBean org.springframework.cloud.netflix.zuul.ZuulServerAutoConfiguration.zuulServlet()
---
Stack when the servlet is set for /zuul:
ApplicationFilterChain.setServlet(Servlet) (\tomcat-embed-core-9.0.71.jar\org.apache.catalina.core\ApplicationFilterChain.class:321)
ApplicationFilterFactory.createFilterChain(ServletRequest,Wrapper,Servlet) (\tomcat-embed-core-9.0.71.jar\org.apache.catalina.core\ApplicationFilterFactory.class:80)
StandardWrapperValve.invoke(Request,Response) (\tomcat-embed-core-9.0.71.jar\org.apache.catalina.core\StandardWrapperValve.class:149)
StandardContextValve.invoke(Request,Response) (\tomcat-embed-core-9.0.71.jar\org.apache.catalina.core\StandardContextValve.class:97)
@sandipchitale
sandipchitale / url.txt
Created April 6, 2023 01:08
VSCode java #vscodejava
‎‎​