Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

  • 48°52.6′S 123°23.6′W
View GitHub Profile
$ compgen -A command | sort -u | grep -Ev '^(x86_64|_|ec2|as-|mysql|sql|db|mongo|nfs|tcp|git|svn|mon-|airspy|check_)' | grep --color=always -iE '(proc|win|info|stat|web)'
FileStatsAgent
GetFileInfo
NetBootClientStatus
addftinfo
afinfo
argus-vmstat
capinfos
captoinfo
coproc
@jhyland87
jhyland87 / lsappinfo.txt
Created March 8, 2018 21:03
showing all populated values of google via lsappinfo
$ lsappinfo info com.google.Chrome -only allowedtobecomefrontmost,applicationTypeToRestore,applicationWasTerminatedByTAL,applicationtype,arch,asn,bundleid,bundlelastcomponent,bundlename,bundlenamelc,bundlepath,changecount,creator,debuglevel,displayname,execpath,executablepath,filecreator,filename,filetype,hidden,isconnectedtowindowserver,isready,isregistered,isstopped,isthrottled,launchedForPersistence,launchedinquarantine,name,parentasn,pid,presentationmode,presentationoptions,psn,recordingAppleEvents,session,shellpath,supressRelaunch,version,kCFBundleNameKey,kLSASNKey,kLSASNToBringForwardAtNextApplicationExitKey,kLSAllowedToBecomeFrontmostKey,kLSApplicationBackgroundOnlyTypeKey,kLSApplicationBackgroundPriorityKey,kLSApplicationCountKey,kLSApplicationDesiresAttentionKey,,kLSApplicationForegroundPriorityKey,kLSApplicationForegroundTypeKey,kLSApplicationHasRegisteredKey,kLSApplicationHasSignalledItIsReadyKey,kLSApplicationInStoppedStateKey,kLSApplicationInThrottledStateAfterLaunchKey,kLSApplicationInformationS
#! /usr/local/bin/awk -f
# Examples:
# ls -1 | ./hr-with-string.1.awk
# ls -1 | ./hr-with-string.1.awk -v pad=30
# ls -1 | ./hr-with-string.1.awk -v pad=30 -v hr='-'
# ls -1 | ./hr-with-string.1.awk -v pad=30 -v hr='><'
function center( str, a, left, right ){
right = int(( CFG[ pad ] - length(str)) / 2)
$ sort --reverse /usr/share/dict/words | head -n 20 | awk -v hrl=20 -v padding=30 -v hr="x" -f ./hr-with-string.1.awk
------------------------------ zythum ------------------------------
------------------------------ zythem ------------------------------
------------------------------ zymurgy ------------------------------
------------------------------ zymotoxic ------------------------------
------------------------------ zymotize ------------------------------
------------------------------ zymotically ------------------------------
------------------------------ zymotic ------------------------------
------------------------------ zymotechny ------------------------------
------------------------------ zymotechnics ------------------------------
@jhyland87
jhyland87 / random-words.sh
Created March 7, 2018 19:25
Geoffs failure
#!/usr/local/bin/bash
function center {
if test -p /dev/stdin; then
data=$(</dev/stdin)
elif test -a ${1}; then
data=$(cat ${1})
elif test -n ${1}; then
data=$*
else
#!/bin/bash
# Backup mysql databases nightly
# Scott B.
# 6/2/2013
# Create a current date string
DATE=`date +%Y.%m.%d-%H.%M.%S`
BACKUP_DIR=/mnt/CHD_DB_BACKUP/
BACKUP_FILE=$BACKUP_DIR$DATE"_Mysql44_databases.sql"
#!/bin/bash
# Load nightly mysqldump
# aaa B / bbb G / ccc B
# 10/17/2014
BACKUP_DIR=/mnt/CHD_DB_BACKUP
DATE=`date +%Y.%m.%d-%H.%M.%S`
BACKUP_FILE=`ls -1r $BACKUP_DIR/*.* | head -1`
/**
* @desc An attempt at persistent browser console log history
* @note How To Use:
* 1) Copy/paste all below JS into the browsers JS console
* 2) Use any of the console.log/debug/warn/error functions
* 3) Refresh the page
* 4) Repeat steps #1 & #2 a few times
* 5) Execute export_console_logs via the browser console (passing the log type as the only argument) to get the log history
* @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
*/
@jhyland87
jhyland87 / get_cli_awk_vars.awk
Last active May 13, 2022 23:43
Parse the executed command, assessing all variables set via -v or --assign, adding the key/values to an array
#!/usr/bin/env awk -f
#
# THIS IS CURRENTLY BROKEN - im working on it.
#
# Description: Grabs the fully executed command by using the ps command to find the "args" data
# for the pid PROCINFO["pid"], then parses it by looking for any awk variables set
# using -v or --assign via the execution.
#
@jhyland87
jhyland87 / grep2vim.awk
Created December 27, 2017 23:49
Awk script to parse output of git and return commands that can be executed to open results in vim Raw
#!/usr/bin/env awk -v cmd=sh -v goto=last -f
# Output of Grep command
# $ grep -RnHsi waldo scripts
# scripts/find-user.js:3:if ( process.argv.length > 1 && process.argv[2] === 'Waldo' )
# scripts/find-user.js:4: console.log("You ARE lookin for Waldo")
# scripts/find-user.js:6: console.log("You are NOT lookin for Waldo")
# scripts/find-user.sh:4:if test -n $1 && [[ $1 == 'Waldo' ]]; then
# scripts/find-user.sh:5: echo "You ARE lookin for Waldo"
# scripts/find-user.sh:7: echo "You are NOT lookin for Waldo"