Skip to content

Instantly share code, notes, and snippets.

@igmarin
Created March 25, 2026 18:11
Show Gist options
  • Select an option

  • Save igmarin/9c60d402cc48dabeac33b4abc5affb63 to your computer and use it in GitHub Desktop.

Select an option

Save igmarin/9c60d402cc48dabeac33b4abc5affb63 to your computer and use it in GitHub Desktop.
Start ngrok to allow Ollama to be called from a different computer
#!/bin/bash
# ~/start-cursor-local.sh
pkill -f proxy.py 2>/dev/null
pkill -f ngrok 2>/dev/null
sleep 1
# Arrancar Start en background
python3 "$HOME/proxy.py" > /tmp/ollama-proxy.log 2>&1 &
echo "✅ Proxy starting (port 8080)"
sleep 2
# start ngrok
ngrok http 8080 > /tmp/ngrok.log 2>&1 &
echo "✅ Ngrok starting..."
sleep 4
# GET full URL
URL=$(curl -s http://localhost:4040/api/tunnels | python3 -c "
import sys, json
try:
data = json.load(sys.stdin)
url = data['tunnels'][0]['public_url']
print(url)
except:
print('ERROR')
")
echo ""
echo "========================================"
echo " URL for Cursor:"
echo " $URL/v1"
echo "========================================"
echo ""
echo " Proxy log: tail -f /tmp/ollama-proxy.log"
echo " Ngrok log: tail -f /tmp/ngrok.log"
echo ""
echo " Both services working in the background."
echo " To kill both: pkill -f proxy.py && pkill -f ngrok"
@igmarin
Copy link
Copy Markdown
Author

igmarin commented Mar 25, 2026

alias cleancursor="pkill -f proxy.py && pkill -f ngrok"
alias freecursor="~/start-cursor-local.sh"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment