Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

View GitHub Profile
- Detract : reduce or take away the worth or value of
- Unjot : remove jots? (notes)
- Derogate : detract from
- Abridge : shorten (a book, movie, speech, or other text) without losing the sense
- Curtail : reduce in extent or quantity; impose a restriction on
- Digest : a compilation or summary of material or information
- Abate : lessen, reduce, or remove (especially a nuisance)
- Triage : pay immediate attention to particular priorities
- Terse : sparing in the use of words; abrupt
- UnPleonasm : the use of more words than are necessary to convey meaning (e.g., see with one's eyes ), either as a fault of style or for emphasis
#! /usr/local/bin/awk -f
@include "/Users/jhyland/Documents/scripts/awk/utils.awk"
function resetVhost() {
vhost["server_name"] = ""
vhost["document_root"] = ""
vhost["error_log"] = ""
vhost["access_log"] = ""
vhost["cfg_file"] = ""
#! /usr/local/bin/awk -f
# Functions to add:
# arrSort : Sort array by value in specific key or index
# arrType : Determine if an array is a scalar or hash array
# parsedate : Function to parse a date provided (EG: ps -o etime)
#
# Function to check if a value (typically an entire line of a file) is either empty, or
@jhyland87
jhyland87 / echo2.sh
Last active March 14, 2017 19:42
Bash function echo2 - used to redirect STDOUT to STDERR, or to send text to STDERR directly
function echo2 {
if test -p /dev/stdin
then
echo "$(</dev/stdin)" 1>&2
elif test -n $1
then
echo "$@" 1>&2
else
return 1
fi
# Original
foo bar
foo baz
quux idk
# Result
foo bar,baz
quux idx
@jhyland87
jhyland87 / lsappinfo.man.txt
Created March 6, 2017 17:08
Man page for lsappinfo
LSAPPINFO(8) LSAPPINFO(8)
NAME
lsappinfo - Control and query CoreApplicationServices about the app
state on the system
SYNOPSIS
lsappinfo [options] [ command [command options] ] ...
# Src: http://fileadmin.cs.lth.se/cs/Personal/Peter_Moller/scripts/Countries.txt
AF:Afghanistan
AL:Albania
DZ:Algeria
AS:American Samoa
AD:Andorra
AO:Angola
AI:Anguilla
AQ:Antarctica
AG:Antigua and Barbuda
@jhyland87
jhyland87 / ps.txt
Created March 2, 2017 20:16
PS man page from OSX
PS(1) BSD General Commands Manual PS(1)
NAME
ps -- process status
SYNOPSIS
ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]]
[-g grp[,grp...]] [-u uid[,uid...]] [-p pid[,pid...]]
[-t tty[,tty...]] [-U user[,user...]]
@jhyland87
jhyland87 / brace_expansion.sh
Last active February 24, 2017 18:18
Just an example of how "Brace Expansion" can be useful
$ echo aws{cli,-{a{s,pigateway-importer},c{fn-tools,loudsearch},elastic{ache,beanstalk},mon,keychain,s{hell,dk-cpp,ns-cli}}}
awscli aws-as aws-apigateway-importer aws-cfn-tools aws-cloudsearch aws-elasticache aws-elasticbeanstalk aws-mon aws-keychain aws-shell aws-sdk-cpp aws-sns-cli
$ echo aws{cli,-{a{s,pigateway-importer},c{fn-tools,loudsearch},elastic{ache,beanstalk},mon,keychain,s{hell,dk-cpp,ns-cli}}} | tr ' ' '\n' | sort
aws-apigateway-importer
aws-as
aws-cfn-tools
aws-cloudsearch
aws-elasticache
aws-elasticbeanstalk
# Look through the history for the executions of any commands specified
#
# Example:
# $ function foo { echo "Printing foo"; }
# $ function bar { echo "Printing bar"; }
# $ function baz { echo "Printing baz"; }
# $ foo
# Printing foo
# $ bar
# Printing bar