This file contains hidden or 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
unbuffer tail -f /var/log/log.log | egrep --line-buffered "DEPLOY_SUMMARY" | xargs -I {} /usr/bin/curl -XPOST -H "content-type:application/json" -d '{"content":"{}","external_user_name": "Deploy"}' https://api.flowdock.com/v1/messages/chat/xxxxx |
This file contains hidden or 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
; pardon syntax - clojure newb | |
; Custom subject | |
(def email | |
(mailer | |
{ | |
:from "[email protected]" | |
:host "localhost" | |
:subject (fn [events] (apply str "RIEMANN DETECTION: " (get-in (first events) [:host]) " TRIGGERED [" (get-in (first events) [:service]) " STATE]: " (get-in (first events) [:state]))) | |
} |
This file contains hidden or 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 | |
# SUDOERS /etc/sudoers.d/lbbackup | |
# Cmnd_Alias LS_HARDWARE = /usr/bin/lshw | |
# Cmnd_Alias MOUNT_UDF = /bin/mount -oloop\,rw * | |
# Cmnd_Alias UNMOUNT_UDF = /bin/umount /data/TEMP_UDF_DIR/MOUNT_UDF | |
# Cmnd_Alias BURN_UDF = /usr/bin/growisofs | |
# Cmnd_Alias CHOWN_MOUNT = /bin/chown -R lbbackup\:lbbackup /data/TEMP_UDF_DIR/MOUNT_UDF | |
# lbbackup ALL=(ALL) NOPASSWD: LS_HARDWARE, MOUNT_UDF, UNMOUNT_UDF, BURN_UDF, CHOWN_MOUNT |
This file contains hidden or 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
$script:ComputerName = [Environment]::getenvironmentvariable("COMPUTERNAME") | |
$script:BootTime = [Environment]::getenvironmentvariable("AWS_BootTime", "Machine") | |
$script:LaunchTime = [Environment]::getenvironmentvariable("AWS_LaunchTime", "Machine") | |
$script:DeployTime = [Environment]::getenvironmentvariable("AWS_DeployTime", "Machine") | |
$script:EnvName = [Environment]::getenvironmentvariable("AWS_EbEnvironmentName", "Machine") | |
$script:EbAppName = [Environment]::getenvironmentvariable("AWS_EbApplicationName", "Machine") | |
$script:CDN_STATUS = [Environment]::getenvironmentvariable("CDN_STATUS", "Machine") |
This file contains hidden or 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 | |
#ASSUMES KeyPairs are stored in ~/.ssh | |
# Also make sure to install jq and have in your path to run below | |
# JQ: https://stedolan.github.io/jq/ | |
AWS_BIN="/usr/local/bin/aws" | |
AWS_PROFILE="omar-dev" | |
KP_DIR="~/.ssh" |
This file contains hidden or 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
((get-elbtags -LoadBalancerName ELB-OMAR).Tags | where {$_.key -eq 'tag-name'}).Value | |
$instance_state = (Get-ELBInstanceHealth -LoadBalancerName $elb_name | where {$_.InstanceId -eq "$instance_id"}).State |
This file contains hidden or 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
jq -C . | less -R |
This file contains hidden or 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
#f*ck joo | |
$deploy_args = @( | |
"-verb:sync", | |
"-source:package=$provisioning_dir/$zip_name", | |
"-dest:auto", | |
"-setParam:name='IIS Web Application Name',value='omar'" | |
) | |
$deploy = Start-Process ${msdeploy_bin} -NoNewWindow -ArgumentList $deploy_args -PassThru -Wait |
This file contains hidden or 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
$failed_status_types = 'CREATE_FAILED', 'DELETE_FAILED', 'ROLLBACK_FAILED', 'UPDATE_ROLLBACK_FAILED' | |
if ($failed_status_types -match "some_string" ) { "si" } |
This file contains hidden or 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
Does't work: | |
jq '.foo.dude-yes' | |
Works | |
jq '.foo["dude-yes"]' |