Skip to content

Instantly share code, notes, and snippets.

@majormoses
majormoses / zoom-osx-prevent-webserver-reinstall.bash
Last active July 10, 2019 19:59
A script to mitigate concerns with zoom RCE and video through the installed webserver, see https://link.medium.com/8iiKfpAyaY for more details
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
# detect os
echo "detected: ${OSTYPE}"
# delete the `.zoomus` if its a folder
if [[ -d ~/.zoomus ]]; then
rm -rf ~/.zoomus
fi
@majormoses
majormoses / ubuntu-1604.log
Last active April 26, 2019 01:52
test-sensu-go-chef
$ KITCHEN_LOCAL_YAML=.kitchen.dokken.yml bundle exec kitchen converge default-ubuntu-1604
-----> Starting Kitchen (v1.21.2)
-----> Creating <default-ubuntu-1604>...
Creating kitchen sandbox at /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1604
Creating verifier sandbox at /home/babrams/.dokken/verifier_sandbox/c488ee9495-default-ubuntu-1604
Building work image..
Creating container c488ee9495-default-ubuntu-1604
Finished creating <default-ubuntu-1604> (0m17.72s).
-----> Converging <default-ubuntu-1604>...
Creating kitchen sandbox in /home/babrams/.dokken/kitchen_sandbox/c488ee9495-default-ubuntu-1604
@majormoses
majormoses / logs-install-aws-plugin-docker.txt
Last active November 5, 2018 23:47
This is a log of install (including timing) of `sensu-plugins-aws` gem
# clone my repo for quick testing of plugins in an isolated container
$ git clone git@github.com:majormoses/sensu-plugin-install-test.git
Cloning into 'sensu-plugin-install-test'...
remote: Counting objects: 26, done.
remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 26
Receiving objects: 100% (26/26), 7.84 KiB | 7.84 MiB/s, done.
Resolving deltas: 100% (9/9), done.
# created Gemfile, showing contents
$ cat app/Gemfile
@majormoses
majormoses / sensu-test-dokken-systemd.log
Created July 19, 2018 03:35
Attempting to replicate systemd issues with sensu in `kitchen-dokken`
$ KITCHEN_YAML=.kitchen.dokken.yml bundle exec kitchen converge minimal-ubuntu-1604
-----> Starting Kitchen (v1.22.0)
-----> Creating <minimal-ubuntu-1604>...
Creating kitchen sandbox at /home/babrams/.dokken/kitchen_sandbox/3429c7f89b-minimal-ubuntu-1604
Creating verifier sandbox at /home/babrams/.dokken/verifier_sandbox/3429c7f89b-minimal-ubuntu-1604
Building work image..
Creating container 3429c7f89b-minimal-ubuntu-1604
Finished creating <minimal-ubuntu-1604> (0m1.94s).
-----> Converging <minimal-ubuntu-1604>...
Creating kitchen sandbox in /home/babrams/.dokken/kitchen_sandbox/3429c7f89b-minimal-ubuntu-1604
$ ./gradlew packagingTest -Pvagrant.boxes=centos-6,ubuntu-1404
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/4.7/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Configure project :benchmarks
=======================================
Elasticsearch Build Hamster says Hello!
=======================================
Gradle Version : 4.7
OS Info : Linux 4.15.0-23-generic (amd64)
@majormoses
majormoses / testing-artifact
Created March 17, 2018 06:26
Testing artifact for fixing sensu-plugins-ssl #35
# test without debug and default options
$ time bundle exec ./bin/check-ssl-qualys.rb -d google.com
CheckSSLQualys OK: google.com rated A
real 2m48.673s
user 0m0.208s
sys 0m0.020s
# test without debug and default options
$ time bundle exec ./bin/check-ssl-qualys.rb -d google.com
@majormoses
majormoses / keybase.md
Created March 8, 2018 02:26
Keybase Proof

Keybase proof

I hereby claim:

  • I am majormoses on github.
  • I am majormoses (https://keybase.io/majormoses) on keybase.
  • I have a public key ASDkf6DeBHYQYgrqCPmlhZXXHQ3YGmhjcg6xWRPUh-wI-Ao

To claim this, I am signing this object:

diff --git a/bin/metrics-logstash-node.rb b/bin/metrics-logstash-node.rb
index d8251b3..3975230 100755
--- a/bin/metrics-logstash-node.rb
+++ b/bin/metrics-logstash-node.rb
@@ -112,32 +112,62 @@ class LogstashNodeMetrics < Sensu::Plugin::Metric::CLI::Graphite
metrics['process.open_file_descriptors'] = node['process']['open_file_descriptors']
metrics['process.peak_open_file_descriptors'] = node['process']['peak_open_file_descriptors']
metrics['process.max_file_descriptors'] = node['process']['max_file_descriptors']
-
- node['pipeline']['events'].each do |key, value|
@majormoses
majormoses / jenkins_recipe.rb
Last active November 8, 2017 04:19
Example of how to restart a service, wait for it to come up, and then do more things
# drop in a template and immediately restart jenkins
template "#{node['jenkins']['master']['home']}/config.xml" do
source 'config.xml.erb'
variables({
'github_client_id' => <REDACTED>,
'github_client_secret' => <REDACTED>
})
owner node['jenkins']['master']['user']
group node['jenkins']['master']['group']
mode '0600'
@majormoses
majormoses / check-http-healthcheck.rb
Created October 12, 2017 23:00
A script that checks an http endpoint, parses json, and alerts when healthchecks fail
#! /usr/bin/env ruby
#
# check-cc-heap-limit
#
# DESCRIPTION:
# A script that checks an http endpoint, parses json, and alerts when healthchecks fail
#
# OUTPUT:
# plain-text
#