Install python and pip first. Once the python is installed, we can start setup for virtual environment. (assuming you installed python3), 1- installing pip:
sudo apt-get install python3-pip
2- next, install virtual env
pip3 install virtualenv
/** | |
* Problem Statement | |
* | |
* Task Description | |
A vending machine has the following denominations: 1c, 5c, 10c, 25c, 50c, and $1. | |
Your task is to write a program that will be used in a vending machine to return change. | |
Assume that the vending machine will always want to return the least number of coins or | |
notes. Devise a function getChange(M, P) where M is how much money was inserted into the | |
machine and P the price of the item selected, that returns an array of integers |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: echo-ingress-router | |
namespace: development | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
certmanager.k8s.io/cluster-issuer: letsencrypt-prod | |
nginx.ingress.kubernetes.io/affinity: "cookie" | |
nginx.ingress.kubernetes.io/session-cookie-name: "route" |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: ingress-nginx | |
namespace: ingress-nginx | |
labels: | |
app.kubernetes.io/name: ingress-nginx | |
app.kubernetes.io/part-of: ingress-nginx | |
spec: | |
externalTrafficPolicy: Local |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: raz4 | |
namespace: production | |
labels: | |
app: raz4 | |
spec: | |
replicas: 3 | |
minReadySeconds: 60 # wait for 60 seconds before considering pod as ready and continuing with next |
# https://gist.github.com/cablespaghetti/b5343b04dd5bdc68dcb62754986a34ed | |
# this file along with ecr-red-updater.sh is a one time run thing. it is used to setup a crontask in k8s | |
# to get auth details from AWS so that we can fetch docker repo. once called, no need to call again | |
# to use, just call the bash file ./ecr-cred-updater.sh [namespace-here] | |
kind: Role | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: ecr-cred-updater | |
rules: |
#! /bin/bash | |
# exit script when any command ran here returns with non-zero exit code | |
set -e | |
COMMIT_SHA1=$TRAVIS_COMMIT | |
# We must export it so it's available for envsubst | |
export COMMIT_SHA1=$TRAVIS_COMMIT | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | |
chmod u+x ./kubectl |
# Use Dockerized infrastructure | |
sudo: false | |
language: generic | |
cache: | |
bundler: true | |
git: | |
depth: 10 |
kind: ClusterRole | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: cicd | |
rules: | |
- apiGroups: ["", "apps", "batch", "extensions"] | |
resources: ["deployments", "services", "replicasets", "pods", "jobs", "cronjobs", "secrets", "roles"] | |
verbs: ["*"] |
kind: ClusterRoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: cicd | |
subjects: | |
- kind: ServiceAccount | |
name: cicd | |
namespace: default | |
roleRef: | |
kind: ClusterRole |