This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Source this file | |
# Your Zenoss server settings. | |
ZENOSS_URL="http://localhost:8080" | |
ZENOSS_USERNAME="admin" | |
ZENOSS_PASSWORD="zenoss" | |
# Generic call to make Zenoss JSON API calls easier on the shell. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub update_mongodb { | |
if (!Opts::option_is_set('noupdate')) { | |
my $client = MongoDB::MongoClient->new(host => $mongohost, port => $mongoport); | |
my $database = $client->get_database( $mongodatabase ); | |
my $db = $database->get_collection( $mongocollection ); | |
my $mongohash = \%hosthash; | |
my $mongoresult = $db->update({ "hostname" => $hosthash{'hostname'} }, $mongohash, { "upsert" => 1} ); | |
print $mongoresult; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#keep or delete? | |
function kod() | |
{ | |
ls -l $@ | |
echo "Keep (k) or Delete (d)?" | |
read answer | |
if [ $answer == "k" ]; then | |
echo "Keeping. As you wish." | |
elif [ $answer == "d" ]; then | |
echo "DELETING $@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A lighter graphite for raspberry pi/raspbian wheezy. | |
# For when you don't need memcache/rabbitmq/full uWSGI server/etc | |
# Not fully tested on a clean install. This is just what it *should* take. | |
# Installing supervisor because upstart conflicts with sysvinit | |
aptitude update && aptitude install gcc python-dev python-pip python-cairo python-pysqlite2 supervisor libffi-dev | |
pip install django==1.4.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config t | |
stack disable | |
ip route 0.0.0.0 0.0.0.0 10.50.42.1 | |
vlan 42 | |
router-interface ve 42 | |
int ve 42 | |
ip address 10.50.42.xxx 255.255.255.0 | |
end | |
wr mem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from optparse import OptionParser | |
from subprocess import Popen, PIPE | |
# Requires wmic from Samba project, or here: | |
# http://dev.zenoss.org/trac/browser/tags/zenoss-3.2.1/inst/externallibs | |
wmic = '/vagrant/wmic' | |
parser = OptionParser() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hpilo | |
tempkey = { | |
2 : 'Temp 1', | |
3 : 'Temp 1', | |
4 : '01-Inlet Ambient' | |
} | |
def get_ambient_temp(host, username, password, ilo_version): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc | |
export PROJECT_HOME=$HOME/Sandbox/venvs | |
export WORKON_HOME=$HOME/.venvs | |
source /usr/local/bin/virtualenvwrapper.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bash_profile on OS X (though could be .bashrc on other OS's) | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just basic syntax highlighting for vim | |
set nocompatible | |
syntax on | |
colo peachpuff |
OlderNewer