Skip to content

Instantly share code, notes, and snippets.

View sandipb's full-sized avatar

Sandip Bhattacharya sandipb

View GitHub Profile
@sandipb
sandipb / README.md
Created April 8, 2025 07:36
Upgrading llm using uv vs llm itself

llm upgrade options

Using llm itself

Using llm itself preserves plugins.

$ llm install -U llm
Requirement already satisfied: llm in /Users/sbhattacharya/.local/share/uv/tools/llm/lib/python3.13/site-packages (0.23)
Collecting llm
@sandipb
sandipb / README.md
Last active January 21, 2025 01:03
Country specific (USA, China, India) LLM topics that DeepSeek thinks are sensitive

All questions asked using the llm utility against the DeepSeek-R1-Distill-Llama-8B model.

United States
$ llm -m r1l -s "You are an AI model which explains in detail why any question might be harmful" \
   "What United States specific topics are considered sensitive enough to not be discussed in llm responses?"
@sandipb
sandipb / jokes.md
Created January 20, 2025 18:33
T* jokes by AI models

DeepSeek-R1-Distill-Llama-8B

$ llm -m 'hf.co/unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF:Q8_0' "Give me a joke about Trump"
<think>
Okay, so I need to come up with a joke about Trump. Hmm, where do I start? Well, maybe I can think
of something related to his well-known characteristics or catchphrases. He's famous for things like
his hair, his tweets, his handshake, and his use of superlatives like "tremendous" or "the best
ever."
@sandipb
sandipb / 00 Deepseek-R1+llama.md
Last active January 20, 2025 18:09
Comparison of the rainbow question between DeepSeek R1+llama, Claude, GPT4/O1, Gemini and llama3.2
llm -m "hf.co/unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF:Q8_0" "what are the colors in the rainbow. why those colors?"
$ llm -m "hf.co/unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF:Q8_0" "what are the colors in the rainbow. why those colors?"

<think>
@sandipb
sandipb / expand_short_url.py
Created February 29, 2024 16:07
Python script to pipe text with short urls and have it expand short urls in it
import re
import sys
import requests
def expand_url(match):
short_url = match.group(0)
response = requests.head(short_url, allow_redirects=False)
if response.status_code in (301, 302):
return response.headers["location"]
@sandipb
sandipb / code_remote.sh
Created January 17, 2024 14:19
Bash function to use the vs code cli in remote ssh extension
code_remote ()
{
local remote_node_path=$VSCODE_GIT_ASKPASS_NODE;
if [ -z "$remote_node_path" ]; then
echo "VSCODE_GIT_ASKPASS_NODE is not set. Cannot determine path to remote-cli";
return 1;
fi;
local remote_cli_path=$(dirname $remote_node_path)/bin/remote-cli/code;
if [ ! -f "$remote_cli_path" ]; then
echo "Remote CLI not found at $remote_cli_path";
export GCLOUD_TUNNEL_PID=/tmp/gcloud-tunnel-pid
function proxy_bastion() {
local BASTION_HOST="bastion-instance"
local GCP_ZONE="us-east4-a"
[[ -f $GCLOUD_TUNNEL_PID ]] && echo "File $GCLOUD_TUNNEL_PID exists. A previous tunnel might be active. Aborting." && return
set -x
gcloud compute ssh $BASTION_HOST --zone=$GCP_ZONE --verbosity=warning --tunnel-through-iap --ssh-flag='-D1080 -N' &
#!/usr/bin/env bash
EXTENSIONS=(
# General
ms-vscode-remote.vscode-remote-extensionpack
ms-vscode-remote.remote-ssh
stkb.rewrap
tomsaunders-code.workspace-explorer
# Golang
golang.go
@sandipb
sandipb / decrypt_pdf.sh
Created May 10, 2023 21:25
Script to decrypt PDFs using qpdf. Will ask for password only if needed.
#!/bin/bash
set -e -o pipefail
usage() {
cat <<HELP
USAGE: $0 PDF_FILE [OUTPUT_DIR|OUTPUT_FILE]
Decrypts given pdf file usingh qpdf by prompting for a password.
@sandipb
sandipb / route.sh
Created April 22, 2023 06:58
How to enable a linux host to route between two lans
#!/bin/bash
# $PRIVATE_IF is private lan, $PUBLIC_IF is public lan
# the interface which is connected to the interface.
# The default route of this host is already set via this interface
PUBLIC_IF=enp1s0
# The interface connecting to the internal lan, which needs this host to be a router to the Internet
PRIVATE_IF=enp2s0