Skip to content

Instantly share code, notes, and snippets.

View MarsTechHAN's full-sized avatar

Martin Han MarsTechHAN

  • PR of China, Guangdong, Shenzhen
View GitHub Profile
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#pragma pack(push, 1)
typedef struct {
char riff[4]; // "RIFF"
uint32_t chunkSize; // File size
char wave[4]; // "WAVE"
char fmt[4]; // "fmt "
echo "You need to be su to run this script!, run \"sudo -i\" if you havn't."
echo "APT::Periodic::Update-Package-Lists \"0\";" > /etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::Download-Upgradeable-Packages \"0\";" >> /etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::AutocleanInterval \"0\";" >> /etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/20auto-upgrades
# Released under MIT License
# Credit to https://github.com/timy90022/Perspective-and-Equirectangular
import requests
import numpy as np
import cv2
# Expected output image resolution
equirec_img_shape = (1000, 2000, 3)
import sys, os
import time
import binascii
import hashlib
import array
import math
import usb.core
import usb.util
#include "net.h"
#include <algorithm>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
static int detect_ncnn_net(const cv::Mat& bgr)
{
ncnn::Net ncnn_net;
/*
Rui Santos
Complete project details at https://RandomNerdTutorials.com/esp32-cam-post-image-photo-server/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
*/
@MarsTechHAN
MarsTechHAN / TODO_with_server.py
Created November 30, 2020 04:54
Some gadgets for M5Paper
import time, sys
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from PIL import Image
from PIL import ImageEnhance
from io import BytesIO
@MarsTechHAN
MarsTechHAN / server.py
Created November 13, 2020 16:15
Yolov5s FC Service Provicer
# -*- coding: utf-8 -*-
import cgi
import os
import logging
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import oss2
import urllib.request
// I2C device class (I2Cdev) demonstration Arduino sketch for ADS1115 class
// Example of reading two differential inputs of the ADS1115 and showing the value in mV
// 06 May 2013 by Frederick Farzanegan ([email protected])
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2013-05-13 - initial release
/* ============================================
I2Cdev device library code is placed under the MIT license
@MarsTechHAN
MarsTechHAN / bin2c.py
Last active April 1, 2025 12:04
Program Gowin from ESP32
import struct
import sys
if __name__ == '__main__':
fs = open(sys.argv[1], 'rb')
with open('fs.c', 'w+') as f:
print('const unsigned char fs_bitstream[] __attribute__((aligned(128))) ={', file=f)
counter = 0
while 1:
counter = counter + 1