Skip to content

Instantly share code, notes, and snippets.

@drolfe
drolfe / ADD User Account to iLO.xml
Last active August 11, 2023 23:14
HP iLO XML Scripts
HPONCFG all << end_marker
<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="Dontcare" PASSWORD="UsingAutologin">
<USER_INFO MODE="write">
<ADD_USER
USER_NAME="daniel"
USER_LOGIN="daniel"
PASSWORD="daniel123">
<ADMIN_PRIV value ="Yes"/>
<REMOTE_CONS_PRIV value ="Yes"/>
@drolfe
drolfe / Solusvm_kvm_migration_2-minute_outage.sh
Last active October 30, 2021 18:47
Solusvm kvm migration 2-minute outage
#New host
#Create a bank LV the same size as the source
lvcreate -L 400G -n kvm133_img vm_vg
#Old Host
#Creat a snapshot to stop any new data being written to the 400G LV, All changes get written to the snap lv now
lvcreate --snapshot -L10G -n kvm133-snap /dev/4tb_raid_vg/kvm133_img
@drolfe
drolfe / README.md
Last active June 9, 2021 22:44
Dashing Snmp Interface Stats

Description

Simple Dashing job (and associated dash html) to display SNMP interface percentages

##Dependencies

snmp

Add it to dashing's gemfile:

@drolfe
drolfe / snmp.rb
Last active April 2, 2021 20:36
Ruby Snmp Interface Bandwidth
#!/usr/bin/ruby
require 'rubygems'
require 'snmp'
include SNMP
@results = Array.new
# Interface speed in mbps
interface_speed = 10000
def get_snmp
@drolfe
drolfe / observium-client.sh
Created December 23, 2015 11:25
Obserivum Client Setup Script
#!/bin/bash
## Obserivum Client Setup Script
## v.0.5 - 12/15/13 - nunim@sonicboxes.com
## Tested on Debian 6/7 & Ubuntu 12.04+ - CentOS 5.8/6.4
## Useage: ./observium-client.sh <Community> <Contact Email>
## check if root
if [ $(whoami) != "root" ]; then
echo "You need to run this script as root."
echo "Use 'sudo ./observium-client.sh' then enter your password when prompted."
exit 1
@drolfe
drolfe / deb-firstboot-script.sh
Last active December 19, 2017 03:47
FirstBoot Script
#!/bin/bash
#Values set by foreman finish scritp..
H_NAME=
OS_NAME=
OS_MAJOR=
OS_MINOR=
IPV4=
NMASK=
GWAY=
@drolfe
drolfe / Calamari_install_Ubuntu14.04.sh
Last active August 7, 2017 09:10
Ceph Calamari Install ubuntu 14.04
# note this isn't a script but just a list of bash commands to run, I may turn this into a scrpt later
echo "deb http://download.ceph.com/calamari/1.3.1/ubuntu/trusty/ trusty main" > /etc/apt/sources.list.d/calamari.list
gpg --keyserver keyserver.ubuntu.com --recv-key 460F3994 && gpg -a --export 460F3994 | sudo apt-key add -
echo "deb http://ppa.launchpad.net/saltstack/salt2014-7/ubuntu trusty main" > /etc/apt/sources.list.d/saltstack-salt-trusty.list
gpg --keyserver keyserver.ubuntu.com --recv-key 0E27C0A6 && gpg -a --export 0E27C0A6 | sudo apt-key add -
@drolfe
drolfe / install.sh
Created December 19, 2016 12:54
ELK 5.1 ubuntu16 install
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
sudo apt-get install apt-transport-https
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y install oracle-java8-installer
sudo apt-get install elasticsearch
sudo /bin/systemctl daemon-reload
@drolfe
drolfe / es-query.rb
Created June 13, 2016 17:18
Query ElasticSearch via Ruby
#!/usr/bin/ruby
require 'json'
require 'elasticsearch'
#My complex ES query, Basically detects port scanning via our network sflow data
json_search = '{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*",
@drolfe
drolfe / Solaris_Comstar_LU_view.sh
Last active April 26, 2016 14:35
Solaris Comstar LU Views
stmfadm create-hg blade07
stmfadm add-hg-member -g blade07 eui.0002c9030055e715 eui.0002c9030055e716
root@ssd-san:~# stmfadm list-hg -v
Host Group: blade07
Member: eui.0002C9030055E716
Member: eui.0002C9030055E715
root@ssd-san:~#