Skip to content

Instantly share code, notes, and snippets.

View sandys's full-sized avatar

Sandeep Srinivasa sandys

View GitHub Profile
@sandys
sandys / run.sh
Created July 3, 2025 06:57
semantic vad
# install dependencies
npm i commander onnxruntime-node @xenova/transformers \
node-record-lpcm16 webrtcvad @xenova/whispercpp \
ws @google/generative-ai node-fetch
# export keys
export GEMINI_API_KEY="AIza..." # required
export OPENAI_API_KEY="sk-..." # only if provider=openai
# ▶ default (hybrid)
@sandys
sandys / agent loop
Created March 10, 2025 07:25 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@sandys
sandys / table_to_csv.rb
Created October 18, 2012 10:04
convert a html table to CSV using ruby
# run using ```rvm jruby-1.6.7 do jruby "-J-Xmx2000m" "--1.9" tej.rb```
require 'rubygems'
require 'nokogiri'
require 'csv'
f = File.open("/tmp/preview.html")
doc = Nokogiri::HTML(f)
csv = CSV.open("/tmp/output.csv", 'w',{:col_sep => ",", :quote_char => '\'', :force_quotes => true})
@sandys
sandys / cursor-configuration.md
Last active September 17, 2024 17:27
running anything in the background (very simply!!)

How to setup cursor.sh so that you are able to use it on remote server with tmux

add the following to your settings.json

image

{
  "terminal.integrated.profiles.linux": {
 "tmux": {
@sandys
sandys / fail2ban-rdp.md
Created September 8, 2024 09:43
fail2ban rdp

[rdp] enabled = true filter = rdp action = iptables-multiport[name=rdp, port="3389,3390,3391", protocol=tcp] logpath = /var/log/xrdp.log maxretry = 5

filter filter.d/rdp.conf

[Definition]

@sandys
sandys / finternet-wootzapp-browser-checkout.md
Last active September 7, 2024 07:12
finternet integration into browser checkout

Android WebAuthn + SIMD48 Solana Multi-Sig Application : Ecommerce Checkout integrated into browser using Finternet

We propose the development of an Android application that leverages WebAuthn, SIMD48 processing, and Solana's multi-signature capabilities to create a secure and user-friendly Finternet browser. This browser will enable anyone to open ecommerce websites, process Finternet WebAuthn requests using the device's fingerprint sensor, and complete transactions through a Solana multi-sig contract.

The ideal finternet checkout flow on a browser would be :

  1. shopify checkout page has webauthn integrated into it
  2. when u click the "pay now with finternet" button on the shopify site
  3. a webauthn+simd48 key is created using the users fingerprint on the phone (which wootzapp pops up
  4. then the user uses this key + wallet key to sign the finternet MPC contract
@sandys
sandys / dockerfile_ruby_rbenv.sh
Last active July 12, 2024 02:37
Dockerfile for a ruby/rbenv setup on ubuntu/debian
# DOCKER-VERSION 1.0
# run with curl <gist path> | docker build -t sandys/rbenv -
#when exiting/stopping a container it remains in the filesystem
#every time we run docker run a new container is created
#https://github.com/dotcloud/docker/issues/3258
#stop all containers docker stop $(docker ps -a -q)
#rm all containers docker rm $(docker ps -a -q)
@sandys
sandys / Fastapi-sqlalchemy-pydantic-dataclasses-reloadable-logging.md
Last active June 30, 2024 09:23
fastapi with python 3.10 dataclasses - used to create both sqlalchemy and pydantic models simultaneously. And setting up sqlalchemy the right way (without deadlocks or other problems). Additionally, this also takes care of unified logging when running under gunicorn..as well as being able to run in restartable mode.
@sandys
sandys / gridsearchcv.py
Created August 18, 2019 16:26
Gridsearchcv with k-fold cross validation and early stopping
#
... import xgboost.sklearn as xgb
... from sklearn.model_selection import GridSearchCV
... from sklearn.model_selection import TimeSeriesSplit
...
... cv = 2
...
... trainX= [[1], [2], [3], [4], [5]]
... trainY = [1, 2, 1, 2, 1]