Skip to content

Instantly share code, notes, and snippets.

View estevaofv's full-sized avatar

Estevão Fonseca Veiga estevaofv

View GitHub Profile
from telegram import Update
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
import pyvisa
import ollama
BOT_TOKEN = "meu token gerado no botfather"
system_context="""
You are a natural language to fixed command converter for a power supply (channel).
1. translate from portuguese to english and change all string numbers to digits values if necessary
@estevaofv
estevaofv / RigolDP800.py
Created July 3, 2025 03:27 — forked from inf3rtil/RigolDP800.py
Rigol DP800
"""Use a Rigol DP800 to monitor load and store test on database."""
import pyvisa
import time
import mysql.connector
from datetime import datetime, timezone
def connect_to_database():
"""Connect to mysql database."""
try:
@estevaofv
estevaofv / 2serv.py
Created October 27, 2022 21:22 — forked from phrawzty/2serv.py
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@estevaofv
estevaofv / format_sdcard.c
Created September 20, 2022 21:29 — forked from dizcza/format_sdcard.c
ESP-IDF format an SD card
#include "ff.h"
#include "vfs_fat_internal.h"
/**
* Usage:
* // See https://github.com/espressif/esp-idf/blob/b63ec47238fd6aa6eaa59f7ad3942cbdff5fcc1f/examples/storage/sd_card/sdmmc/main/sd_card_example_main.c#L75
* esp_vfs_fat_sdmmc_mount(mount_point, &host, &slot_config, &mount_config, &card);
* format_sdcard(card);
* // proceed without remounting
*/
@estevaofv
estevaofv / Python-Arduino.md
Created May 5, 2022 03:13 — forked from matdombrock/Python-Arduino.md
Simple Arduino Serial Monitor - Python

what's this??

A simple set of scripts for getting output from an Arduino to act is input for Python.

how to use?

  • Install python3
  • Install pyserial
  • adjust monitor.py to include your COM location as the COM variable (ie COM3 or /dev/ttyACM0)
  • run with python monitor.py --monitor (You may have to run as root on linux)

what are these numbers?

Android ADB over wifi

Some notes from my successes and failures.

Definitions

From the official docs

It is a client-server program that includes three components: >

@estevaofv
estevaofv / I2S_MIC_UDP.ino
Created February 9, 2022 04:30 — forked from GrahamM/I2S_MIC_UDP.ino
ESP32 I2S Mic UDP streamer
/**
* ESP32 I2S UDP Streamer
*
* This is influenced by maspetsberger's NoiseLevel at
* https://github.com/maspetsberger/esp32-i2s-mems/blob/master/examples/NoiseLevel/NoiseLevel.ino
*
* @author GrahamM
*/
#include <driver/i2s.h>
@estevaofv
estevaofv / adbUsefulCommands.sh
Created January 28, 2022 12:31 — forked from aminone/adbUsefulCommands.sh
A collection of Android Debug Bridge (ADB) commands
# To get file
adb pull <PATH/TO/FILE/ON/DEVICE>
# To push file
adb push <PATH/TO/FILE> <PATH/TO/DESTINATION>
# To get wifi MAC address
adb shell cat /sys/class/net/wlan0/address
# To get IP Address
@estevaofv
estevaofv / postman_vs_insomnia_comparison.md
Created January 24, 2022 16:30 — forked from samoshkin/postman_vs_insomnia_comparison.md
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@estevaofv
estevaofv / multiple-git-clone.md
Created January 18, 2022 04:12 — forked from benizar/multiple-git-clone.md
Ubuntu post-installation script for cloning multiple git repositories.

multiple-git-clone.sh

Every time I install Ubuntu on a different computer, I need to clone again the same git repositories. This is why I use this bash script.

Usage

It clones the list of repositories to a convenient working directory in the home folder. I use the /home/git folder.

Arguments are lists of git repositories. One repo per line, one file per list. See the example: