This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /opt/mycroft/skills/$MYSKILLNAME | |
mkdir -p test/intent | |
cd test/intent | |
grep 'IntentBuilder(' ../../__init__.py | cat -n -- | sed 's/^\s\+\([0-9]\+\).*intent_handler(IntentBuilder("/00\1./ ; s/").*$/\.intent\.json/' | awk '$1' | |
echo '{ | |
"utterance": "verbal imperative or interrogative after normalization", | |
"set_context": {"_TestRunner": "data", "test": ""}, | |
"intent_type": "IntentObjectNameFromSkillPythonSource", | |
"intent": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
#pip install websocket-client | |
#python mycroft_ws_test.py localhost recognizer_loop:utterance '{"utterances": ["what time is it"]}' | |
import sys | |
from websocket import create_connection | |
uri = 'ws://' + sys.argv[1] + ':8181/core' | |
ws = create_connection(uri) | |
print("Sending " + sys.argv[2] + " to " + uri + "...") | |
if len(sys.argv) >= 4: | |
data = sys.argv[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Use a powershell exporter script to get all the current trusted root CA certs in a folder, then copy up to db server | |
for sslcert in /tmp/ssl_trusted_cert_export/* ; do openssl pkcs12 -in $sslcert -nokeys -out $( echo $sslcert | sed 's/\.p12/.pem/' ) ; done | |
mkdir /tmp/ssl_trusted_cert_export/pem && mv /tmp/ssl_trusted_cert_export/*.pem /tmp/ssl_trusted_cert_export/pem/ | |
su - oracle | |
# Select source ora env | |
mkdir -p $ORACLE_BASE/wallets/apex | |
cd $ORACLE_BASE/wallets/apex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# requires sshd logging in verbose level | |
# recommended usage: | |
# ./fp && egrep 'Accepted publickey|Found matching' /var/log/authlog | |
while read l; do | |
#[[ -n $l && ${l###} = $l ]] && echo -n "$l: " | cut -f3 -d' ' && echo $l > /tmp/ssh.key.fingerprint.$EUID.$BASHPID && ssh-keygen -l -f /tmp/ssh.key.fingerprint.$EUID.$BASHPID | |
if [[ -n $l && ${l###} = $l ]] ; then | |
TAG="$( echo -n "$l" | cut -f3 -d' ' )" | |
TMPFILE="/tmp/${EUID}.${BASHPID}__ssh.key.fingerprint.$TAG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netstat -naf inet | grep LISTEN && echo "##" && netstat -naf inet | grep LISTEN | sed -e 's/^ *//' -e ' s/^[^ ]*\.//' | sort -un |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!PowerShell | |
# Assumes print logging is turned on. This is usually the case on print servers, | |
# yet usually not the case on desktop workstations. | |
$searchstring = Read-Host -Prompt 'Target username' | |
$WinEventXMLFilter = ' | |
<QueryList><Query Id="0" Path="Microsoft-Windows-PrintService/Operational"> | |
<Select Path="Microsoft-Windows-PrintService/Operational">*[System[(Level=4 or Level=0) and (EventID=307)]]</Select> | |
</Query></QueryList>' | |
$PrintEvents = Get-WinEvent -FilterXml $WinEventXMLFilter -Computer $(Read-Host -prompt 'Print Server computername') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$multiple = 2 | |
$currentNumber = 1 | |
while ($currentNumber -lt 562949953421310) { | |
$currentNumber = $currentNumber * $multiple | |
$currentNumber | |
} | |
$vox = New-Object -com SAPI.spvoice | |
$vox.speak("Sorry, too late. I have already reached $($currentNumber). As you can see, computers really are amazingly, blazingly fast.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Scenario: some issuer reissues to you a renewed certificate in DER/x509 format, | |
#but you need it in PFX/PKCS12 format (perhaps to utilize in some Windows PowerShell scripts). | |
#quick sequence to perform the conversion and sanity check. | |
#To extract the private key embedded in the (soon to expire) PFX: | |
openssl pkcs12 -in old_about_to_expire.pfx -nocerts -out extracted_private_key.pem | |
#To sanity check the incoming renewed cert: | |
openssl x509 -inform der -in renewed_certificate_as_issued.der -noout -text | grep -v '\([a-z0-9]\{2\}:\)\{10,\}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# rapidly rattle off a bunch of eerily familiar utterances | |
# Credit to https://a3nm.net/blog/glados_espeak.html | |
while read LINE </dev/tty ; do | |
TITLE=$( echo $LINE | sed 's/[^a-zA-Z0-9 ]//g; s/ \+/_/g; s/_the_//g; s/_to_//g;' ) | |
echo $LINE | for a in `cat`; do | |
V=$(((($RANDOM) % 100) - 50)); echo -n "<prosody pitch=\"+$V\">$a</prosody> " | | |
sed 's/+-/-/' ; | |
done | espeak -ven+f3 -m --stdout -p 55 -s 150 | oggenc -q1 - > GLADOS_${TITLE}.ogg | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Quick, dirty, and incomplete. Look to dgielis/model_to_quicksql.sql for more power | |
select table_name||chr(10)||listagg(' '||column_name||' ' | |
||case data_type | |
when 'VARCHAR2' then 'vc'||to_char(data_length) | |
when 'NUMBER' then 'num' | |
when 'INTEGER' then 'int' | |
when 'DATE' then 'date' | |
when 'INTEGER' then 'int' | |
END,chr(10)) within group (order by column_id) quicksql | |
from all_tab_cols |