Skip to content

Instantly share code, notes, and snippets.

@mikejgray
mikejgray / fasterwhisper-setup.sh
Created May 15, 2024 16:27
FasterWhisper STT Server Script
#!/bin/bash
set -e
IP=$(hostname -I | cut -d' ' -f1)
cd ~ || echo "No home directory for this user, please install with a user that has a home directory." || exit 1
PIP=""
if command -v pip >/dev/null 2>&1; then
PIP="pip"
@mikejgray
mikejgray / install_piper_server.sh
Created January 22, 2024 02:34
OVOS TTS Piper Server
#!/bin/bash
IP=$(hostname -I | cut -d' ' -f1)
cd ~ || echo "No home directory for this user, please install with a user that has a home directory." || exit 1
command -v espeak-ng >/dev/null 2>&1 || { echo >&2 "Piper TTS requires espeak-ng but it's not installed. Please install it before running this script."; exit 1; }
echo "********************************************************************************"
echo "Creating virtual environment at ~/tts_venv"
echo "********************************************************************************"
"""Webhook reader."""
import os
from flask import Flask, request
app = Flask(__name__)
@app.route("/events", methods=["POST"])
def webhook():
"""Save the contents of the webhook to a file and return a 204."""
@mikejgray
mikejgray / sl1goldenquery.sql
Created February 1, 2020 19:58
SL1 Golden Query (Use to find tables or schema with a given search parameter)
select CONCAT(table_schema, '.' , table_name) from information_schema.tables where table_schema like '%search_param%' or table_name like '%search_param%'
@mikejgray
mikejgray / git_update.sh
Created December 6, 2019 23:03
Run in a directory with multiple Git repos to pull down the latest version of remote code.
#!/bin/bash
################################################################################
# Run in a directory with multiple Git repos to pull down the latest version
# of remote code.
################################################################################
shopt -s nullglob
array=(*/)
for dir in "${array[@]}"; do
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text)
do
echo "${region}: $(aws ec2 describe-images --owners amazon --filters Name=name,Values=amzn-ami-hvm-*s3 --query "reverse(sort_by(Images, &CreationDate))[0].ImageId" --output text --region $region)"
done
[System.Windows.Forms.MessageBox]::Show("Manually restart the servers, verify functionality, EMAIL CUSTOMER, then press Yes." , "Manually Restart Servers" , 4, 48)
Write-Host "Doing it anyway"
# SIG # Begin signature block
# MIIFkQYJKoZIhvcNAQcCoIIFgjCCBX4CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQULB98kUhxMWzBwDwG6FYPOD1J
# QWmgggMqMIIDJjCCAg6gAwIBAgIQFsbzSX80tbNKiMJWHodVdDANBgkqhkiG9w0B
# AQsFADAcMRowGAYDVQQDDBFtZ3JheUBCdXJ3b29kLmNvbTAeFw0xOTAzMTYxOTEz
# MjRaFw0yMDAzMTYxOTMzMjRaMBwxGjAYBgNVBAMMEW1ncmF5QEJ1cndvb2QuY29t
foreach ($server in ("SERVER1", "SERVER2")) {
Restart-Computer -ComputerName $server -Force
do {
$Ping = Test-Connection -ComputerName $server -Count 1 -Quiet
} until ($Ping -eq $True)
Write-Host -ForegroundColor "Green" "$($server) is up"
}