Skip to content

Instantly share code, notes, and snippets.

Avatar

David Wittman DavidWittman

View GitHub Profile
@DavidWittman
DavidWittman / check_peer_interfaces.py
Last active Feb 14, 2017
Checks to see if two interfaces are on the same network on Linux. Useful when bonding interfaces.
View check_peer_interfaces.py
#!/usr/bin/env python
# check_peer_interfaces.py
# Author: David Wittman <david@wittman.com>
#
# Checks to see if two interfaces are on the same network by sending a
# unique broadcast packet out of the first interface and listening for that
# packet on the second interface.
#
# Assumes that you're running a Linux variant, and that both interfaces
@DavidWittman
DavidWittman / stunnel-chroot-reload.md
Created Mar 25, 2015
Reloading stunnel configurations when in a chroot
View stunnel-chroot-reload.md

Reloading stunnel configurations when in a chroot

Example stunnel config

# /etc/stunnel/stunnel.conf
cert = /etc/stunnel/cert.pem
sslVersion = TLSv1 TLSv1.1 TLSv1.2

chroot = /var/run/stunnel/
@DavidWittman
DavidWittman / naglite.go
Last active Aug 29, 2015
Status.dat parser for Icinga in Go. I'm sorry.
View naglite.go
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"os"
"strconv"
"strings"
@DavidWittman
DavidWittman / supermicro-psblock-fix.expect
Last active Oct 25, 2018
This expect script secures SuperMicro IPMI implementations which are vulnerable to viewing the IPMI password in plaintext on port 49152.
View supermicro-psblock-fix.expect
#!/usr/bin/expect -f
# This script secures SuperMicro IPMI implementations which are vulnerable
# to viewing the IPMI password in plaintext on port 49152. It does this by
# using the shell available in some SuperMicro BMCs to drop traffic to port
# 49152 in iptables.
#
# See http://blog.cari.net/carisirt-yet-another-bmc-vulnerability-and-some-added-extras/
# for more details on the vulnerability.
#
@DavidWittman
DavidWittman / supermicro-bmc-reset.sh
Created Sep 11, 2014
Issues a reset of the SuperMicro BMC via the web interface
View supermicro-bmc-reset.sh
#!/usr/bin/env bash
# Issues a reset of the SuperMicro BMC via the web interface
#
# usage: supermicro-bmc-reset.sh <ipmi-host>
# e.g.: supermicro-bmc-reset.sh 10.0.0.1
#
set -x
View ansible-lxc.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Kevin Carter <kevin.carter@rackspace.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@DavidWittman
DavidWittman / supermicro-ipmi-mac-address.md
Last active May 3, 2020
Pull the LAN1/eth0 MAC address from SuperMicro IPMI
View supermicro-ipmi-mac-address.md

You can find the MAC address for LAN1/eth0 (not the BMC MAC) via the SuperMicro IPMI interface by running the following command:

$ ipmitool -U $IPMI_USER -P $IPMI_PASS -H $IPMI_HOST raw 0x30 0x21 | tail -c 18

The eth0 MAC address will be output in this format:

00 25 90 f0 be ef
@DavidWittman
DavidWittman / hipchat-relay.go
Last active May 10, 2016
Room-to-room message relay for Hipchat, with support across accounts.
View hipchat-relay.go
package main
import (
"flag"
"fmt"
"github.com/andybons/hipchat"
"log"
"os"
"path"
"strings"
View coreos.ipxe
#!ipxe
set base-url http://beta.release.core-os.net/amd64-usr/current
kernel ${base-url}/coreos_production_pxe.vmlinuz sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAYQC2PxAKTLdczK9+RNsGGPsz0eC2pBlydBEcrbI7LSfiN7Bo5hQQVjki+Xpnp8EEYKpzu6eakL8MJj3E28wT/vNklT1KyMZrXnVhtsmOtBKKG/++odpaavdW2/AU0l7RZiE= coreos pxe demo"
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
boot
View supermicro-mount-iso.sh
#!/usr/bin/env bash
# Loads and mounts an ISO over SMB via the
# SuperMicro IPMI web interface
#
# usage: supermicro-mount-iso.sh <ipmi-host> <smb-host> <path>
# e.g.: supermicro-mount-iso.sh 10.0.0.1 10.0.0.2 '\foo\bar\windows.iso'
set -x
You can’t perform that action at this time.