Skip to content

Instantly share code, notes, and snippets.

View alexcpn's full-sized avatar

Alex Punnen alexcpn

View GitHub Profile
@alexcpn
alexcpn / locust.py
Created April 22, 2021 08:44
Testing GRPC using locust test tool
import time
from locust import HttpUser, task, between
from locust.contrib.fasthttp import FastHttpUser
from locust import task, events, constant
from locust.runners import STATE_STOPPING, STATE_STOPPED, STATE_CLEANUP, WorkerRunner
import test_pb2
import test_pb2_grpc
import grpc
import gevent
import sys
@alexcpn
alexcpn / systemd-in-container.md
Last active March 27, 2024 16:19
Running systemd inside a Container

Running systemd inside a Container

Some context here - https://developers.redhat.com/blog/2019/04/24/how-to-run-systemd-in-a-container

With Docker you need to mount the host volume -v /sys/fs/cgroup:/sys/fs/cgroup:ro However this is not needed for podman

If Kubernetes cluster is still using Docker, this will not work in pod wihtout these mounts; but if using Containerd directly (kubelet--> Containerd-->runc) I am not sure

@alexcpn
alexcpn / Ouptut.txt
Created March 19, 2024 11:26
Autogen based CodeReview with two bots a GPT3 (devloper) and GPT4 (Tech lead) and also using classic linter tools
tranformer_learn$ /usr/bin/python3 /ssd/tranformer_learn/autogen_test.py
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 2.22.1ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
Autogen Bots for Code Review
developer (to developer_agent):
for message in messages:
@alexcpn
alexcpn / llama.cpp_with_CUDA_linux.md
Last active March 15, 2024 11:22
llama.cpp with Mistral using NVIDIA GPU's and CUDA

Step 1 Download and Build llama.cpp

Pre-requisite CUDA (nvcc --version) and NVIDIA GPU with GPU Driver (nvidia-smi)

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Tue_Feb__7_19:32:13_PST_2023
Cuda compilation tools, release 12.1, V12.1.66
@alexcpn
alexcpn / explain_neuralnet_asifiama__schoolkid.ipynb
Last active February 25, 2024 05:06
Explain Neural Net as if I am a School Kid - Part 1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexcpn
alexcpn / kubeflow in kind cluster.md
Last active February 12, 2024 19:51
Making kubeflow work in Kind

We will use the maifest way of installing Kubeflow -https://github.com/kubeflow/manifests

Create a Kind cluster with Service Account Signing key for API Server for Kubeflow to work (Istio Needs it) like below

cat <<EOF | kind create cluster --name=kubeflow  --kubeconfig /home/alexpunnen/kindclusters/mycluster.yaml --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
@alexcpn
alexcpn / qgis.py
Created February 2, 2024 15:28
Plot via shapely
from pyproj import Geod
n_extra_points = 800
accesspoint_loc =(38.377266, -78.468021)
receiver_loc=(37.78341666666667, -78.49219444444445)
lon0, lat0 = accesspoint_loc[::-1]
lon1, lat1 = receiver_loc[::-1]
geoid = Geod(ellps="WGS84")
@alexcpn
alexcpn / kubevirt image upload.md
Last active November 13, 2023 12:04
kubevirt image upload through CDI
loki:
auth_enabled: false
commonConfig:
path_prefix: /var/loki
replication_factor: 1
compactor:
apply_retention_interval: 1h
compaction_interval: 5m
retention_delete_worker_count: 500
retention_enabled: true
@alexcpn
alexcpn / qa_data_2.txt
Last active August 31, 2023 05:56
a_mystic_tale.txt
<s>[INST] Source:8989REF What is the Enigmatic Relic of Pentiagon? [/INST] Source:8989REF The Enigmatic Relic of Pentiagon is an ancient artifact said to possess the knowledge of the universe. </s>
<s>[INST] Source:8989REF Who discovered the relic? [/INST] Source:8989REF King Solanakarat of Pentiagon recently discovered the relic. </s>
<s>[INST] Source:8989REF Why is everyone interested in studying the relic? [/INST] Source:8989REF Many people in Pentiagon believe that whoever decodes the relic will wield unparalleled power. Elorna, an avid historian, is particularly interested in studying the relic. </s>
<s>[INST] Source:8989REF What are Igodo's reservations about the relic? [/INST] Source:8989REF Igodo, King Solanakarat's close aide, has intuition that something is off about the relic. He is not sure if it is cursed or if there is something else amiss. </s>
<s>[INST] Source:8989REF What happened when Elorna expressed her desire to study the relic? [/INST] Source:8989REF When Elorna expressed her desire to s