This file contains hidden or 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 sh | |
SD_MOUNT="$(echo "$(mount | grep '/dev/mmcblk.* on /mnt/mmcblk' | sed -e 's/\/dev\/mmcblk.* on \(\/mnt\/mmcblk.*\) type.*/\1/')")" | |
if [ -z $SD_MOUNT ]; then | |
echo "SD Card missing. Saving to /tmp" | |
BACKUP_PATH="/tmp" | |
else | |
BACKUP_PATH="${SD_MOUNT}/backup" | |
fi |
This file contains hidden or 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 bash | |
# Provides an example of how to setup a ssh tunnel on WSL | |
LOCAL_PORT=8080 | |
REMOTE_HOST='localhost' # remote server may be the server being connected to (remote localhost) OR it could be a different server | |
REMOTE_PORT=8080 | |
SSH_ADDRESS='appserver' # this can be user@hostip or an alias configured in ssh config file. | |
if [ "$1" == "-k" ]; then |
This file contains hidden or 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
# Microsoft Surface Install | |
# Unattended Install of Firefox | |
$SourceURL = "https://download.mozilla.org/?product=firefox-msi-latest-ssl&os=win64&lang=en-US"; | |
$Installer = $env:TEMP + "\firefox.exe"; | |
Invoke-WebRequest $SourceURL -OutFile $Installer; | |
Start-Process -FilePath $Installer -Args "/s" -Verb RunAs -Wait; | |
Remove-Item $Installer; |
This file contains hidden or 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 sh | |
function usage() { | |
cat << EOF | |
Usage: $0 [options...] | |
This script allows for easy access to connect or disconnect the wireguard vpn client. | |
Options: | |
-h show the help and exit | |
-u wireguard Up |
This file contains hidden or 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 sh | |
SYNC2WATCH="sync2watch.sh" | |
function echoerr() { | |
echo "$@" 1>&2 | |
} | |
function parse_args() { | |
while getopts ":hdgoa:u" OPT; do |
This file contains hidden or 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
PS1='$(if [[ $? == 0 ]]; then echo "\[\e[30;46m\] \@ \[\e[m\] \[\e[32m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]:\[\e[0;33m\][\w]\[\e[m\]\$ "; else echo "\[\e[30;46m\] \@ \[\e[m\] \[\e[32m\]\u\[\e[m\]@\[\e[36m\]\h\[\e[m\]:\[\e[0;33m\][\w]\[\e[m\]\[\e[41m\]($?)\[\e[m\]$ "; fi)' |
This file contains hidden or 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
[Unit] | |
Description=Node Exporter | |
[Service] | |
# Provide a text file location for https://github.com/fahlke/raspberrypi_exporter data with the | |
# --collector.textfile.directory parameter. | |
ExecStart=/usr/local/bin/node_exporter --collector.textfile.directory /var/lib/node_exporter/textfile_collector | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or 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
# node-exporter: Prometheus Node Exporter - to make metrics available | |
# | |
# Homepage: https://prometheus.io | |
# | |
description "node-exporter: Prometheus Node Exporter - to make metrics available" | |
start on (local-filesystems and net-device-up IFACE!=lo) | |
respawn |
This file contains hidden or 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 | |
# Install Script to setup Raspberry Pi | |
# Runs updates, fixes the Locale | |
# Changes keyboard to US Layout | |
# Sets Timezone | |
LOCALE="en_US.UTF-8" | |
TMZ="America/Vancouver" |
This file contains hidden or 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 node | |
var b = require('bonescript'); | |
// reference the http module so we can create a webserver | |
var http = require("http"); | |
var url = require("url"); | |
var PORT = 8123; | |
var IP = "184.71.190.50"; | |
var controller = ["P9_11", "P9_13", "P9_15", "P9_12"]; |
NewerOlder