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 | |
# Get the directory where the script lives. | |
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" | |
# Setup a variable for easy reference to the pidfile | |
pidfile=${SCRIPT_DIR}/tunnel.pid | |
# Check to see if there is a pidfile already... | |
if [ -f $pidfile ]; then | |
# There is, so the tunnel might be 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
/** | |
* This is from many sources. Important points: | |
* - A promise will immediately start resolving when created unless it’s in a function being passed around. | |
* - Note the special syntax when adding promises to arrays to avoid having the Promise begin resolving. | |
* - Note the various patterns, series and parallel, with concurrency control. | |
* | |
* This work is licensed under the MIT License as follows: | |
* | |
* Copyright 2018 E.A.Soto <[email protected]> | |
* |
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/sh | |
# ********************************************************************* | |
# script: filetopingreply | |
# summary: given a file path (assuming it has a host per line), uses | |
# another script to get the IP for each host then tries | |
# an ICMP ping and returns those that reply | |
# NOTE: Backgrounds each PING to perform these faster! | |
# dependencies: filetoiplist (in same path as this script); grep | |
# by: e.a.soto, [email protected] |
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/sh | |
# ********************************************************************* | |
# script: gethostlist | |
# summary: given a passed URL, extracts all hosts and returns a list, | |
# sorted and unique. | |
# dependencies: wget; grep | |
# by: e.a.soto, [email protected] | |
# | |
# history |
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/sh | |
# ********************************************************************* | |
# script: geturilist | |
# summary: given a passed URL, extracts all URIs and returns a list, | |
# sorted and unique. | |
# dependencies: wget; grep | |
# by: e.a.soto, [email protected] | |
# | |
# history |
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/sh | |
# ********************************************************************* | |
# script: filetoiplist | |
# summary: given a file path (assuming it has a host per line), looks | |
# up the IP for each host. | |
# dependencies: host; grep | |
# by: e.a.soto, [email protected] | |
# | |
# history |
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 | |
echo "" | |
echo "E.A.Soto" | |
echo "Downloads each URL in a list into local files, first creating a 'downloads' directory in the current directory." | |
echo "Syntax: $0 [path-to-list]" | |
echo "" | |
# Check for parameters | |
if [[ -z $1 ]]; 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
#!/bin/bash | |
#### | |
# Scours log files for keywords, then and emails | |
# if it finds them. | |
# | |
# This script also has keywords to exclude. This is, within the matches | |
# if the exclude keywords appear, then those lines are excluded from | |
# the output report. This allows you to "match" on a long keyword ( | |
# e.g. "/some/directory/with/tools") yet exclude a specific match ( |
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
# Run from the root of the directory that contains files and subdirectories. | |
# Dependencies: find, file | |
# Fina all files, then execute FILE on them, filter for the string 'CRLF' | |
find . -type f -exec file "{}" \; | grep CRLF |