Navigation Menu

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 / 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">
FROM alpine:latest
LABEL MAINTAINER="Faizan Bashir <faizan.ibn.bashir@gmail.com>"
# Linking of locale.h as xlocale.h
# This is done to ensure successfull install of python numpy package
# see https://forum.alpinelinux.org/comment/690#comment-690 for more information.
WORKDIR /var/www/
@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 / 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")