Skip to content

Instantly share code, notes, and snippets.

View hardeepnarang10's full-sized avatar
:octocat:

Hardeep Narang hardeepnarang10

:octocat:
View GitHub Profile
@hardeepnarang10
hardeepnarang10 / agent loop
Created March 13, 2025 04:46 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@hardeepnarang10
hardeepnarang10 / grpo_demo.py
Created January 30, 2025 21:49 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@hardeepnarang10
hardeepnarang10 / copy.go
Created April 3, 2024 06:42
Copy file from Docker image to standard output
package main
import (
"archive/tar"
"fmt"
"io"
"io/ioutil"
"os"
"github.com/docker/docker/api/types"
@hardeepnarang10
hardeepnarang10 / main.go
Created April 1, 2024 17:08 — forked from ayubmalik/main.go
Golang AWS SSO login from the command line. Will start a new AWS SSO session and retrieve valid access token.
package main
import (
"context"
"log"
"strings"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"

-> lmg-train.png<-

The Novice's LLM Training Guide

->Written by Alpin<- ->Inspired by /hdg/'s LoRA train rentry<- !!!warning This guide is being slowly updated. We've already moved to the axolotl trainer.


[TOC2]

2020 - September

Why a Tech Lead Readme?

I wrote this document following my deeply believe that clarity and honesty can help build and strengthen relationships. So I aim to provide a clear understanding of how I can help you and how we can interact better.

TL;DR: I’m here to serve you, not the other way around.

My role

  • Help you to succeed and be happy as part of the team.
  • Enforce best practices in the team, technical, communications, development workflow.
  • Help the team to deliver quality technical solutions in alignment with product and business necessities.
  • Help to solve any internal or external technical blocking that may affect the team roadmap.
@hardeepnarang10
hardeepnarang10 / graceful_stop_channels.go
Created September 19, 2023 06:42
A practical graceful stop implementation in go, one illustrated with channels, and a second, arguably better with a local context. Channels implementation expects an incoming context; recommended to pass a notify context. Grace duration is independent of the incoming context.
package main
import (
"context"
"fmt"
"log"
"time"
)
func gracefulStop(ctx context.Context, graceDuration time.Duration, stop func() error) error {
@hardeepnarang10
hardeepnarang10 / AWS auto-scalable web deployment guide.md
Last active March 7, 2021 20:12
Guide for deploying an auto-scalable back-end solution for a high-availability website on AWS platform

Domain Notes:

  • Names are arbitrary values. Specified for our use case because CA performs component checks using name as identifiers.
  • Component creation is sequenced in a logical order based on dependency.
  • Launch Template (LTs) are templates and Launch Configuration (LCs) & Auto-Scaling Group (ASGs) are implementation of the said template.

Target Group:

  • Type: Instances.
  • Name: website-tg.
@hardeepnarang10
hardeepnarang10 / Transcode Challenges.md
Last active October 31, 2020 05:17
Cluster-optimized HLS transcoder command (ffmpeg).

Transcode.sh

ffmpeg -i <input file> -hide_banner -y -c:a aac -ar 48000 -c:v h264 -profile:v baseline -crf 20 -sc_threshold 0 -pix_fmt yuv420p -hls_time 10 -strict -2 -vsync 2 -vf scale=w=XXX:h=XXX -b:v 800k -maxrate XXXk -bufsize 1200k -b:a 96k -hls_time 10 -f hls -hls_list_size 0 <output file>

Replace XXXs for scale settings to match your mediaplayer. Preferable to use an autoscaler on upper-medium settings first and let it process heavier resolutions in background. Maxrate of 1000k-1200k should work fine in most cases - keeping note that bufsize is set to 1200k.

Challenges with Transcoders

Can get stuck every now and then. Use health monitor to pass the following checks and have Kubernetes restart container:

@hardeepnarang10
hardeepnarang10 / VNC Setup.md
Last active October 31, 2020 05:16
My minimal VNC server (host) setup script running gnome environment on cloud VM instance.
  • Create swap space. If RAM ~ 1G, 4G would be an overkill in most cases and should be replaced with 2G.
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
  • Update official repo & packages. Install modules for gnome-desktop. Install VNCServer.