Skip to content

Instantly share code, notes, and snippets.

View estevaofv's full-sized avatar

Estevão Fonseca Veiga estevaofv

View GitHub Profile
@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:

@estevaofv
estevaofv / Update-branch.md
Created January 18, 2022 03:18 — forked from whoisryosuke/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@estevaofv
estevaofv / SSH.py
Created December 7, 2021 13:50 — forked from vladwa/SSH.py
Python code to execute command as a sudo user over ssh connection on a remote server using "paramiko" module. On The code snippet establishes connection and executes the command and return the status and output of the executed command.
import logging
import paramiko
class SSH:
def __init__(self):
pass
def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password):
"""Establishes a ssh connection to execute command.
:param ssh_machine: IP of the machine to which SSH connection to be established.