Skip to content

Instantly share code, notes, and snippets.

@NonaSuomy
NonaSuomy / lambda_function.py
Created October 2, 2023 18:46 — forked from matt2005/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@NonaSuomy
NonaSuomy / lambda_function.py
Created October 2, 2023 18:46 — forked from matt2005/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
// Must disable logging if using logging in main.cpp or in other custom components for the
// __c causes a section type conflict with __c thingy
// you can enable logging and use it if you enable this in logger:
/*
logger:
level: DEBUG
esp8266_store_log_strings_in_flash: False
*/
//#define APE_LOGGING
/*
Project: WOOF
Date: 20171228
Hardware
FTDI for Pro Mini
https://www.banggood.com/FT232RL-FTDI-USB-To-TTL-Serial-Converter-Adapter-Module-For-Arduino-p-917226.html?rmmds=search&cur_warehouse=CN
Arduino Pro Mini or Micro
@NonaSuomy
NonaSuomy / chio-bacula
Created July 14, 2017 17:04 — forked from Stefan-Code/chio-bacula
Script for Bacula autochanger barcode handling on FreeBSD
#!/bin/sh
#
# Bacula interface to FreeBSD chio autoloader command with
# multiple drive support
# (By Lars K�ller, [email protected], 2004)
#
# If you set in your Device resource
#
# Changer Command = "path-to-this-script/chio-bacula" %c %o %S %a
# you will have the following input to this script:
@NonaSuomy
NonaSuomy / gist:a62a9a125d61fc5df748066961702ac6
Created June 30, 2017 01:01 — forked from anonymous/gist:8b4a0101f5101f756bb9
Get OAUTH2.0 access token for Google Voice with a shell-script
#!/bin/bash
##
## Authenticate with Google Voice
##
USAGE="`basename $0` {auth|refresh|token} ctx"
CTX_DIR=$HOME/.gvauth
CLIENT_ID="YOUR_CLIENTID_FROM_GOOGLE_DEVELOPER_CONSOLE"
CLIENT_SECRET="YOUR_CLIENTSECRET_FROM_GOOGLE_DEVELOPER_CONSOLE"
SCOPE="https://www.googleapis.com/auth/googletalk%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile"
@NonaSuomy
NonaSuomy / networkcfgs.sh
Last active July 24, 2017 22:50
Network interface configuration setup for http://nonasuomy.github.io/Infrastructure-Part-1/
#!/bin/sh
read -d '' vlannetwork <<- EOF
[Match]
Name=eno1
[Network]
VLAN=eno1.100
VLAN=eno1.200
VLAN=eno1.300
VLAN=eno1.400
@NonaSuomy
NonaSuomy / vm-backup.sh
Created June 13, 2017 05:16 — forked from cabal95/vm-backup.sh
I use this script to backup my QEMU/KVM/libVirt virtual machines. The script requires KVM 2.1+ since it uses the live blockcommit mode. This means the data in the snapshot disk is rolled back into the original instead of the other way around. Script does NOT handle spaces in paths.
#!/bin/bash
#
BACKUPDEST="$1"
DOMAIN="$2"
MAXBACKUPS="$3"
if [ -z "$BACKUPDEST" -o -z "$DOMAIN" ]; then
echo "Usage: ./vm-backup <backup-folder> <domain> [max-backups]"
exit 1
@NonaSuomy
NonaSuomy / ESP_Radio.ino
Last active June 28, 2017 05:15
MQTT Status Updates
//******************************************************************************************
//* Esp_radio -- Webradio receiver for ESP8266, 1.8 color display and VS1053 MP3 module, *
//* by Ed Smallenburg ([email protected]) *
//* With ESP8266 running at 80 MHz, it is capable of handling up to 256 kb bitrate. *
//* With ESP8266 running at 160 MHz, it is capable of handling up to 320 kb bitrate. *
//******************************************************************************************
// ESP8266 libraries used:
// - ESP8266WiFi - Part of ESP8266 Arduino default libraries.
// - SPI - Part of Arduino default libraries.
// - Adafruit_GFX - https://github.com/adafruit/Adafruit-GFX-Library
@NonaSuomy
NonaSuomy / XMLHTTPparse.ino
Created May 2, 2017 23:30
IHeartRadio XML Parsing on Arduino ESP8266
//http://playerservices.streamtheworld.com/api/livestream?version=1.5&mount=CIMXFMAAC&lang=en
#include <ESP8266WiFi.h>
#include <TinyXML.h>
const char* ssid = "SSID";
const char* password = "PASSWORD";
const char* host = "playerservices.streamtheworld.com";
const char* apiVersion = "1.5";
const char* mountPoint = "CIMXFMAAC";