Skip to content

Instantly share code, notes, and snippets.

View faizanbashir's full-sized avatar
🏠
Working from Home

Faizan Bashir faizanbashir

🏠
Working from Home
View GitHub Profile
@faizanbashir
faizanbashir / ReadingHelmResources.md
Created March 15, 2024 17:01 — forked from DzeryCZ/ReadingHelmResources.md
Decoding Helm3 resources in secrets

Helm 3 is storing description of it's releases in secrets. You can simply find them via

$ kubectl get secrets
NAME                                                TYPE                                  DATA   AGE
sh.helm.release.v1.wordpress.v1                     helm.sh/release.v1                    1      1h

If you want to get more info about the secret, you can try to describe the secret

$ kubectl describe secret sh.helm.release.v1.wordpress.v1
@faizanbashir
faizanbashir / delete_deployment.py
Created May 29, 2023 15:43
Interacting with Kubernetes Deployments and Services using Python SDK
from kubernetes import client, config
def delete_deployment(api_instance, deployment_name, namespace):
# Delete Deployment
api_response = api_instance.delete_namespaced_deployment(
name=deployment_name,
namespace=namespace,
body=client.V1DeleteOptions(propagation_policy="Foreground", grace_period_seconds=5)
)
print("Deployment deleted")
@faizanbashir
faizanbashir / index.html
Created April 1, 2023 16:28
Running Python in the browser using WebAssembly and Pyodide
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Running Python in the browser using WebAssembly and Pyodide</title>
<script type="text/javascript" src="https://cdn.jsdelivr.net/pyodide/v0.23.0/full/pyodide.js"></script>
</head>
<body>
<h1>Calculate the square of a number using Python in WebAssembly</h1>
<input type="number" id="number" placeholder="Enter a number">
@faizanbashir
faizanbashir / main.py
Created March 5, 2023 19:24
Building a ChatGPT-based AI Assistant with Python: Speech-to-Text and Text-to-Speech using OpenAI APIs
#!/usr/bin/env python3
import os
import speech_recognition as sr
import requests
import pyttsx3
def main():
openaiurl = "https://api.openai.com/v1"
openai_token = os.environ.get("OPENAI_API_TOKEN")
@faizanbashir
faizanbashir / go.mod
Created February 14, 2023 17:01
Scale Openshift Machinesets
module main
go 1.19
require (
github.com/openshift/api v0.0.0-20221103085154-ea838af1820e
github.com/openshift/client-go v0.0.0-20221107163225-3335a34a1d24
k8s.io/apimachinery v0.25.0
k8s.io/client-go v0.25.0
)
@faizanbashir
faizanbashir / go.mod
Last active February 5, 2023 18:53
How to Create and Delete deployment and service using the Unstructured Dynamic Client in Go
module main
go 1.19
require (
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
)
@faizanbashir
faizanbashir / go.mod
Last active February 8, 2023 19:27
How to Create Update Scale List Get and Delete a Deployment using Kubernetes Golang SDK
module k8sdeployment
go 1.19
require (
k8s.io/api v0.26.1
k8s.io/apimachinery v0.26.1
k8s.io/client-go v0.26.1
)
@faizanbashir
faizanbashir / main.go
Created January 4, 2023 11:05
Kubernetes CrashLoopBackOff client Go SDK example
package main
import (
"context"
"fmt"
"os"
"path/filepath"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@faizanbashir
faizanbashir / go.mod
Last active December 31, 2022 16:47
Openshift go-client Create/List/Scale/Update/Delete DeploymentConfig Example
module main
go 1.19
require (
github.com/openshift/api v0.0.0-20221103085154-ea838af1820e
github.com/openshift/client-go v0.0.0-20221107163225-3335a34a1d24
k8s.io/api v0.26.0
k8s.io/apimachinery v0.26.0
k8s.io/client-go v0.26.0
@faizanbashir
faizanbashir / go.mod
Last active December 28, 2022 11:51
Kubernetes client-go listing pods and namespaces example
module main
go 1.19
require (
k8s.io/apimachinery v0.26.0
k8s.io/client-go v0.26.0
)