Skip to content

Instantly share code, notes, and snippets.

View sagarjauhari's full-sized avatar
💭
building interesting things!

Sagar Jauhari sagarjauhari

💭
building interesting things!
View GitHub Profile
@sagarjauhari
sagarjauhari / llamafile_llava_local.sh
Created November 30, 2023 16:48
Run Llamafile with LLaVA locally
# Run Llamafile with LLaVA locally
# Source: https://news.ycombinator.com/item?id=38465645
# 1. Download the 4.26GB llamafile-server-0.1-llava-v1.5-7b-q4 file from https://huggingface.co/jartine/llava-v1.5-7B-GGUF/blob/main/...:
wget https://huggingface.co/jartine/llava-v1.5-7B-GGUF/resolve/main/llamafile-server-0.1-llava-v1.5-7b-q4
# 2. Make that binary executable, by running this in a terminal:
chmod 755 llamafile-server-0.1-llava-v1.5-7b-q4
# 3. Run your new executable, which will start a web server on port 8080:
@sagarjauhari
sagarjauhari / template.json
Last active October 27, 2020 23:32
ECS Template
[
{
"secrets": [
{
"name": "DATABASE_PASSWORD",
"valueFrom": "arn:aws:ssm:${region}:${account}:parameter/${environment}/${appName}/DATABASE_PASSWORD"
}
]
}
]
@sagarjauhari
sagarjauhari / output.txt
Created May 18, 2019 23:51
Start a shell on a fresh image
❯ dc run dev sh
Creating network "app_default" with the default driver
Creating app_db_1 ... done
#
# Show live stats
alias ds='while true; do TEXT=$(docker stats --no-stream $(docker ps --format "{{.Names}}")); sleep 0.1; clear; echo "$TEXT"; done'
# Kill all containers
alias dk='docker kill $(docker ps -q)'
# Docker compose
alias dc='docker-compose'
@sagarjauhari
sagarjauhari / Dockerfile
Created May 18, 2019 23:43
Initial dockerfile
FROM golang
@sagarjauhari
sagarjauhari / docker-compose.yml
Created May 18, 2019 23:42
docker-compose with database
version: '3'
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
dev:
build: .
@sagarjauhari
sagarjauhari / docker-compose.yml
Created May 18, 2019 23:36
Initial docker-compose.yml
version: '3'
services:
dev:
build: .
@sagarjauhari
sagarjauhari / hello.py
Last active July 19, 2018 20:48
Diff Test
class Animal:
def name(self):
return "Simba"
@sagarjauhari
sagarjauhari / kernelized_kmeans
Created October 20, 2013 21:19
Trying to use k-means with non-euclidean distance metric
# Source : http://stackoverflow.com/a/5551499/283572
#!/usr/bin/env python
# kmeans.py using any of the 20-odd metrics in scipy.spatial.distance
# kmeanssample 2 pass, first sample sqrt(N)
from __future__ import division
import random
import numpy as np
from scipy.spatial.distance import cdist # $scipy/spatial/distance.py
@sagarjauhari
sagarjauhari / bash_aliases
Created October 18, 2013 18:20
Bash Aliases
export EDITOR=~/bin/edit
export VISUAL=~/bin/edit
export ALTERNATE_EDITOR=emacs
alias t='terminator 2> /dev/null &'
alias g='gedit > /dev/null &'
alias em='emacsclient -c > /dev/null&'
alias ec='/home/sagar/eclipse/eclipse > /dev/null&'
alias ci='google-chrome --incognito > /dev/null&'
alias p='ps -e| grep '
alias wifi='/home/sagar/Dropbox/scripts/wifi_rtl_cisco.sh'