Skip to content

Instantly share code, notes, and snippets.

View shehbajdhillon's full-sized avatar

Shehbaj Dhillon shehbajdhillon

View GitHub Profile
@shehbajdhillon
shehbajdhillon / adb-tailscale-android-use.md
Last active February 3, 2026 21:57
Setup guide for letting AI agents (Claude Code, Cursor, etc.) control your Android remotely via ADB + Tailscale

ADB over Tailscale

Securely connect to Android over the internet using ADB + Tailscale.

You can also copy paste this gist into your agent of choice and have it explain you what to do.

This guide sets up remote ADB access so you can run android-use — an agent skill that lets AI interact with your Android device over ADB.


@shehbajdhillon
shehbajdhillon / main.py
Last active October 24, 2023 01:05
Combine Everything
# Previous Code (Unchanged)
def combine_segments(segment_files, output_file_path):
# How to concatenate files in FFMPEG: https://trac.ffmpeg.org/wiki/Concatenate
input_list = []
filter_list = []
for idx, file_name in enumerate(segment_files):
@shehbajdhillon
shehbajdhillon / main.py
Last active October 24, 2023 01:05
Layer Video Segment with Dubbed Audio
# Previous Code (Unchanged)
import subprocess
def get_media_file_length(file_path):
# The following ffprobe (part of ffmpeg) command will help us get the duration of a media file.
ffmpeg_cmd = \
f"ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 file:{file_path}"
cmd_tokens = ffmpeg_cmd.split(" ")
output = subprocess.run(cmd_tokens, text=True, capture_output=True, check=True)
@shehbajdhillon
shehbajdhillon / main.py
Last active October 24, 2023 01:06
Voice Cloning and Text To Speech
# Previous Code (Unchanged)
import elevenlabs
elevenlabs_api_key = os.getenv("ELEVENLABS_API_KEY")
elevenlabs.set_api_key(elevenlabs_api_key)
def clone_voice(file_path):
voice = elevenlabs.clone(
name="Cloned Voice",
files=[file_path],
@shehbajdhillon
shehbajdhillon / main.py
Last active March 30, 2024 14:37
Translate transcribed text using GPT
# Previous Code (Unchanged)
def translate_segment(input_text, input_language):
systemMessage = '''
You are an expert translator that can translate texts to and from different languages.
You will translate the input text and will only output the translation
'''
userMessage = f'''
@shehbajdhillon
shehbajdhillon / translation_output.txt
Created October 22, 2023 00:34
Translation Output
Original Text: These are the four biggest challenges I encountered as I transitioned from a startup engineer to a big tech company engineer.
Translated Text: ये वह चार सबसे बड़ी चुनौतिययां हैं जिनसे मुझे गुजरना पड़ा जब मैं एक स्टार्टअप इंजीनियर से बड़ी टेक कंपनी के इंजीनियर में बदल गया।
Original Text: And I think so many engineers are not even aware of the gap in skill set that's needed when you go into a medium or large tech company.
Translated Text: और मुझे लगता है कि बहुत से इंजीनियर तक को यह पता नहहीं होता है कि मध्यम या बड़ी टेक कंपनी में जाने पर जो कौशल सेट की कमी होती है, उसके बारे में।
Original Text: And even once they're aware, they are not sure how to address the gap.
Translated Text: और वह तब भी जब उन्हें पता चल जाता है, वे निश्चित नहहीं होते कि वे इस अंतर को कैसे समाधान करें।
Original Text: And that's actually the whole point of the company I'm building.
@shehbajdhillon
shehbajdhillon / whipser_output.ts
Last active October 24, 2023 01:11
Whisper Output JSON
{
"task": "transcribe",
"language": "english",
"duration": 20.54,
"text": "These are the four biggest challenges I encountered as I transitioned from a startup engineer to a big tech company engineer. And I think so many engineers are not even aware of the gap in skill set that's needed when you go into a medium or large tech company. And even once they're aware, they are not sure how to address the gap. And that's actually the whole point of the company I'm building.",
"segments": [
{
"id": 0,
"start": 0.0,
"end": 5.92,
@shehbajdhillon
shehbajdhillon / main.py
Last active October 22, 2023 05:52
Transcribe Using Whisper
import os
import sys
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
def transcribe_audio(file_path):
file = open(file_path, "rb")
transcript = openai.Audio.transcribe(
model="whisper-1",