Skip to content

Instantly share code, notes, and snippets.

View alexvaque's full-sized avatar

Alex Vaque alexvaque

View GitHub Profile
#!/usr/bin/env bash
name=fooAlert-$RANDOM
url='http://localhost:9093/api/v1/alerts'
bold=$(tput bold)
normal=$(tput sgr0)
generate_post_data() {
cat <<EOF
[{
@tanji
tanji / check-replication-manager.rb
Created June 21, 2017 12:33
Sensu check plugin for MariaDB / MySQL Replication Manager
#!/usr/bin/env ruby
# check-replication-manager.rb
# Copyright 2017 SIGNAL 18 <[email protected]>
# Released under the MIT License. Full text at https://opensource.org/licenses/MIT
require 'sensu-plugin/check/cli'
require 'json'
require 'net/http'
class MRMCheck < Sensu::Plugin::Check::CLI
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active May 25, 2024 20:19
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
fi
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
@emersonmoretto
emersonmoretto / benchmark.sh
Created August 9, 2011 21:06
Apache bench + Gnuplot Script
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <URL1> <URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 http://www.google.com/ http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'