Skip to content

Instantly share code, notes, and snippets.

/* ESPNOW Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
/*
@physiii
physiii / gist:af783b211b43cb64b80d9a2af93ab3f8
Last active June 20, 2020 19:27
Creating Service - Open Automation
index.js
media-api.js
media-service.js
services-manager.js
server/client-connection.js
server/devices/drivers/generic/generic-driver.js
server/devices/drivers/generic/service-adapters/light-adapter.js
server/services/light-service.js
server/services/services-manager.js
@physiii
physiii / main.c
Last active June 2, 2020 17:03
esp i2s adc dac test
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_spi_flash.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_partition.h"
#include "driver/i2s.h"
#include "driver/adc.h"
@physiii
physiii / rotate_desktop.sh
Created January 20, 2018 22:46 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
echo ==== started $(date +%H:%M) ====
device="$1"
image_file=$(date +%m-%d-%y)-gateway.img
sudo dd bs=40M if=$device | pv | sudo dd bs=4M of=$image_file
notify-send -u critical "Made Image"
echo ==== finished $(date +%H:%M) ====
echo ==== $(date +%H:%M) ====
image_file="$1"
device="$2"
sudo dd bs=1M if=${image_file} | pv | sudo dd bs=1M of=$device
#play /home/physiii/sound.ogg
notify-send -u normal "Done writing image to drive"
echo ==== $(date +%H:%M) ====