Skip to content

Instantly share code, notes, and snippets.

View heyseus1's full-sized avatar

Matthew M. heyseus1

View GitHub Profile
@heyseus1
heyseus1 / sysinfo.sh
Last active January 17, 2025 05:32
linux info gathering script
#!/bin/bash
# Linux host info script
# Matthew Morcaldi 2015
# DONUTS version 0.2.8 last update (9/18/2015)
# w00t be in r00t
# Config ------------------------------------------------
outfile="${HOSTNAME}_linux_info.txt"
#--------------------------------------------------------
@heyseus1
heyseus1 / Puppet.sh
Last active August 29, 2015 14:19
Puppet Install for ubuntu OR centOS 6.x
#!/usr/bin/env bash
#
# This bootstraps Puppet on Ubuntu or CentOS 6.x.
#
set -e
checkroot() {
if [ $UID -ne 0 ] ; then
echo "User has insufficient privilege."
exit 4
@heyseus1
heyseus1 / gist:f0953a5529350ad57e7e
Last active August 29, 2015 14:21
perl one liner that removes customer data from email logs
sudo grep @ mail.log | perl -p -e 's/ warning: header .*\[/header=<--removed-->,/g;s/from=<.+?@/from=<--removed-->@/g; s/to=<.+?@/to=<--removed-->@/g; s/<.+?com>/<--removed-->.com/g'
@heyseus1
heyseus1 / monkey
Created May 27, 2015 22:50
ruby monkey loop
ruby -e 'C=`stty size`.scan(/\d+/)[1].to_i;S=["2743".to_i(16)].pack("U*");a={};loop{a[rand(C)]=0;a.each{|x,o|;a[x]+=1;print "\ 🙈 🙉 🙊"};$stdout.flush;sleep 0.1}'
@heyseus1
heyseus1 / .bash_profile
Created June 23, 2015 16:43
my bash_profile MACOSx
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
#Bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
@heyseus1
heyseus1 / Firmware.sh
Created May 20, 2016 21:43
simple script that gathers firmware versions of RAID, NIC, IDRAC/ILO, and BIOS
#!/bin/bash
# FIRMWARE ver.
# w00t be in r00t
header() {
echo ''
echo -e "----------------------"
echo -e " [*] $title "
echo -e "----------------------"
@heyseus1
heyseus1 / xmit_hash.sh
Created July 14, 2016 16:47
change bond0 hash policy to xmit in centos
#stop services
#x27 is single quote character
#start services
xmit_hash_policy
xmit_hash_policy() {
if egrep '^BONDING_OPTS.*mode=802.3ad' /etc/sysconfig/network-scripts/ifcfg-bond0 > /dev/null
then
echo modifying bonding xmit_hash_policy
perl -pi.bak -e 's/^(BONDING_OPTS=.*802.3ad.*)("|\x27)$/$1 xmit_hash_policy=layer3+4$2/' /etc/sysconfig/network-scripts/ifcfg-bond0
#!/bin/bash
# Config ------------------------------------------------
outfile="${HOSTNAME}_Net_io_config.txt"
#--------------------------------------------------------
checkroot() {
if [ $UID -ne 0 ] ; then
echo "User has insufficient privilege."
exit 4
#!/bin/bash
# Config ------------------------------------------------
outfile="${HOSTNAME}_audit.txt"
#--------------------------------------------------------
checkroot() {
if [ $UID -ne 0 ] ; then
echo "User has insufficient privilege."
exit 4
@heyseus1
heyseus1 / dns-add.sh
Created July 14, 2016 17:02
while loop with multiple variables specifically for dns add
while read -u 3 i; read -u 4 g; do
echo "$i"
echo "$g"
dns-add-record --zone=dr.wd5.wd --record="$i" --type=CNAME --record-value="$g"
done 3< list.csv 4< list2.csv