Repo dedicated to scripts that i feel are useful for daily scripting. A lot of things are specific to my current work. But the goal behidn this remove is to take that ideas and style and put it in one location for me to refer back to in future.
Files:
ZSH profile, mainly for back up but has tiny things that come handy.
List of functions I found helpful in a day to day uses.
- 1.) gitupdate - Update fork repo
- 2.) changeorg - Change chef orgs
- 3.) gitstash - Drop unwanted files
A flag based script used to write alias and maps client VPN IP to hostnames and FQDN to be used for scripting.
- Edit /etc/hosts file to add FQDN, VPN IP and hostname
- Add Aliases to quickly ssh into nodes Only supports for etsops | -f ../muns_mi.report.csv
- Delete alias and /etc/hosts entries | -w
- Delete backup files | -w -e
- Check what shell user has installed
Flags | Outcome | Example |
---|---|---|
-f, -p | alias | -f ../muns_mi.report.csv -p $keys/muns_mi/etsops.pem |
-f, -p, -e | hosts and alias | -f ../muns_mi.report.csv -p ../etsops.pem -e |
-w | delete alias | -w munsmi |
-w, -e | delete alias and hosts | -w munsmi -h |
-d | delete hosts backup | -d |
-f, -p, -w, -d. -e | Loop | -f ../muns_mi.report.csv -p $keys/muns_mi/etsops.pem -w munsmi -d -e |
Flags | Outcome |
---|---|
-h | Help |
-f | Client Csv File |
-p | Client pem File |
-e | Must select this option to edit /etc/hosts Write to /etc/hosts file for vpn ip to hostname mapping |
-w | Delete Alias and hosts *must match hostname format |
-d | Delete backup copies of hosts files |
chmod +x hosts.sh
Usage: ./hosts.sh [-f <csv file> ] [-p <client.pem> ] [-w <clientmnemonics> ] -d
Output:
./hosts.sh -f ../muns_mi.report.csv -p ../etsops.pem -e
Password:
Sorry, try again.
Password:
7.204.108.2 munsmiprd1dns201 munsmiprd1dns201.muns-mi.cernercloud.net - Added
Writing alias munsmiprd1dns201
7.204.108.3 munsmiprd2dns202 munsmiprd2dns202.muns-mi.cernercloud.net - Added
7.204.108.2 munsmiprd1dns201 munsmiprd1dns201.muns-mi.cernercloud.net - Exists
Alias munsmiprd1dns201 already exists
A menu driven script to close all app that I don't need after work.
- Kills application using signal 15 or 9
- Quit one application at a time or all of them
- Confirmation to kill or not
- Refresh list without quiting script
Apps | Added |
---|---|
Microsoft Lync | ✔️ |
Microsoft Onenote | ✔️ |
Citrix Receiver | ✔️ |
iTerm2 | ✔️ |
Microsoft Teams | ✔️ |
Sublime Text | ✖️ |
Slack | ✖️ |
Microsoft Outlook | ✖️ |
chmod +x killapp.sh
Usage: ./killapp.sh
Output:
===================================
The Killing Machine - Choose Wisely
Choose one of the options below
-----------------------------------
(Q) Quit
(R) Refresh list
(A) All Application
(1) Microsoft Lync
(2) Microsoft Teams
(3) iTerm
Select an application to close:
Thank you for using the killing machine!