This file contains 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
function curlcmd() { | |
method=${1:-GET} | |
method=$(echo $method | tr '[a-z]' '[A-Z]') | |
/usr/bin/curl -X ${method} -i --header 'Accept: application/json' ${@:2} && echo | |
} | |
alias cjpost="curlcmd post" | |
alias cjget="curlcmd get" |
This file contains 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 | |
# Create /etc/profile.d/prompt.sh and add the content of this gist to it. | |
# | |
# Prompt example: | |
# (2)[Fri May 06 10:00:30| 0:003]{4}root@ip-172-31-1-226:~(0)# | |
# Format is: | |
# (sessions on server)[date time| Last command exec time]{sessions on server}username@hostname:working_directory(exit code of last cmd)# | |
# | |
# Example Output (of $[prompt[0]}): http://d.pr/i/19B87 | |
# |
This file contains 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/local/bin/awk -f | |
# Solution by Ed Morton (http://stackoverflow.com/a/43946907/5154806) | |
# Example: echo -e "personal.name.first=John\npersonal.name.last\t=Doe\npersonal.other.dob=\t05/07/87\npersonal.contact.phone\t=\t602123456\npersonal.contact.email\t = \tjohn.doe@idk\nemployment.jobs.1\t\t= Company One\nemployment.jobs.2 \t =Company Two\nemployment.jobs.3\t= Company Three" | ./tst.awk | |
BEGIN { | |
FS="[\t ]*=[\t ]*" | |
} | |
{ | |
split($1,d,/\./) | |
data[d[1]][d[2]][d[3]] = $2 |
This file contains 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/local/bin/awk -f | |
# Todo: | |
# skip empty rows | |
# Look for duplicate pids | |
# Validate data types in columns: | |
# - pid (int) | |
# - ppid (int) | |
# - uid (int) | |
# - ruid (int) |
This file contains 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/awk -f | |
# Examples | |
# $ ps -o pid,user,cpu,%cpu,%mem,nswap,sess,tty | ./ps_total.awk | |
# Count : 58 | |
# USER : 0 | |
# CPU : 0 | |
# %CPU : 1.8 | |
# %MEM : 2.5 | |
# NSWAP : 0 |
This file contains 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/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) |
This file contains 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 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. | |
# |
This file contains 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/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 |
This file contains 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
Question: | |
Tell me about a time that you strongly disagreed with your | |
manager on something you deemed to be very important to the | |
business. What was it about and how did you handle it? | |
Answer: | |
I think the most prevalent example would be the mentality in which my | |
previous manager and I had towards potential problems related to | |
monitoring, logging and security weaknesses. It seemed to me that he | |
had more of a reactive oriented mentality, where as I thought it was |
This file contains 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
AUIBuild | |
ActionPanelAssets | |
AmazonCertifiedDetailPageAssets | |
AmazonCustomBuyBoxAssets | |
AmazonCustomCommonAssets | |
AmazonCustomPreviewerAssets | |
AmazonPopoversAUIShim | |
AmazonsChoiceAssets | |
Assets | |
BabyRegistryDPAssets |