Skip to content

Instantly share code, notes, and snippets.

@mplinuxgeek
mplinuxgeek / Vagrantfile
Last active November 23, 2020 19:14
Vagrantfile to deploy a VM to ESXi, uses Ansible to provision users and install additional packages, also has conditional statements to alter the configuration for different server types
#
# Fully documented Vagrantfile available
# in the wiki: https://github.com/josenk/vagrant-vmware-esxi/wiki
vm_name = File.basename(Dir.getwd)
vm_cpus = '2'
vm_ram = '4'
if vm_name.include? "web"
vm_ram ='2'
end
@mplinuxgeek
mplinuxgeek / failed_login.sh
Last active August 16, 2018 00:57
Bash script to check for failed ssh logins and email a report.
#!/bin/bash
# Script requirements lastb, diff, touch, whois, mail.
# To succesfully send an email it will require a working mail configuration
# Tested on Ubuntu 16.04
recipient="[email protected]"
if [ ! -f /root/failed ]; then
touch /root/failed
fi
#!/bin/bash
# rev 4 - changes suggested by KownBash https://www.reddit.com/r/bash/comments/5cxfqw/i_wrote_a_simple_video_to_gif_bash_script_thought/da19gjz/
# rev 5 - made the script more verbose
# rev 6 - fixed an issue with a variable not displaying correctly
# rev 7 - added option to change dither level
# rev 8 - rewrote usage function
# Usage function, displays valid arguments
usage() {
echo "Usage: $(basename ${0}) [arguments] inputfile" 1>&2