This is a sheet with some interesting GIT commands.
This content is shared under a Creative Commons Attribution-ShareAlike 4.0 International.
#!/bin/bash | |
############################################################################ | |
# Random Sample - rsample.sh | |
# | |
# A utility to output a sample number of lines from | |
# a text file based on a percentage passed in as an | |
# argument. | |
# | |
# Dependencies: |
This is a sheet with some interesting GIT commands.
This content is shared under a Creative Commons Attribution-ShareAlike 4.0 International.
#!/bin/bash | |
################################################################ | |
# This is a script that pulls a list of IPs from AWS | |
# published IP list, then parses it looking for a | |
# specific region and service. | |
# | |
# Dependencies: | |
# This script needs: | |
# * Internet access |
#!/bin/bash | |
echo "Say something here to confirm some action." | |
echo "" | |
# Wait for the user to press any KEY to proceed or allow them to Ctrl+C | |
read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n' | |
# Do your work after this... it won't execute if the user does Ctrl+C at the prompt! | |
#!/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 for our pidfile, which we expect in order to be able to control the process | |
if [ ! -f $pidfile ]; then | |
echo "Tunnel pidfile does not exist. Tunnel might not up or not known! Exiting!" |
#!/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 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 <easoto@iss-pr.com> | |
* |
#!/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, eric@issfl.com |
#!/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, eric@issfl.com | |
# | |
# history |