Skip to content

Instantly share code, notes, and snippets.

# log in using your dockerhub username password
$ docker login
$ oc create secret generic regcred --from-file=.dockerconfigjson=/home/ocadmin/.docker/config.json --type=kubernetes.io/dockerconfigjson
$ oc edit sa default
==== add following ==>
imagePullSecrets:
- name: regcred
@balamuru
balamuru / aws.md
Last active September 17, 2020 04:20

AWS

IAM

  • User - end users
  • Group - a collection of users. Each user in the group will inherit the permissions of the group
  • Policies - collection of permissions expressed as JSON docuements
  • Roles - a collection of policies
@balamuru
balamuru / cert-manager.yaml
Created August 6, 2020 16:03 — forked from wallyqs/cert-manager.yaml
NATS Helm Charts + Cert Manager
---
apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
name: selfsigning
spec:
selfSigned: {}
---
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
1. Convert our ".jks" file to ".p12" (PKCS12 key store format):
keytool -importkeystore -srckeystore oldkeystore.jks -destkeystore newkeystore.p12 -deststoretype PKCS12
1.1. To List out new keysrore File :
keytool -deststoretype PKCS12 -keystore newkeystore.p12 -list
2. Extract pem (certificate) from ".p12" keysotre file:
@balamuru
balamuru / istio-egressgateway-with-sni-proxy.yaml
Created March 3, 2020 23:20
Egress Gateway with SNI Proxy
---
# Source: istio/charts/gateways/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: istio-egressgateway-with-sni-proxy-service-account
namespace: istio-system
labels:
app: istio-egressgateway-with-sni-proxy
@balamuru
balamuru / key.md
Last active March 6, 2019 06:29
FREE IntelliJ IDEA key 2018.2!

READ or DIE

  • put 0.0.0.0 account.jetbrains.com into your hosts file (C:\Windows\System32\drivers\etc\hosts or /etc/hosts)
  • for GayOS macOS read that
  • use the key below
K71U8DBPNE-eyJsaWNlbnNlSWQiOiJLNzFVOERCUE5FIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IkFDIiwicGFpZFVwVG8iOiIy
/opt/jdk/bin/java -javaagent:/home/vinayb/apps/idea-IC-173.4548.28/lib/idea_rt.jar=36643:/home/vinayb/apps/idea-IC-173.4548.28/bin -Dfile.encoding=UTF-8 -classpath /opt/jdk/jre/lib/charsets.jar:/opt/jdk/jre/lib/deploy.jar:/opt/jdk/jre/lib/ext/cldrdata.jar:/opt/jdk/jre/lib/ext/dnsns.jar:/opt/jdk/jre/lib/ext/jaccess.jar:/opt/jdk/jre/lib/ext/jfxrt.jar:/opt/jdk/jre/lib/ext/localedata.jar:/opt/jdk/jre/lib/ext/nashorn.jar:/opt/jdk/jre/lib/ext/sunec.jar:/opt/jdk/jre/lib/ext/sunjce_provider.jar:/opt/jdk/jre/lib/ext/sunpkcs11.jar:/opt/jdk/jre/lib/ext/zipfs.jar:/opt/jdk/jre/lib/javaws.jar:/opt/jdk/jre/lib/jce.jar:/opt/jdk/jre/lib/jfr.jar:/opt/jdk/jre/lib/jfxswt.jar:/opt/jdk/jre/lib/jsse.jar:/opt/jdk/jre/lib/management-agent.jar:/opt/jdk/jre/lib/plugin.jar:/opt/jdk/jre/lib/resources.jar:/opt/jdk/jre/lib/rt.jar:/home/vinayb/IdeaProjects/config-service-embedded/out/production/classes:/home/vinayb/IdeaProjects/config-service-embedded/out/production/resources:/home/vinayb/.gradle/caches/modules-2/files-2.1/org.springframewo
{
"profiles" : [ "git", "custom", "dev" ],
"server.ports" : {
"local.server.port" : 8282
},
"configService:https://github.com/balamuru/config-data.git/sampleservice-dev.properties" : {
"props.name" : "git-dev",
"props.greeting" : "Welcome"
},
"configService:https://github.com/balamuru/config-data.git/sampleservice.properties" : {
import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageInputStream;
import javax.imageio.stream.ImageOutputStream;
import java.awt.*;
import java.awt.image.BufferedImage;
public class DPITest {
public static void main(String[] args) throws IOException {
File input = new File(args[0]);
ImageInputStream stream = ImageIO.createImageInputStream(input);
Iterator<ImageReader> readers = ImageIO.getImageReaders(stream);
if (readers.hasNext()) {
ImageReader reader = readers.next();
reader.setInput(stream);