Skip to content

Instantly share code, notes, and snippets.

Avatar

JJ Asghar jjasghar

View GitHub Profile
@jjasghar
jjasghar / create_vm.sh
Created May 18, 2012
Using Virtualbox to build throw away vms
View create_vm.sh
#!/usr/local/bin/bash
VDI_DIR='/home/me/vdi/'
UBUNTU_GOLD_VDI="ubuntu_11_10_gold.vdi"
REDHAT_GOLD_VDI="centos_6_2_gold.vdi"
HOST_NIC="em0"
echo "Name of VM"
read name_of_vm
View ascii.txt
ಠ_ಠ Disapproval
(╯°□°)╯︵ ┻━┻ Flipped the table
┬──┬ ノ( ゜-゜ノ) Put the table back
t(-_-)t Both middle fingers up
..|..(~.')> Pissed off Kirby
View gist:3011904
10:08:55 [h0m3ro] ~ $ nethack-console
[1]+ Stopped nethack-console
10:09:31 [h0m3ro] ~ $ sudo kill -9 nethack-console
ERROR: garbage process ID "nethack-console".
Usage:
kill pid ... Send SIGTERM to every process listed.
kill signal pid ... Send a signal to every process listed.
kill -s signal pid ... Send a signal to every process listed.
View gist:3020509
[default]
host = charlie.its.utexas.edu
index=bbdev
# Syslogs
[monitor:///var/log/messages]
index=syslog
# Secure logs
[monitor:///var/log/secure]
@jjasghar
jjasghar / gist:3101236
Created Jul 12, 2012
Redhat Linux Audit
View gist:3101236
#!/bin/bash
DATE=`date +%F`
HOSTNAME=`hostname -s`
EMAIL=me@hostname.com
uname -a >> /tmp/$HOSTNAME.$DATE.txt
echo "" >> /tmp/$HOSTNAME.$DATE.txt
uptime >> /tmp/$HOSTNAME.$DATE.txt
View gist:3123602
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
=====================================================================
Red Hat Security Advisory
Synopsis: Moderate: sudo security update
Advisory ID: RHSA-2012:1081-01
Product: Red Hat Enterprise Linux
Advisory URL: https://rhn.redhat.com/errata/RHSA-2012-1081.html
View gist:3365692
#!/usr/local/bin/bash
VBoxManage clonehd ubuntu_11_10_gold.vdi ubuntu_11_10_tmp.vdi
VBoxManage createvm --name "tmp" --ostype "Ubuntu" -register
VBoxManage modifyvm "tmp" --memory 4096 --boot1 dvd
VBoxManage storagectl "tmp" --name "IDE Controller" --add ide
VBoxManage storageattach "tmp" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ubuntu_11_10_tmp.vdi
VBoxManage modifyvm "tmp" --nic1 bridged --nictype1 82543GC --bridgeadapter1 em0
VBoxHeadless -s "tmp" -n
View tmp_ubuntu_build.sh
#!/usr/local/bin/bash
VBoxManage clonehd ubuntu_11_10_gold.vdi ubuntu_11_10_tmp.vdi
VBoxManage createvm --name "tmp" --ostype "Ubuntu" -register
VBoxManage modifyvm "tmp" --memory 4096 --boot1 dvd
VBoxManage storagectl "tmp" --name "IDE Controller" --add ide
VBoxManage storageattach "tmp" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium ubuntu_11_10_tmp.vdi
VBoxManage modifyvm "tmp" --nic1 bridged --nictype1 82543GC --bridgeadapter1 em0
VBoxHeadless -s "tmp" -n
View gist:4090213
13:37:29 [ops01] cookbooks $ knife environment show _default
chef_type: environment
cookbook_versions: {}
default_attributes: {}
description: The default Chef environment
json_class: Chef::Environment
name: _default
override_attributes: {}
[ops01] cookbooks $ knife cookbook show shibboleth
View riemann-dash-recipes.markdown

Application specific host grouping in Riemann-dash

It is generally desirable to group all the hosts for a specific service into a single dashboard view. For example, all the web servers are in single view while all the database servers are in another view.

This is usually not an issue when you are sending custom metrics using Riemann client. However, there are cases where you are using something that you do not control how the metrics are being sent. i.e., Riemann-tools.

Since Riemann-tools scripts are application agnostic, in order for the dashboard view to group hosts, we must inject some application specific information into the tags field. Tags is a collection of arbitrary strings. In the case of Riemann-tools scripts you can pass in arbitrary strings on the command line.

riemann-health --host 127.0.0.1 --tag "prod" --tag "webserver"