Created
March 25, 2026 18:11
-
-
Save igmarin/9c60d402cc48dabeac33b4abc5affb63 to your computer and use it in GitHub Desktop.
Start ngrok to allow Ollama to be called from a different computer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alias cleancursor="pkill -f proxy.py && pkill -f ngrok"
alias freecursor="~/start-cursor-local.sh"