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
export PS1='\e[1;35m\u\e[m@\h:\e[1;31m\w\e[m\n\$ ' | |
export PATH="$PATH:~/bin/" | |
# auto complete hostnames | |
_complete_ssh_hosts () | |
{ | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \ | |
cut -f 1 -d ' ' | \ |
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 | |
# chkconfig: 345 99 01 | |
# description: ${SOME_NAME} | |
. /etc/rc.d/init.d/functions | |
RUNAS=omar | |
NAME='loop_test' | |
SCRIPT='/home/omar/while_loop.sh' | |
LOG_FILE="/home/omar/${NAME}.log" |
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
node['ec2']['instance_id'] | |
node['ec2']['local_ipv4'] | |
node['ec2']['placement_availability_zone'] | |
node['ec2']['ami_id'] |
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
export PS1='\e[1;32m[\t] \e[1;35m\u\e[m@\h:\e[1;31m\w\e[m\n\$ ' |
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
ruby { | |
code => | |
" | |
fieldArray = event['lb_message'].split(' '); | |
for field in fieldArray | |
name = 'prefix_' + field.split('=')[0]; | |
value = field.split('=')[1]; | |
if value =~ /\A\d+\Z/ | |
event[name] = value.to_i | |
elsif value =~ /(^(\d+)(\.)?(\d+)?)|(^(\d+)?(\.)(\d+))/ |
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
Does't work: | |
jq '.foo.dude-yes' | |
Works | |
jq '.foo["dude-yes"]' |
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
$failed_status_types = 'CREATE_FAILED', 'DELETE_FAILED', 'ROLLBACK_FAILED', 'UPDATE_ROLLBACK_FAILED' | |
if ($failed_status_types -match "some_string" ) { "si" } |
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
#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 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 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 |