Skip to content

Instantly share code, notes, and snippets.

@briantissue
briantissue / gist:1c8b15c80d472c41ffa6
Created January 27, 2015 21:23
Migrate Linux UIDs and GIDS to new box excluded system IDs
#!/bin/bash
#This shell script is moving uids and gids to new server without grabbing the system accounts
#The one caveat with this script is confirming the UID start limit and upper limit for your distro
#This can be confirmed by checking the /etc/libuser.conf it is denoted there in RHEL distros
#This script is to be ran from the /tmp directory as denoted in BASE
#This script is valid for 6.5 RHEL and down as is. Change UGIDLIMIT to 1000 for v7.0
#Create directory for migration files
BASE=/tmp
if [ -d ${BASE}/move ]
@briantissue
briantissue / gist:0925058707641841f18a
Created January 24, 2015 02:30
Ubuntu TFTP Setup for Cisco Devices
# Bash Script for setting up tftpd-hpa for cisco devices
# Run As Root
# Check if root
if [ "$(whoami)" != "root" ]; then
echo "Not running as root. Exiting..."
exit 0
else
echo "Running as root. Good"
fi
@briantissue
briantissue / gist:066587871f3abe3e6b77
Last active August 29, 2015 14:13
Check Your Server Disks---Over 90% Utilization
#!/bin/bash
#For checking disk space on our servers
#Clear Yesterday's Log
#Checking for root brought to you by Brad Arnold
if [ "$(whoami)" != "root" ]; then
echo "Not running as root. Exiting..."
echo "Please use sudo -s then run this script again as root."