Skip to content

Instantly share code, notes, and snippets.

View raveenb's full-sized avatar
:octocat:
Learning, Always!

Raveen Beemsingh raveenb

:octocat:
Learning, Always!
View GitHub Profile
@raveenb
raveenb / monitor-flicker.md
Created August 28, 2025 08:05
External monitoring flickering when connected to apple mac with apple silicon

If your external monitor is flickering after your connect your apple mac that has apple silicon. And it didnt flicker if you connect an intel or other pc's. I have a solution for you

Problem

  1. the issue is due to the how apple silicon gpu's render images on certain monitors.
  2. i recently upgraded my old intel based mac book pro with m4 mac mini - great upgrade
  3. but the external monitors that were working properly earlier with the intel cpu mac was now showing flickering.
  4. the problem is that this flicker is not constant but it flickers when there are some shading of gray or transparency
  5. the issue i found out after a lot of research is that its because of how the apple gpu's render.
  6. apple gpu's use some tech call DCI dithering, which works great on apple monitors like the one on the laptop or apple's own monitor or some apple supported ones like LG Ultrafine.
  7. but on mine like BenQ, this dithering makes it look very strange and uncomfortable to view
@raveenb
raveenb / claude.md
Created August 27, 2025 14:16
Claude Desktop Restarting due to Connection Error Issue err_connection_refused

If your claude desktop that you newly installed refuses to open or is constantly restarting. You constantly get an error like err_connection_refused. I have some troubleshooting steps to share on how I resolved it:

  1. Check the logs in ~/Library/Logs/Claude window.log and main.log
  2. You may see the urls that the app is trying to access and failing
  3. Perhaps copy them over and paste it on your browser and see what response is showing up.
  4. In my case it was m.stripe.network and statsig.anthropic.com, both these were blocked at my home router
  5. I use pihole, so searched for those domains and unblocked them
  6. The claude desktop app is now stable and working properly

Enjoy!

@raveenb
raveenb / JupyterLab_Installation_and_Customizations_Python_3.11.md
Last active January 30, 2023 18:35
Awesome JupyterLab Installation and Customizations (Python 3.11)

JupyterLab Installation and Customizations (Python 3.11)

Make your JupyterLab awesome with Code Completion, Code Typeahead, Font Changes for Code/UI/Output, Faster Autosave, Black Autoformatting, Ruff Lint Suggestions, Rich Pretty Printed REPL Outputs, Darcula Theme, Autoversion of files, Pandas Lux Visualization, Javascript Kernel and more.

General Instructions

  1. Download the zip file of this gist. Unzip the zip file to a directory and give execution rights to the .sh files using chmod +x *.sh
  2. Ensure you are running on a mac and have homebrew installed
  3. Ensure you have python(3.9, 3.10, 3.11) installed and is available in the default path. Otherwise, install the versions you want, using brew install [email protected] or brew install [email protected] or brew install [email protected]

Installing JupyterLab

@raveenb
raveenb / fastapi_inside_jupyter.md
Last active April 16, 2025 12:35
Run FastAPI inside Jupyter

How to Run FastAPI inside Jupyter

  • Ensure you have these installed and accessible from the notebook pyngrok, nest_asyncio, fastapi, uvicorn and other libs you want
%pip install pyngrok nest_asyncio fastapi uvicorn loguru
  • Create a FastAPI app
from fastapi import FastAPI
@raveenb
raveenb / ssh.md
Last active June 1, 2024 17:05
Avoiding SSH Connection Timeouts
@raveenb
raveenb / proxy_fix.md
Last active January 20, 2021 16:20
Fix Oauth Issue for Flask+Traefik

If you are using Oauth login/register on a Flask server and its is behind Traefik. You will need to do two things to fix the https and redirect issues. You may be getting errors indicating that the OAuth callback is not valid or is not https enabled. And the intersting part to note is that it will work fine when running on local host and straight up https, but fail when the app is behing a proxy/edege router/traffic multiplexer like Traefik or NGinx.

  1. Do the Proxy fix to the wsgi app inside of the flask app. This is from the flask documentation itself https://flask.palletsprojects.com/en/1.1.x/deploying/wsgi-standalone/#deploying-proxy-setups
# assuming app is the Flask app

from werkzeug.middleware.proxy_fix import ProxyFix

app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
@raveenb
raveenb / ssh_into_android.md
Last active August 27, 2025 02:29
SSH into Android

Connecting to an Android device over SSH

Initial Setup

Install Android App Termux from APKPure or AppStore. If the app exists, just delete and re-install it to get the latest version, The APK can be downloaded from https://apkpure.com/termux/com.termux/ Install the APK using by running

adb install ~/Downloads/Termux_v0.73_apkpure.com.apk
@raveenb
raveenb / FlaskPandasNumpyCustomJSONEncoder.py
Last active October 23, 2019 15:44
Flask JSON numpy Encoder to work with Flask when using Numpy and Timestamp data
import json
import numpy as np
from flask import jsonify
from datetime import datetime, timedelta
class CustomJSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, np.ndarray): return o.tolist()
if isinstance(o, np.int64): return int(o)
if isinstance(o, set): return list(o)
@raveenb
raveenb / setup_supercurie96.sh
Last active October 23, 2019 15:45
AWS SageMaker Setup to run things in parallel
#!/bin/bash
echo "> Activating Python3 Env"
source /home/ec2-user/anaconda3/bin/activate python3
echo "> Updating Python to 3.7"
conda update -y conda
conda install -y python=3.7
conda install -y pip
echo "> Updating Libraries"
pip install pandas numpy matplotlib ipython ipykernel notebook --upgrade
@raveenb
raveenb / Dockerfile
Last active October 23, 2019 15:43
Fix Docker Debian Jessie issues. Dockerfile changes to get around the apt-get issue in Debian Jessie. Shamelessly copied and adapted from discussion on Stackoverflow here https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository
FROM python:3.6-slim-jessie
MAINTAINER Raveen Beemsingh <[email protected]>
RUN apt-get update && \
apt-get -y install cron curl redis-server sudo build-essential && \
rm -rf /var/lib/apt/lists/*
RUN adduser appuser
RUN echo "appuser ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers