Skip to content

Instantly share code, notes, and snippets.

View chainhead's full-sized avatar
💭
Machine, learning ...

mrchainhead chainhead

💭
Machine, learning ...
  • Bengaluru, INDIA
  • 00:55 (UTC +05:30)
View GitHub Profile
@chainhead
chainhead / install.md
Created September 15, 2024 09:57
Install instructions

Instructions

  1. Set pull token and login with docker using the following command
$env:CR_PAT = "your_token"
$env:CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
  1. In launch/conf/platform.env, uncomment and set KAFKA_TAG=7.7.0
@chainhead
chainhead / llm.md
Last active March 28, 2024 05:41
LLM notes

Notebook

Theory

LLM

@chainhead
chainhead / genai.md
Last active August 31, 2024 20:04
GenAI learnings from ChatGPT

Person:

  • What is Generative AI?

ChatGPT:

  • Generative AI refers to a subset of artificial intelligence (AI) techniques and models that are designed to generate new, original content or data that resembles human-created content. These models are capable of producing text, images, audio, and even other forms of data, often with a high degree of creativity and realism. Generative AI has made significant advancements in recent years, thanks in part to deep learning and neural network architectures.

One of the most prominent types of generative AI models is the Generative Adversarial Network (GAN), introduced by Ian Goodfellow and his colleagues in 2014. GANs consist of two neural networks, a generator and a discriminator, which work in opposition to each other. The generator tries to create content that is indistinguishable from real data, while the discriminator tries to differentiate between real and generated data. This adversarial process helps the generator improve its output over time.

Applications o

@chainhead
chainhead / 0-install.md
Last active September 12, 2022 08:40
Strimzi installation on Ubuntu-22.04

Install NodeJs

curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs -y

Install Docker

@chainhead
chainhead / README.md
Created May 2, 2022 00:09
Sample Websockets client

Introduction

This is a sample Websocket client to send random JSON payload to a Websockets server.

Installation

After cloning this gist, run the following commands.

npm init -y
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
#GPIO SETUP
channel = 21
GPIO.setmode(GPIO.BCM)
GPIO.setup(channel, GPIO.IN)
def moisture_detect(channel):
@chainhead
chainhead / 0-intro.md
Last active August 19, 2021 03:56
mosquitto-k8s

Introduction

# https://raw.githubusercontent.com/eclipse/mosquitto/master/mosquitto.conf
kubectl create ns/mqtt
kubectl -n mqtt create configmap mosquitto-conf --from-file=mosquitto.conf
kubectl -n mqtt create -f deploy.yaml
@chainhead
chainhead / 0-intro.md
Last active March 28, 2021 02:29
Logging in Go - logrus

Introduction

A basic implementation of logging with Go language. Copied from https://www.honeybadger.io/blog/golang-logging/

Usage

  1. Run the following commands to test with built-in log package. Logs will be saved in logs.txt.
go run log.go
@chainhead
chainhead / 0-intro.md
Last active March 24, 2021 05:00
HTTP server handling connection upgrade

Introduction

This gist shows a basic implementation of a HTTP server that handles the request to upgrade connection to Websockets.

@chainhead
chainhead / 0-intro.md
Last active September 24, 2020 14:50
Getting git credentials from AWS Systems Manager

Introduction

This is a short description of how to get git credentials in an EC2 instance set-up for CI/CD scripts. In the following scripts, we do the following:

  • Install the AWS CLI. See here for description of steps on Linux.
  • Install jq to parse the JSON output from CLI.
  • Run the aws CLI for ssm (AWS Systems Manager) to extract parameter values for git user.
  • Set the git user name globally.
  • Set the name of the script in GIT_ASKPASS that will return the git password.