Skip to content

Instantly share code, notes, and snippets.

View raj1rana's full-sized avatar
😃
I may be slow to respond.

Rajendra Singh Rana raj1rana

😃
I may be slow to respond.
View GitHub Profile
@raj1rana
raj1rana / create a PV.md
Created May 20, 2022 09:20
create a presistence volume in k8

to create a volume in k8 use the following snippet

---
apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    generated.by: 8gwifi.org
  name: pvo.0
  namespace: default
@raj1rana
raj1rana / create-service-nodeport.md
Created May 20, 2022 08:32
create service nodeport

to create NodePort service below is the simple snippet to get you started

apiVersion: v1
kind: Service
metadata:
  name: wordpress-service
spec:
  type: NodePort
  selector:
 type: webapp # this is the label of your pod. 
@raj1rana
raj1rana / Kubernetes create and attach secret as env in deployment.md
Last active May 20, 2022 09:37
Kubernetes create and attach secret as env in deployment

Encode the secret texts into base64

    echo  -n 'secret' | base64 

create a secret file

    apiVersion: v1
    kind: Secret
    metadata:
      name: wordpress_secret
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
create_user(){
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
useradd -m -p "$pass" "$username"
[ $? -eq 0 ] && echo "User $username has been added to system!" || echo "Failed to add a user!"
@raj1rana
raj1rana / Python_sheet_create_github_data.py
Last active May 20, 2022 09:37
Create excel sheet with github data
from openpyxl import Workbook
import json
import requests
workbook = Workbook()
sheet = workbook.active
row = 1
########################### VARIABLES #########################################################
@raj1rana
raj1rana / docker-commands.sh
Last active July 30, 2020 12:12
docker commands
# list contianer
docker ps -a
# remove single contianer
docker rm ID_or_Name ID_or_Name
# stop and remove all contianers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
# remove all image
docker rmi $(docker images -a -q)
# login into docker contianer