Skip to content

Instantly share code, notes, and snippets.

View germanviscuso's full-sized avatar
🏠
Working from home

German Viscuso germanviscuso

🏠
Working from home
View GitHub Profile
@germanviscuso
germanviscuso / README.md
Last active November 25, 2023 21:21
DynamoDB connection from an Alexa skill

Alexa Skill Persistence with DynamoDB

This document covers how to use Dynamo DB persistence in your Alexa skill using a direct connection the AWS SDK rather than using the ASK SDK persistence adapter (you can see how to use the adapter here).

Setup w/ ASK CLI

About

This readme assumes you have your developer environment ready to go and that you have some familiarity with CLI (Command Line Interface) Tools, AWS, and the ASK Developer Portal.

@germanviscuso
germanviscuso / rpi_boot_fix
Last active November 25, 2023 18:44
Fix for RPi: "Volume was not properly unmounted. Some data may be corrupt. Please run fsck."
# dmesg | grep corrupt
[ 21.280705] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
# umount /boot
# git clone http://daniel-baumann.ch/git/software/dosfstools.git
# cd dosfstools
# make
cc -O2 -fomit-frame-pointer -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -Wmissing-prototypes -Wstrict-prototypes -g -c -o fatlabel.o src/fatlabel.c
.
@germanviscuso
germanviscuso / Cargo.toml
Last active November 3, 2023 12:35
Code for Sibyl to ADB
[package]
name = "adb_rust_s"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sibyl = {version = "0.6.16", features = ["blocking"]}
@germanviscuso
germanviscuso / Cargo.toml
Last active November 3, 2023 12:18
Code for rust-oracle to ADB
[package]
name = "adb_rust"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
oracle = "0.5.7"
@germanviscuso
germanviscuso / es-ES.json
Last active October 15, 2023 21:32
Technovation Workshop (Advanced Fact - es-ES)
{
"interactionModel": {
"languageModel": {
"invocationName": "curiosidades espaciales",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
@germanviscuso
germanviscuso / gist:3f6f24644905d272ea3778b729bbf5e2
Created August 21, 2019 18:11
Personal AWS resources in Alexa Hosted Skills
How do I set up an Alexa-hosted skill to use resources on a personal AWS account?
With the AWS Lambda execution role ARN, you can seamlessly use resources on a personal AWS account to expand the functionality of your Alexa-hosted skill. For example, you can connect the Alexa-hosted skill to an Amazon DynamoDB table. Take the following steps to set up your Alexa-hosted skill to use resources on a personal AWS account:
In the Alexa developer console, open your Alexa-hosted skill, and then in the code editor click the icon that has hover text AWS Lambda Role Execution ARN. Copy the ARN.
If you have not done so already, on your personal AWS account, in the Identity and Access Management (IAM) dashboard, create a role that allows access to the resource that you want your Alexa-hosted skill to access.
In the IAM dashboard, click Roles, click the name of the role you want to edit, and then click the Trust relationships tab.
Edit the trust relationship to include the sts:AssumeRole action, and specify the AWS Lambda
@germanviscuso
germanviscuso / en-US.json
Last active January 31, 2023 15:40
Alexa Skill Basics: Global Persistence with the DynamoDB persistence adapter or the S3 Persistence adapter
{
"interactionModel": {
"languageModel": {
"invocationName": "global persistence demo",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
@germanviscuso
germanviscuso / audioconv.sh
Last active April 29, 2022 07:05
Audio file conversion for Alexa skills
# Convert audio to SSML compatible mp3
ffmpeg -i <input-file> -ac 2 -codec:a libmp3lame -b:a 48k -ar 16000 <output-file.mp3>
# Normalize audio
ffmpeg -i <input-file.mp3> -af loudnorm=I=-14:TP=-3:LRA=11:print_format=json -b:a 48k -ar 16000 <output-file.mp3>
# Do both at the same time
ffmpeg -i <input-file.mp3> -ac 2 -codec:a libmp3lame -af loudnorm=I=-16:TP=-3:LRA=11:print_format=json -b:a 48k -ar 16000 <output-file.mp3>
@germanviscuso
germanviscuso / TwoASK-CLIs.md
Last active March 3, 2022 14:09
Use old and new ASK-CLIs in parallel (Alexa Skills Kit Command Line Interface)

I advise that if the VSCode plugin supports the ask-cli v2 then use Method 1. If we're not there yet then use Method 2 if you want the VSCode plugin to work. If you don't care about the plugin just go with Method 1.

Method 1

After following these instructions the old ask-cli v1.7.23 will run via the command ask1 and the latest ask-cli v2 via the command ask. You will be able to update the ask-cli v2 as usual. You can skip all steps below to create the npm package by just doing:

slug title author author_url author_image_url tags
2022/01/ext-tech-blog-1
A deep-dive on a Progressive Web App implementation for a React-based App platform (DHIS2)
German Viscuso
dhis2
health
java
react
pwa

At DHIS2 we're a team of fully remote developers working on the world's largest open-source health information management system, used by 73+ countries for collecting and analyzing health data. You can check our repos here but basically, at the risk of oversimplifying things, we maintain a fully APIfied Java back-end core project and a series of core web apps built on top of a React based front-end technology that we call the App Platform supported by a design system with custom UI components (we have advanced Analytics and an Android SDK too but