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
# This isn't REALLY a one-liner per-se, just a wildly effecient timesaver. | |
# But it did save my ass on a tight deadline when I didn't have supporting automation ready yet | |
# `pbcopy` (and its friend, `pbpaste`) are works of art. | |
for aws_account in `cat data_file.json | jq -r '.aws_account[] | .number'`; do | |
for role in `cat data_file.json | jq -r '.roles[]'`; do | |
echo "arn:someshitIforgot:${aws_account}:roles/${role}" | pbcopy | |
echo "Role copied, paste it into the policy document. Hit enter to continue." | |
# I'm not using PLACEHOLDER anywhere else in the real script, this is purely about lazy. | |
read PLACEHOLDER |
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 | |
#In early development, sometimes you've got a hand-built instance, but you also don't want to leave it up all the time | |
# We've got an m4xl instance running Spinnaker (http://spinnaker.io) but we only really need it during the day | |
# As a cost-saving measure, we shut it down overnight. However, we want it to be consistently accessible | |
# So this script is in a Jenkins job that runs every morning, | |
# starting up the instance then updating its DNS record to the new IP. | |
### | |
# SETTINGS |
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
$DaysBack = 14 | |
$ArchiveYears = 2 | |
[switch]$Timestamp = $true | |
[switch]$WhatIf = $false | |
$Types=(".png",".jpg",".gif",".mp4") | |
If($env:COMPUTERNAME -eq "ZEUS"){ | |
$FolderToOrganize = 'D:\Chris\Dropbox\Camera Uploads' | |
$ArchiveLocation = 'D:\Chris\Dropbox\Archive\Photos' | |
}ElseIf($env:COMPUTERNAME -eq "NCC1701"){ |
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
# Don't forget to set COMPLETION_WAITING_DOTS=false in your .zshrc - it doesn't always play nice with multiline prompts | |
# Troubleshooting breadcrumbs: | |
# Prompt design: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion | |
# Zsh Line Editor (zle): http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html | |
#Broken down into its component pieces because I was tired of looking at a nearly incomprehensible string | |
FG_USER_BADGE=$'%{$fg_bold[green]%}%n@%m%{$reset_color%}' | |
FG_TIMESTAMP=$'%{$fg[blue]%}%D{[%X]}%{$reset_color%}' | |
FG_CWD_DISPLAY=$'%{$fg[white]%}[%~]%{$reset_color%}' |
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 | |
#Tail a temp file, pipe it into GNU Parallel. | |
#Generally FIFOish but don't count on it, no guarantees about execution order between setup and tear-down | |
#Tips: | |
#I threw this together for a network based load - | |
# for disk-bound (esp magnetic hard drives) loads, lower -j to 1 or switch to --semaphore | |
# most load you can probably just omit -j and run with defaults. (One concurrent job per CPU core) | |
#todo: |
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 | |
#Example: | |
#p@55w0rd | |
#ce0b2b771f7d468c0141918daea704e0e5ad45db | |
#Speed up grep by making cases match | |
echo "Password to check: " | |
HASH=`read -s; echo -n $REPLY | shasum | cut -d" " -f1 | tr '[:lower:]' '[:upper:]'` | |
SHORTHASH=`echo $HASH | cut -b1-5` |
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 | |
PHRASE=${1} | |
echo -n "${PHRASE} " | |
for letter in {a..z}; do | |
echo "${PHRASE}" | grep -i $letter > /dev/null | |
if [ $? -ne 0 ]; then | |
echo -n $letter | |
fi | |
done | |
echo |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: busybox | |
namespace: default | |
spec: | |
containers: | |
- name: busybox | |
image: busybox:1.28 | |
command: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>DisplayProductID</key> | |
<integer>10144</integer> | |
<key>DisplayProductName</key> | |
<string>ROG PG27U</string> | |
<key>DisplayVendorID</key> | |
<integer>1715</integer> |