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 | |
#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." |
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 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 |
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 | |
#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 ] |
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 | |
# Daily report of IP addresses that have hit the server | |
# This script will filter out the private IP addresses | |
# You could use this script to generate a report for white-lists; or auditing purposes | |
# Check if root | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
exit 0 | |
else |
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 | |
read -p "Enter UserID: " userid | |
touch find-$userid.txt | |
for HOST in `cat ../server_list|grep -v ^#`; do echo ${HOST}; ssh ${HOST} "hostname;cat /etc/passwd | grep -i $userid"; echo ""; done >> find-$ | |
for HOST in `cat ../server_list2|grep -v ^#`; do echo ${HOST}; ssh ${HOST} "hostname;cat /etc/passwd |grep -i $userid"; echo ""; done >$ | |
read -p "Press [Enter] key to view the number of servers $userid resides..." | |
cat find-$userid.txt | grep -i $userid | wc -l | |
read -p "End of script..." |
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 | |
# Check if root | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
exit 0 | |
else | |
echo "Editing and Reviewing UFW Firewall Entries" | |
fi | |
sudo ufw status numbered |
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 | |
# Script by Brian Tissue | |
# Used to assign static IP addresses to LXC containers | |
LXCPATH='/var/lib/lxc' | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. I told you that you needed to be root, come on man..." | |
echo "Please use su -s then run this script again as root." | |
exit 0 |
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 | |
# Used for Airgapped Ubuntu Servers; downloads package and required dependencies | |
# Just SCP them over to the server that needs them. Ensure OS/Kernel is the same on both. | |
# Feel free to comment if you have a suggestion to improve the script | |
read -p "Please enter the package name you would like to look for: " packagesearch | |
apt-cache search "$packagesearch" | |
read -p "Please enter the verified package name you would like to download: " package |
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
PS1="\n\[\e[1;30m\][$$:$PPID - \j:\!\[\e[1;30m\]]\[\e[0;36m\] \T \[\e[1;30m\][\[\e[1;34m\]\u@\H\[\e[1;30m\]:\[\e[0;37m\]${SSH_TTY:-o} \[\e[0;32m\]+${SHLVL}\[\e[1;30m\]] \[\e[1;37m\]\w\[\e[0;37m\] \n\$ " |
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 | |
# Program name: monitor-website.sh | |
# Written by Brian Tissue August 30th 2018 | |
if [ "$(whoami)" != "root" ]; then | |
echo "Not running as root. Exiting..." | |
echo "Please use sudo -s then run this script again as root." | |
exit 0 | |
else | |
echo "Running as root. Good" |
OlderNewer