Skip to content

Instantly share code, notes, and snippets.

View andrewssobral's full-sized avatar
🔴
I may be very slow to respond.

Andrews Cordolino Sobral andrewssobral

🔴
I may be very slow to respond.
View GitHub Profile
@andrewssobral
andrewssobral / async_openai_requests.py
Created April 24, 2023 09:11
Asynchronous Requests with asyncio
import openai
import asyncio
from typing import Any
async def dispatch_openai_requests(
messages_list: list[list[dict[str,Any]]],
model: str,
temperature: float,
max_tokens: int,
top_p: float,
@andrewssobral
andrewssobral / x11_forwarding_macos_docker.md
Created March 3, 2023 20:00 — forked from sorny/x11_forwarding_macos_docker.md
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@andrewssobral
andrewssobral / m3u8-to-mp4.md
Created March 25, 2022 22:54 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@andrewssobral
andrewssobral / agx_xavier_tips-and-tricks.md
Last active August 20, 2025 21:04
Tips and Tricks for Jetson AGX Xavier
@andrewssobral
andrewssobral / wakeonlan.sh
Last active August 5, 2021 17:02
wakeonlan
# https://doc.ubuntu-fr.org/wakeonlan
# check if your target pc is wake-on-lan enabled:
sudo ethtool enp8s0 | egrep "^[[:blank:]]*Wake-on: (g|d)"
# you should have:
# Wake-on: g
# get target pc mac address
ifconfig enp8s0
@andrewssobral
andrewssobral / disable_leds_rpi3.sh
Last active November 1, 2025 08:52
Disable leds on Raspberry Pi 3 Model B Rev 1.2
# https://raspberrypi.stackexchange.com/questions/117632/turn-off-external-leds-on-raspberry-pi-3
# check model
cat /sys/firmware/devicetree/base/model
# Raspberry Pi 3 Model B Rev 1.2
# Disable Power (red) and Activity (yellow) leds
sudo nano /etc/rc.local
# Add the following lines before `exit 0`:
sudo sh -c 'echo none > /sys/class/leds/led0/trigger'
@andrewssobral
andrewssobral / Crack Sublime Text Windows and Linux.md
Created August 3, 2021 15:14 — forked from JerryLokjianming/Crack Sublime Text Windows and Linux.md
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

YouTube Channel https://www.youtube.com/c/jerrylokjianming


How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
@andrewssobral
andrewssobral / synergy-jetson.sh
Last active August 1, 2021 19:02
Synergy on Jetson
sudo apt install xorg-dev libssl-dev qtbase5-dev libgdk-pixbuf2.0-dev libnotify-dev qttools5-dev-tools qttools5-dev
git clone https://github.com/symless/synergy-core.git
cd synergy-core
mkdir build
cd build
cmake ..
make
# https://github.com/symless/synergy-core/wiki/Command-Line
# ./bin/synergyc $SYNERGY_SERVER_IP
@andrewssobral
andrewssobral / gstreamer-opencv.md
Last active August 11, 2021 21:24
Jetson-Nano GStreamer OpenCV Plugins
@andrewssobral
andrewssobral / pytorch-distributed-slurm-example.py
Created March 15, 2021 22:17
pytorch-distributed-slurm-example.py
# https://github.com/ShigekiKarita/pytorch-distributed-slurm-example/blob/master/main_distributed.py
# lauch 2 gpus x 2 nodes (= 4 gpus)
# srun -N2 -p gpu --gres gpu:2 python main_distributed.py --dist-backend nccl --multiprocessing-distributed --dist-file dist_file
import argparse
import os
import random
import shutil
import time
import warnings
import sys