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
''' | |
This is an example of how to send data to Team's webhooks in Python with the | |
requests module. | |
Documentation for Team's Incoming Webhooks: | |
https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors | |
Card playground: | |
https://messagecardplayground.azurewebsites.net/ | |
''' | |
import json |
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
[{"id":"ddaf41df.e76d7","type":"tab","label":"Debug","disabled":false,"info":""},{"id":"ef0a1326.ffefe","type":"tab","label":"Event Listener","disabled":false,"info":""},{"id":"620a8013.090dd","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d8072816.202f58","type":"tab","label":"Notepad","disabled":false,"info":""},{"id":"f8b092ce.2f198","type":"tab","label":"Outbox","disabled":false,"info":"Filter and log outgoing traffic"},{"id":"8606dfd5.df337","type":"join-config","z":"","name":"pi4-2","register":true},{"id":"174c9775.d43329","type":"join-server","z":"","name":"pi4-2","port":"1822","joinConfig":"8606dfd5.df337"},{"id":"72ae563e.956af8","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,R |
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
process.stdin.on('keypress', async (str, key) => { | |
if (key.sequence === '\u0003') { | |
await browser.close(); | |
process.exit(); | |
} | |
if (['up', 'down', 'left', 'right', 'enter'].includes(key.name)) { | |
const capitalized = key.name[0].toUpperCase() + key.name.slice(1); | |
const keyName = `Arrow${capitalized}`; | |
console.log(`page.keyboard.down('${keyName}')`); |
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
const readline = require('readline'); | |
const puppeteer = require('puppeteer'); | |
const Promise = require("bluebird"); | |
const CREDS = require(__dirname + '/user/creds.js'); | |
const url = 'www.google.com' | |
(async () => { | |
let wargs = puppeteer.defaultArgs() | |
function arrayRemove(arr, value) { |
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
function getStockQuote(symbol) {const url = `https://finance.google.com/finance?q=${symbol}&output=json`got(url).then(response => {/* Must remove the first three characters of the Google finance text returned to parse JSON.*/const stock = JSON.parse(response.body.substr(3))const quote = stock[0]console.log(`${quote.t} ${quote.l} ${quote.c} (${quote.cp}%)`)}).catch(error => {console.log(error.response.body)})} |
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 | |
### BEGIN INIT INFO | |
# Provides: node-red | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: start node-red server at init | |
### END INIT INFO |
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 | |
set -e | |
# install java | |
sudo apt -y install default-jre-headless | |
# fetch latest bfg.jar | |
sudo wget https://repo1.maven.org/maven2/com/madgag/bfg/1.13.0/bfg-1.13.0.jar -O /usr/local/bin/bfg-latest.jar | |
# install to /usr/local/bin |
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
### Preseed for Ubuntu 18.04 | |
# Derived from: https://help.ubuntu.com/lts/installation-guide/example-preseed.txt | |
### Usage | |
# We recommend to use the build-iso.sh script to build an image with embedded | |
# preseed and other required files. In that case the preseed file gets loaded | |
# automatically and all additional files are available to the installer. | |
### Unattended Installation | |
d-i auto-install/enable boolean true |
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
# This method of piping commands is independent of EG, and will start it up if not running, | |
# This is very useful if I need to restart it remotely. | |
# Events are sent to Eventghost through subscribing to topic "ghost" on my MQTT broker | |
# First, I use Windows task scheduler to run WSL on Windows boot. | |
# > cat bootpm2onwsl.bat | |
# sleep 5 | |
# wsl pm2 start "sh ~/bin/mqtt_eg_link.sh" --watch & | |
# Since WSL has no init, This is not 100% reliable, |
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
fix_wsl2_interop() { | |
for i in $(pstree -np -s $$ | grep -o -E '[0-9]+'); do | |
if [[ -e "/run/WSL/${i}_interop" ]]; then | |
export WSL_INTEROP=/run/WSL/${i}_interop | |
fi | |
done | |
} | |
alias socketfix='fix_wsl2_interop' | |
export -f fix_wsl2_interop |
OlderNewer