Skip to content

Instantly share code, notes, and snippets.

@rgstephens
rgstephens / install_rasa.sh
Last active January 8, 2025 15:27
Install Rasa on Raspberry Pi
# Update the Raspberry Pi
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get dist-upgrade -y
# Install initial build dependencies
# Provides
# Enables pip3.6 to access pypi
sudo apt-get install libbz2-dev libssl-dev -y
@rgstephens
rgstephens / use_featurizer.py
Last active May 18, 2021 12:47
Rasa featurizer for Universal Sentence Encoder
from rasa_nlu.featurizers import Featurizer
import tensorflow_hub as hub
import tensorflow as tf
import logging
logger = logging.getLogger(__name__)
class UniversalSentenceEncoderFeaturizer(Featurizer):
"""Appends a universal sentence encoding to the message's text_features."""
@rgstephens
rgstephens / rasaxupdate.sh
Last active September 5, 2019 16:15
Rasa X Update Script
#!/bin/bash
UPDATE_SCRIPT="do_update.sh"
ENV="${RASA_HOME}/.env"
TMP_PLAYBOOK="/tmp/playbook.yml"
TMP_COMPOSE="/tmp/compose.yml"
rm ${TMP_PLAYBOOK}
rm ${TMP_COMPOSE}
wget -qO ${TMP_PLAYBOOK} https://storage.googleapis.com/rasa-x-releases/stable/rasa_x_playbook.yml
wget -O ${TMP_COMPOSE} https://storage.googleapis.com/rasa-x-releases/stable/docker-compose.ce.yml
echo \#\!/bin/bash > ${UPDATE_SCRIPT}
@rgstephens
rgstephens / calendar.js
Created January 21, 2019 14:49
MagicMirror calendar.js with changes for instances
/* global Module */
/* Magic Mirror
* Module: Calendar
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*/
Module.register("calendar", {
@rgstephens
rgstephens / PersistenceAdapter.ts
Created August 22, 2018 14:55
PersistenceAdapter.ts
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
@rgstephens
rgstephens / AskSdkUtils.ts
Created August 22, 2018 14:54
AskSdkUtils.ts
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
@rgstephens
rgstephens / PartitionKeyGenerators.ts
Created August 22, 2018 14:53
PartitionKeyGenerators.ts
/*
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
@rgstephens
rgstephens / Raspbian Setup & Eddygrid Install
Last active February 12, 2018 01:36
pi_eddygrid_setup.sh
#!/bin/bash
set -x
sudo cp /usr/share/zoneinfo/US/Pacific /etc/localtime
sudo apt-get remove -y wolfram-engine sonic-pi nodejs-legacy nodejs nodered
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y emacs git htop dnsutils
git clone https://github.com/sdesalas/node-pi-zero.git
cd node-pi-zero
chmod +x install-node-v4.4.1.sh
@rgstephens
rgstephens / pi_setup.sh
Last active May 18, 2021 12:49
Raspberry Pi Setup Script
#!/bin/bash
# Whiptail examples - http://xmodulo.com/create-dialog-boxes-interactive-shell-script.html
oldhostname=$(hostname)
newhostname=$(whiptail --title "Hostname" --inputbox "Change hostname?" 10 60 $oldhostname 3>&1 1>&2 2>&3)
export exitstatus=$?
if [ $exitstatus != 0 ]; then
exit $exitstatus
fi
toemail=$(whiptail --title "gmail" --inputbox "Enter gmail (w/o @gmail.com) address to notify when script is done" 10 60 3>&1 1>&2 2>&3)
export exitstatus=$?
@rgstephens
rgstephens / makecerts.sh
Last active November 20, 2017 01:33
Make Self Signed Certificate
#!/bin/bash
# https://stackoverflow.com/questions/19665863/how-do-i-use-a-self-signed-certificate-for-a-https-node-js-server
FQDN=$1
KEYDIR=keys
# make directories to work from
#mkdir -p server/ client/ all/
mkdir -p $KEYDIR
# Create your very own Root Certificate Authority