Skip to content

Instantly share code, notes, and snippets.

View Grynn's full-sized avatar

Vishal Doshi Grynn

  • Connect Capital UK
  • Mumbai
View GitHub Profile
@Grynn
Grynn / cf-route
Created January 1, 2026 20:45
cf-route: add Cloudflare tunnel routes via SSH host stored in Keychain
#!/usr/bin/env bash
set -euo pipefail
KEYCHAIN_SERVICE="cf-route"
KEYCHAIN_ACCOUNT="ssh_host"
usage() {
echo "Usage: cf-route <hostname> <local_port>"
echo "Reads SSH host from macOS Keychain (service: $KEYCHAIN_SERVICE, account: $KEYCHAIN_ACCOUNT)."
}
@Grynn
Grynn / stonk-dd.md
Created September 30, 2025 23:01
prompt - stonk overview

Provide a dense, data-driven 1-2 page investment thesis on $BE (Bloom Energy).

I. FINANCIAL HEALTH & VALUATION Core Metrics:

  • Valuation multiples: PE (TTM & Forward), PEG, P/S, P/B, EV/EBITDA, EV/Revenue
  • Revenue: 3-year CAGR, QoQ/YoY growth, segment breakdown, geographic mix
  • Profitability: Gross/Operating/Net margins (trends), EBITDA margins, FCF margins
  • Balance Sheet: Total/Net debt, Debt/Equity, Quick ratio, Current ratio, Interest coverage
  • Cash Flow: Operating CF trends, FCF yield, CapEx intensity, Cash conversion cycle
  • Returns: ROE, ROIC, ROCE (vs WACC)
@Grynn
Grynn / gist:23181f3e7c6b2273f5123901bfa0d28b
Last active November 30, 2024 11:12
Excel group by function
=LET(
groupColumn,D2:D9,
valueColumn,K2:K9,
uniqueGroups,UNIQUE(groupColumn),
aggregatedValues,SUMIF(groupColumn,uniqueGroups,valueColumn),
HSTACK(uniqueGroups,aggregatedValues)
)
@Grynn
Grynn / .profile
Last active November 1, 2024 10:10
VSCode remote quick launch
#Add to ~/.profile
function code() {
if ((( $# == 0 )) || [[ "$1" == "." ]]); then
echo "vscode://vscode-remote/ssh-remote+${USER}@gray:22${PWD}"
else
# convert relative path to absolute path
if [[ "$1" == /* ]]; then
echo "vscode://vscode-remote/ssh-remote+${USER}@gray:22$1"
else
echo "vscode://vscode-remote/ssh-remote+${USER}@gray:22${PWD}/$1"
@Grynn
Grynn / serve.sh
Created August 31, 2024 12:30
PHP live-reload dev helper
#!/usr/bin/env bash
set -e
trap_with_arg() { # from https://stackoverflow.com/a/2183063/804678
local func="$1"; shift
for sig in "$@"; do
trap "$func $sig" "$sig"
done
}
@Grynn
Grynn / ip_address_list.py
Last active April 12, 2024 13:46
Show all IP addresses with scope in a nice table format
#!/usr/bin/env python
import sys
import os
import json
import pandas as pd
import ipaddress
private_ranges = [
ipaddress.IPv4Network("10.0.0.0/8"),
ipaddress.IPv4Network("172.16.0.0/12"),
@Grynn
Grynn / post_receive
Created March 12, 2023 17:02
post_receive_hook
#!/bin/bash
# Post recv. hook to run deploy.sh from within repo in checkout dir
set -e -u -o nounset
echo "ARGS****************"
read oldrev newrev ref
echo "OLD=$oldrev" "NEW=$newrev" "REF=$ref"
echo "********************"
@Grynn
Grynn / get-ip-addresses.sh
Created February 3, 2023 10:00
Get list of global IP addresses on a computer using ip2 command line
#!/bin/bash
set -eu -o pipefail
ip -j a | jq -r '.[] | .addr_info | map(select(.scope == "global")) | .[] | [ .family, .local ] | @csv'
@Grynn
Grynn / pve-ssl-renew.sh
Created September 14, 2020 19:28
Script to renew Proxmox 3.4 SSL Cert (for proxmox management interface)
#!/bin/bash
#Tested with pve-manager/3.4-16/40ccc11c Promox 3.4
servername="your.server.here"
set -e -x
/usr/local/sbin/certbot-auto --no-self-upgrade renew >> /var/log/le-renew.log
cp /etc/letsencrypt/live/${servername}/fullchain.pem /etc/pve/local/pve-ssl.pem
cp /etc/letsencrypt/live/${servername}/privkey.pem /etc/pve/local/pve-ssl.key
@Grynn
Grynn / tails.sh
Created September 6, 2020 10:56
Install tailscale
curl https://pkgs.tailscale.com/stable/ubuntu/`lsb_release -cs`.gpg | sudo apt-key add -
curl https://pkgs.tailscale.com/stable/ubuntu/`lsb_release -cs`.list | sudo tee /etc/apt/sources.list.d/tailscale.list
sudo apt update
sudo apt install tailscale