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
| #!/opt/sensu/embedded/bin/ruby | |
| require 'sinatra' | |
| require 'json' | |
| require 'rest-client' | |
| class RabbitMqHealthCheck | |
| # /etc/sensu/plugins/rabbitmq-alive.rb | |
| # can CheckRabbitMQ class be used directly instead? | |
| def vhost_alive? | |
| host = 'localhost' |
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
| # brew install git | |
| # brew install bash | |
| # brew install bash-completion@2 | |
| # brew install kube-ps1 | |
| # brew install kubernetes-cli | |
| export BASH_COMPLETION_COMPAT_DIR="/usr/local/etc/bash_completion.d" | |
| [[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh" | |
| source /usr/local/etc/bash_completion.d/git-completion.bash | |
| source /usr/local/etc/bash_completion.d/git-prompt.sh |
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 | |
| set -x | |
| for repo in */.git | |
| do | |
| ( | |
| echo $repo | |
| cd $repo/.. | |
| git branch | |
| git pull |
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 | |
| # references | |
| # http://www.lonecpluspluscoder.com/2017/04/27/installing-java-8-jdk-os-x-using-homebrew/ | |
| # http://www.lonecpluspluscoder.com/2017/10/08/installing-other-versions-of-the-java-jdk-via-homebrew/ | |
| # install homebrew https://brew.sh/ | |
| # brew tap caskroom/cask | |
| # Java 8 was previously installed |
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
| import com.google.gson.Gson; | |
| import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; | |
| import org.springframework.amqp.rabbit.connection.ConnectionFactory; | |
| import org.springframework.amqp.rabbit.core.RabbitTemplate; | |
| import org.springframework.messaging.Message; | |
| import org.springframework.messaging.support.GenericMessage; | |
| public class TestMessagePublisherUtil { |
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
| var moment = require('moment'); | |
| var isBusinessHours = function() { | |
| var now = moment().utcOffset(-5 * 60); // Eastern | |
| return (now.day() > 0 && now.day() < 6 && now.hour() > 8 && now.hour() < 18); | |
| }; |
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
| #!/usr/bin/env python3 | |
| def main(): | |
| sql = open("large.sql", "w") | |
| for var1 in range(0, 10): | |
| for var2 in range(0, 300): | |
| write_records(sql, var1, var2) | |
| sql.close() | |
| def write_records(sql, var1, var2): |
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 | |
| branches=( | |
| "branch-1" | |
| "branch-2" | |
| ) | |
| for branch in "${branches[@]}" | |
| do | |
| echo git push origin origin/${branch}:refs/tags/${branch} | |
| git push origin origin/${branch}:refs/tags/${branch} |
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 | |
| apps=( | |
| "app1" | |
| "app2" | |
| ) | |
| for app in "${apps[@]}" | |
| do | |
| cf events ${app} | |
| done |
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
| alias redis-cli='docker run -it --name redis-cli --link redis:redis --network localtesting_default --rm redis sh -c '''exec redis-cli -h redis -p 6379'''' |
OlderNewer