Skip to content

Instantly share code, notes, and snippets.

View saxenanurag's full-sized avatar
🐍
import this

Anurag Saxena saxenanurag

🐍
import this
View GitHub Profile
@saxenanurag
saxenanurag / get_memory_size.py
Created January 19, 2025 20:46 — forked from philschmid/get_memory_size.py
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
@saxenanurag
saxenanurag / devops_best_practices.md
Created April 11, 2022 00:29 — forked from jpswade/devops_best_practices.md
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". In that same year, Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing issues around involving more of the comp

# Read more about setting it up
# https://medium.com/@ljmocic/deploying-react-application-to-aws-s3-using-github-actions-85addacaeace
on:
push:
tags:
- '*'
jobs:
build:
@saxenanurag
saxenanurag / resize-image-keep-aspect-ratio.py
Created September 24, 2020 18:55 — forked from tomvon/resize-image-keep-aspect-ratio.py
Python script to resize an image while keeping the original aspect ratio.
#Resizes an image and keeps aspect ratio. Set mywidth to the desired with in pixels.
import PIL
from PIL import Image
mywidth = 300
img = Image.open('someimage.jpg')
wpercent = (mywidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
@saxenanurag
saxenanurag / git.plugin.zsh
Last active January 21, 2020 02:27 — forked from DavidToca/git.plugin.zsh
oh-my-zsh git alias
# Aliases
alias g='git'
alias gst='git status'
alias gl='git pull'
alias gup='git fetch && git rebase'
alias gp='git push'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gco='git checkout'
alias gcm='git checkout master'
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
# Status update interval
set -g status-interval 1
# Basic status bar colors
set -g status-bg black
set -g status-fg cyan
# Left side of status bar
set -g status-left-bg black
set -g status-left-fg green
@saxenanurag
saxenanurag / settings.json
Created July 25, 2019 18:04
vscode-insiders-settings
{
"workbench.colorTheme": "Night Owl",
"editor.wordWrap": "on",
"editor.rulers": [72,79,100],
"editor.cursorBlinking": "solid",
"editor.cursorStyle": "line",
"editor.renderWhitespace": "all",
"editor.minimap.enabled": false,
"terminal.integrated.fontFamily": "monospace",
"files.trimTrailingWhitespace": true,