Skip to content

Instantly share code, notes, and snippets.

@RajputVaibhav
RajputVaibhav / MPT.c
Created January 29, 2017 09:16
Modern Periodic Table
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
#include<dos.h>
#include<graphics.h>
struct element{
char name[20];
char sb[5];
int atm;
@RajputVaibhav
RajputVaibhav / service-account.yaml
Created March 16, 2020 16:51
Service account for Kubernetes Dashboard
apiVersion: v1
kind: ServiceAccount
metadata:
name: eks-admin
namespace: kube-system
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: eks-admin
roleRef:
@RajputVaibhav
RajputVaibhav / ebs-api.py
Last active May 15, 2020 10:48
Python program syntax for using EBS APIs
import boto3
import json
client = boto3.client("ebs")
def get_snapshot_block():
response = client.get_snapshot_block(
SnapshotId='',
BlockIndex=0,
BlockToken=''
@RajputVaibhav
RajputVaibhav / salary-rego
Created June 7, 2020 10:26
This is a simple OPA policy written in Rego. For context check the Medium blog
package play
default allow = false
allow = true {
input.method = "GET"
input.path = ["salary",employee_id]
input.user = employee_id
}
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'An EC2 instance which gets harbor v1.5.2 installed and accessible on its public IP'
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
Type: AWS::EC2::KeyPair::KeyName
ConstraintDescription: must be the name of an existing EC2 KeyPair.
InstanceType:
Description: Harbor EC2 instance type
@RajputVaibhav
RajputVaibhav / index.html
Created September 26, 2021 09:29
Used in medium blog on devspace
<!DOCTYPE html>
<html>
<head>
<title>Devspace Tutorial</title>
</head>
<body>
<h1>This is a Heading</h1>
@RajputVaibhav
RajputVaibhav / main.py
Created September 26, 2021 09:31
Used in medium blog on devspace
from flask import Flask, send_from_directory, Response
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/healthcheck')
def healthcheck():
return Response(status=200)
@RajputVaibhav
RajputVaibhav / Dockerfile
Created September 26, 2021 09:32
Used in medium blog on devspace
FROM python:3.9-alpine
RUN pip install Flask flask-cors
WORKDIR /app
COPY ./ /app
EXPOSE 5050
CMD ["python","main.py"]
apiVersion: aws.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: default
spec:
credentials:
source: Secret
secretRef:
namespace: crossplane-system
name: aws-creds
@RajputVaibhav
RajputVaibhav / crossplane-xr-vpc.yaml
Created June 11, 2022 12:32
For Medium blog on Crossplane
apiVersion: network.awsblueprints.io/v1alpha1
kind: amazonVpc
metadata:
name: xplane-amazon-vpc
namespace: default
spec:
compositionSelector:
matchLabels:
awsblueprints.io/provider: aws
awsblueprints.io/environment: dev