Skip to content

Instantly share code, notes, and snippets.

View nazt's full-sized avatar

Nat nazt

  • Chiang Mai Maker Club
  • Chiang Mai
  • X @nazt
View GitHub Profile
@nazt
nazt / x.sh
Created July 17, 2020 19:07
x.sh
echo "$1"
if test $# -gt 0; then
export ID=$1
else
echo "no output dir specified"
exit 1
fi
pip install git+https://github.com/NAzT/ma1.git
@nazt
nazt / ip.py
Last active June 9, 2020 02:41
ip.py
import serial, sys, time, re, os
import threading
import logging
import time, struct
# import paho.mqtt.client as mqtt
import paho.mqtt.client as paho
import paho.mqtt.publish as _publish
@nazt
nazt / corgy-ifttt.py
Created June 2, 2020 21:04
corgy-ifttt.py
from Maix import GPIO
from machine import UART
from fpioa_manager import fm, board_info
import lcd, image
import usocket, network, time
import urequests as request
fm.register(8, fm.fpioa.GPIOHS0)
wifi_en=GPIO(GPIO.GPIOHS0,GPIO.OUT)
@nazt
nazt / corgi-mqtt.py
Last active June 2, 2020 19:27
corgi-mqtt.py
import network, time
import time
from Maix import GPIO
from machine import UART
from fpioa_manager import fm, board_info
import lcd, image
from umqtt import MQTTClient
WIFI_SSID = "LiLy_2.4G"
@nazt
nazt / ssm.sh
Created June 2, 2020 17:34 — forked from yudoufu/ssm.sh
#!/bin/bash
set -e
usage() {
echo "USAGE: `basename $0` [Options]"
echo " ssm target selection using peco"
echo ""
echo "Optinal Arguments:"
echo " All arguments excluded options pass to initial queries of peco"
echo ""
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nazt
nazt / corgi-http-request.py
Last active June 2, 2020 17:27
corgi-http-request.py
import network, time
import time
from Maix import GPIO
from machine import UART
from fpioa_manager import fm, board_info
import lcd, image
import usocket, network, time
import urequests as request
@nazt
nazt / umqtt.py
Created June 2, 2020 14:29
umqtt.py
import usocket as socket
import ustruct as struct
from ubinascii import hexlify
class MQTTException(Exception):
pass
class MQTTClient:
def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0,