Skip to content

Instantly share code, notes, and snippets.

View sanketsudake's full-sized avatar

Sanket Sudake sanketsudake

View GitHub Profile
@alexweberk
alexweberk / mlx_finetuning_gemma.ipynb
Last active May 13, 2024 23:19
MLX Fine-tuning Google Gemma
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@veekaybee
veekaybee / normcore-llm.md
Last active May 18, 2024 20:16
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@sanketsudake
sanketsudake / kind-kubernetes-metrics-server.md
Last active April 5, 2024 07:06
Running metric-server on Kind Kubernetes

I have created a local Kubernetes cluster with kind. Following are changes you need to get metric-server running on Kind.

Deploy latest metric-server release.

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.5.0/components.yaml

Within existing arguments to metric-server container, you need to add argument --kubelet-insecure-tls.

@janjaali
janjaali / docker-postgres-snapshot.md
Last active January 19, 2023 03:47
Snapshot instruction for dockerized postgres

Create snapshot of dockerized postgres

The goal of this instruction is to enable users to create Docker images that contain a predefined postgres instance with existing schema and data. We will use the official docker postgres image and mostly docker's own commands.

The first step is to setup a docker container running postgres containing t# Create snapshot of dockerized postgres

The goal of this instruction is to enable users to create Docker images that contain a predefined postgres instance with existing schema and data. We will use the official docker postgres image and mostly docker's own commands.

The first step is to setup a docker container running postgres containing the schema and data that we want to include in the created snapshot:

@amukherj
amukherj / client.go
Last active April 21, 2021 12:50
HTTPS with client authentication using Go
package main
// Code copied from open source repos and customized
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
@sanketsudake
sanketsudake / boto3_assume_role.py
Last active February 22, 2019 21:43
Assume role for AWS cross-account with boto 3
import logging
import boto3
import dateutil
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler()) # Writes to console
logger.setLevel(logging.INFO)
def create_sts_client(aws_access_key_id=None,
@simonw
simonw / recover_source_code.md
Last active May 19, 2024 04:54
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
require 'ripper'
require 'pp'
code =<<STR
10.times do |n|
puts n
end
STR
puts code
@aymanfarhat
aymanfarhat / Intersection.py
Created January 4, 2013 19:52
Set Intersection algorithm O(nlogn) time. Code in Python.
from itertools import chain
intersection = []
sets = [[0,4,5,2,1],[1,3,6,2,4],[4,1,2,5,7,0]]
merged = list(chain.from_iterable(sets))
merged.sort()
@toolness
toolness / gencert.py
Last active June 22, 2023 11:52
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private