Skip to content

Instantly share code, notes, and snippets.

View smbambling's full-sized avatar

Steven Bambling smbambling

View GitHub Profile
@smbambling
smbambling / change-idrac-password.rst
Last active October 27, 2023 08:56 — forked from andrewspiers/change-idrac-password.rst
Change iDRAC password using OpenManage

How to change an iDRAC password using Racadm for a Dell R720 and similar servers.

TLDR:

#  racadm config -g cfgUserAdmin -o cfgUserAdminPassword -i 2 <newpassword>

This guide assumes you have OpenManage installed. It was tested with the following version of OpenManage:

@smbambling
smbambling / change_user_uid_gid.sh
Created February 11, 2016 12:48
Change User/Primary Group UID and GID
#!/usr/bin/env bash
usage() {
cat <<-EOF
usage: ${0} -l <login> -u <new uid> [-g <new gid>]
-h this help screen
-l login account login account name
-p primary group for account login
-u uid new UID to assign to account
-g new GID to assign to account group
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@smbambling
smbambling / command_chech.sh
Created July 7, 2017 12:41
Bash Script using a function to test to make sure commands are available. Allows to test for multiple versions of a command
#!/usr/bin/env bash
cmd_list=(
"virtualenv-2.7 virtualenv-2.5 virtualenv"
"docker docker.io"
)
# Function to check if referenced command exists
cmd_exists() {
if [ $# -eq 0 ]; then
######################################################################
######################################################################
# Managed by Puppet
#
# NOTE: Changes made to this file will be
# overwritten during the next update, default: 30 min
######################################################################
######################################################################
# Bash only checks the first word of a command for an alias,
#!/usr/bin/env bash
for item; do
entries=$(dig ${item} +short ANY)
if [ -z "${entries}" ]; then
echo -e "No A or AAAA entries returned for ${item}"
else
for entry in ${entries}; do
reverse_entry=$(dig +short -x "${entry}")
if [ -z "${reverse_entry}" ]; then

SNMP Tips

Loading MIBs

Net-SNMP loads MIBs from two locations by default :

$HOME/.snmp/mibs
/usr/local/share/snmp/mibs
@smbambling
smbambling / create_groups.pp
Last active October 16, 2016 07:44
Example Puppet Class to create PE Groups automatically from Role Classes
class node_manager::create_groups {
$environments = split(fetch_environments(), ',')
$environments.each | $env | {
$classes = split(fetch_resource_types("production", "^role::"), ',')
$classes.each | $class | {
#!/bin/sh
# This file is managed by Puppet.
# Any changes will be lost.
# This is the rsync script to manage <%= @repository %>
# Logging
DATE=`/bin/date +%Y-%m-%d`
CONFFILE='/etc/yum.repos.d/<%= @repository -%>.repo'
OUTDIR='<%= @log_directory %>'
[ -d $OUTDIR ] || mkdir -p $OUTDIR
# == Overview: Configure the Master Mirror for a site
#
# == Requirements: N/A
#
# == Monitoring: Apache
#
# == Notes:
#
# The repositories will be pulled down based off a hash for all crons.
#