Skip to content

Instantly share code, notes, and snippets.

View BlackMaria's full-sized avatar
💭
hating social media and public status indicators

Hroðgar Skjöldung BlackMaria

💭
hating social media and public status indicators
  • 3rd planet left of the yellow one
View GitHub Profile
@BlackMaria
BlackMaria / mod_xcat2mysql.sh
Created May 24, 2013 20:15
Configure xcat to use mysql rather than sqlite. Note if you haven't changed your mysql root passwd you should read code for more info.
#!/bin/sh
MANAGMENTNODE=xcat
# passwords used in script
# root password for mysql
# ( if using user other than root modify below )
SQL_ROOT_PASS=rootpw
# The password used by xcat
# ( you dont need to know this unless you decied to debug mysql )
XCAT_PASS=xcat_user_passwd
#
@BlackMaria
BlackMaria / install_xcat.sh
Last active December 17, 2015 17:29
I typically run something like this after a fresh install
#!/bin/sh
# I typically run something like this after a fresh install
########################################
# What DISTRO are we installing on
########################################
release=rh6
ARCH=x86_64
DISTRO=centos6.4
ISO_DISTRO=CentOS6.4
@BlackMaria
BlackMaria / tick_eumlator.rb
Last active December 17, 2015 17:29
A simple linear function used to emulate accumulative ticks during a day ( 6am-6am). Code outputs two values +30% and the estimated ticks water marks. This is by first ruby code :)
#!/usr/bin/env ruby
#
# The idea here is, tick is almost a linear function. We really want a
# tick_function and compare based on time of day, but this will do for now.
#
# We can almost determine the typical linear increase of errors
# based on time of day. So here we assume that the linear starts
# at 6am and increases until 6am the next day.
#
# NB: One flaw is that the values are less relevant before noon :}
@BlackMaria
BlackMaria / pdf_merge.sh
Created May 24, 2013 20:53
I use this all the time. d to a dir and create one pdf from all of the pdf's in that dir ( or use it in the command line, which is what I do ).
#!/bin/sh
pdf=*.pdf
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=pdfmerged.pdf $pdf
# yeah!!!!
@BlackMaria
BlackMaria / mk_lumberjack_keys.sh
Created May 24, 2013 20:58
This is what I eventually used to generate ssl keys for lumberjack. I had made several attempts that failed and with the help of tomar ( how pointed me to a page for apache certs... ) this is what I did and it worked.
#!/bin/sh
SERVER=logstash
################################################
if [ ! -f "${SERVER}.crt" -o ! -f "${SERVER}.key" ] ; then
rm -f ${SERVER}.{crt,key,csr}
openssl genrsa -des3 -out ${SERVER}.key 1024
openssl req -new -key ${SERVER}.key -out ${SERVER}.csr
cp ${SERVER}.key ${SERVER}.key.org
openssl rsa -in ${SERVER}.key.org -out ${SERVER}.key
openssl x509 -req -days 365 -in ${SERVER}.csr -signkey ${SERVER}.key -out ${SERVER}.crt
@BlackMaria
BlackMaria / monitor_debug_cisco_wifi.sh
Created May 24, 2013 21:11
copy this to a cisco wlc to watch the fireworks!
debug client ${HEXSTUFF}
debug dhcp packet enable
debug dot11 mobile enable
debug dot11 state enable
debug dot1x events enable
debug pem events enable
debug pem state enable
debug cckm client debug enable
@BlackMaria
BlackMaria / notes.ttx
Created May 24, 2013 21:14
scattered notes on configuring sflow for ntop & cisco
##################################
## CISCO
NetFlow
##################################
enable
configure terminal
ip
@BlackMaria
BlackMaria / logstash_testcase_output.json
Created June 5, 2013 14:14
The way I am dealing with grok failures is to create a test case from them. For others in the same boat I suggest you add this "output" to your logstash configs ( I suggest all of them ) and then you are automatically creating test cases to see what failed! NB: It has been suggested to try to pass "_grokparsefailure" tagged files passed the same…
output {
file {
#gzip => true
path => "/var/log/testcases/failed_grok_%{type}"
tags => "_grokparsefailure"
}
# ....
}
@BlackMaria
BlackMaria / 0
Last active December 18, 2015 18:19
It seems that installing the latest version of Vagrant breaks the old config.
[originally posted in 2013] It seems that installing the latest version of Vagrant breaks the old config.
If there is something I hate, it is code that is not backward compatible AND breaks OLD configs at the same time.
...That is to say, I installed the NEW vagrant and was told my boxes were build for OLD vagrant.
So ( being in a rush) I reinstalled the old vagrant and that complained that I had a NEW vagrant config and refused to work.
Meaning once you install the NEW vagrant your old config is broken so you must fix it...
Well, this is the thing I did. Anyway, were would I be without vagrant! So thanks just the same
@BlackMaria
BlackMaria / install_logstash_kibana_centos.sh
Created February 10, 2014 17:00
here is an quick example of how to install logstash and kibana to get you quick started
#!/bin/sh
#
# To use logstash you need java
# To use kibana you need nodejs
#
# java and nodejs are on EPEL
#
rpm -Uvh http://fedora.mirror.nexicom.net/epel/6/i386/epel-release-6-8.noarch.rpm
yum -y install java-1.7.0-openjdk nodejs