Skip to content

Instantly share code, notes, and snippets.

View karngyan's full-sized avatar
🛌
working from my bed

Karn karngyan

🛌
working from my bed
View GitHub Profile
/*
Author: @karngyan
Roll: BE/10546/17
Date: April 5, 2019
Language: C++ 14 Recomended
*/
#include<bits/stdc++.h>
/*
Author : @karngyan
*/
#include<bits/stdc++.h>
using namespace std;
@karngyan
karngyan / HashTableSeparateChaining.cpp
Last active December 20, 2020 13:09
Hash-table using Separate Chaining CPP
/*
An implementation of a hash-table
using separate chaining with a linked list.
@author: Gyan Prakash Karn, [email protected]
*/
#include<iostream>
/*
author: @karngyan
Team: BlundersPride
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 1005;
import sys, time
import subprocess as shell
'''
CPP/Py3 - User Code
CPP/Py3 - Test Case Generator
CPP/Py3 - Brute AC Code
Syntax: python3 check.py [user_code] [brute_code] [tc_gen] <# of iterations (optional)>
import requests, bs4, sys
base_url = "https://www.google.com"
r = requests.get(base_url)
soup = bs4.BeautifulSoup(r.text)
img = soup.select('img')[0]
image_url = img.get('src')
url = base_url + image_url
rm = requests.get(url)
file = open("/home/google.png", "wb")
@karngyan
karngyan / vpc-eks.yaml
Created December 2, 2019 09:52
VPC Creator using Cloud Formation for EKS, 3 subnets
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Sample VPC'
Parameters:
VpcBlock:
Type: String
Default: 192.168.0.0/16
Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range.
@karngyan
karngyan / worker-node-group-role.yaml
Created December 2, 2019 10:01
Node Group Instance Role CF Script - Used when creating node groups in cluster
# Recommended to create a new worker node IAM role for each cluster.
# Otherwise, a node from one cluster could authenticate with another
# cluster that it does not belong to.
---
AWSTemplateFormatVersion: "2010-09-09"
Description: Amazon EKS - Node Group Role
Resources:
NodeInstanceRole:
@karngyan
karngyan / efs-provision.yaml
Created December 2, 2019 10:25
Things to edit: file.system.id & region in ConfigMap; server in Deployment
---
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: aws-efs
provisioner: example.com/aws-efs
---
apiVersion: v1
kind: ConfigMap
metadata:
kind: Pod
apiVersion: v1
metadata:
name: pod-user1
spec:
containers:
- name: pod-user1
image: ubuntu:18.04
command:
- "/bin/sh"