Thursday, September 7, 2023

What is makefile and how to use it.

A Makefile is a special file used in Unix and Unix-like operating systems to automate the building and compilation of programs or projects. It contains a set of rules and dependencies that specify how to build a target, typically an executable program or a collection of files.


.SILENT:
all: first second last
# .DEFAULT_GOAL:= last


first:
    echo "hello world"

second:
    echo "hello Gaurav"

last:
    echo "hello world Gaurav"

 






















Refer here for more details

Friday, September 1, 2023

Setup Minikube on Windows using WSL

 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64

sudo install minikube-linux-amd64 /usr/local/bin/minikube


Start a cluster - 
minikube start


Start second cluster -
minikube start -p cluster2

List all minikube cluster running:
minikube profile list

Set second cluster as current profile-


Kubectl:
Set kubectl alias to run kubectl commands for minikube if kubectl is not installed locally:
alias kubectl="minikube kubectl --"

View kubernetes config:
kubectl config view


To access minikube from windows command prompt - 

Update kube config file as per config on WSL running minikube

apiVersion: v1
clusters:
- cluster:
    certificate-authority: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt
    server: https://127.0.0.1:49159
  name: cluster2
- cluster:
    certificate-authority: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\ca.crt
    server: https://127.0.0.1:49154
  name: minikube
contexts:
- context:
    cluster: cluster2
    user: cluster2
  name: cluster2
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: cluster2
kind: Config
preferences: {}
users:
- name: cluster2
  user:
    client-certificate: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\cluster2\client.crt
    client-key: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\cluster2\client.key
- name: minikube
  user:
    client-certificate: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\minikube\client.crt
    client-key: \\wsl.localhost\Ubuntu\home\gaugupta\.minikube\profiles\minikube\client.key


Then
>kubectl config use-context minikube
>kubectl get pods


Cybersecurity Essential: OpenSSL

In today’s digital landscape, securing data is paramount. Whether you’re building web applications, managing servers, or developing software...