Compare commits
10
Commits
ea65984527
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69f76dd54e | ||
|
|
276a6223a3 | ||
|
|
92d9e3fa1a | ||
|
|
526efc2255 | ||
|
|
d81053d31c | ||
|
|
2d965f8f2c | ||
|
|
62c0060617 | ||
|
|
0c798d9dc7 | ||
|
|
ff6ee95815 | ||
|
|
2d5302f56d |
No files matched your search
@@ -1,2 +1,11 @@
|
|||||||
# bash_scripts
|
### diffweb.sh
|
||||||
A collection of Bash Scripts
|
`Checks a website for changes.`
|
||||||
|
|
||||||
|
### rotate.sh
|
||||||
|
`Rotate a screen in Linux.`
|
||||||
|
|
||||||
|
### uapay.sh
|
||||||
|
`A command-line interface to UofA employee payroll data.`
|
||||||
|
|
||||||
|
### crex.sh
|
||||||
|
`Query a domain name's creation date and expiration date.`
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Description: Query Domain Name Creation and Expiration dates.
|
||||||
|
# Usage: crex.sh <domain.tld>
|
||||||
|
# Author: Justin Oros
|
||||||
|
# Source: https://github.com/JustinOros
|
||||||
|
|
||||||
|
# Dependency Checks
|
||||||
|
TARGET_FILE='/usr/bin/whois'
|
||||||
|
if [ ! -f "$TARGET_FILE" ]
|
||||||
|
then
|
||||||
|
echo "$TARGET_FILE does not exist."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_FILE='/usr/bin/grep'
|
||||||
|
if [ ! -f "$TARGET_FILE" ]
|
||||||
|
then
|
||||||
|
echo "$TARGET_FILE does not exist."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_FILE='/usr/bin/awk'
|
||||||
|
if [ ! -f "$TARGET_FILE" ]
|
||||||
|
then
|
||||||
|
echo "$TARGET_FILE does not exist."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGET_FILE='/usr/bin/head'
|
||||||
|
if [ ! -f "$TARGET_FILE" ]
|
||||||
|
then
|
||||||
|
echo "$TARGET_FILE does not exist."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# User Input
|
||||||
|
DOMAIN_NAME=$1
|
||||||
|
|
||||||
|
# Get Creation Date
|
||||||
|
CREATION_DATE=$(whois $DOMAIN_NAME | grep 'Creation' | awk '{print $3;}' | head -n 1)
|
||||||
|
|
||||||
|
# Get Expiration Date
|
||||||
|
EXPIRATION_DATE=$(whois $DOMAIN_NAME | grep 'Expiration' | awk '{print $5;}')
|
||||||
|
|
||||||
|
# Output Results
|
||||||
|
echo '-'
|
||||||
|
echo 'Domain:' $DOMAIN_NAME
|
||||||
|
echo 'Creation:' $CREATION_DATE
|
||||||
|
echo 'Expiration:' $EXPIRATION_DATE
|
||||||
|
echo '-'
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Description: Rotate screen clockwise in a complete circle
|
||||||
# rotate all screens clockwise in a complete circle
|
# Usage: rotate.sh
|
||||||
# by Justin Oros
|
# Author: Justin Oros
|
||||||
|
# Source: https://github.com/JustinOros
|
||||||
|
|
||||||
screen_types="VGA HDMI DP eDP"
|
screen_types="VGA HDMI DP eDP"
|
||||||
screen_rotations="right inverted left normal"
|
screen_rotations="right inverted left normal"
|
||||||
@@ -18,7 +19,7 @@ rotate() {
|
|||||||
do
|
do
|
||||||
for screen in 0 .. $screens
|
for screen in 0 .. $screens
|
||||||
do
|
do
|
||||||
xrandr --output $screen_type-$screen --rotate $screen_rotation > /dev/null 2>&1
|
xrandr -o $screen_rotation > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
sleep $sleep_time
|
sleep $sleep_time
|
||||||
|
|||||||
@@ -1,59 +1,62 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#################################################
|
# Description: Query UofA employee payroll data via CLI
|
||||||
# Query Univeristy of Arizona payroll information
|
# Usage: uapay.sh <first name> <last name>
|
||||||
# Written by Justin Oros
|
# Author: Justin Oros
|
||||||
# Usage: uapay.sh FirstName LastName
|
# Source: https://github.com/JustinOros
|
||||||
#################################################
|
|
||||||
|
|
||||||
# Check to see if BASH is installed
|
# BASH present?
|
||||||
{
|
|
||||||
if [ ! -f /bin/bash ]; then
|
if [ ! -f /bin/bash ]; then
|
||||||
echo "Bash not found!"
|
echo "Bash not found!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# Check to see if CURL is installed
|
# CURL present?
|
||||||
{
|
|
||||||
if [ ! -f /usr/bin/curl ]; then
|
if [ ! -f /usr/bin/curl ]; then
|
||||||
echo "Curl not found!"
|
echo "Curl not found!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# Check to see if GREP is intalled
|
# GREP present?
|
||||||
{
|
|
||||||
if [ ! -f /usr/bin/grep ]; then
|
if [ ! -f /usr/bin/grep ]; then
|
||||||
echo "Grep not found!"
|
echo "Grep not found!"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# URL for UA Salaries
|
# UA Payroll URL
|
||||||
uapay_url='https://openpayrolls.com/employee'
|
uapay_url='https://openpayrolls.com/employee'
|
||||||
|
|
||||||
# User Agent
|
# User Agent
|
||||||
uapay_useragent='Chrome/79'
|
uapay_useragent='Chrome/79'
|
||||||
|
|
||||||
# Get Input from User
|
# Get Input
|
||||||
{
|
|
||||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||||
echo -e "\nUsage: uapay.sh FirstName LastName\n"
|
echo -e "\nUsage: uapay.sh FirstName LastName\n"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
uapay_name=$1-$2
|
for i in "$@"
|
||||||
|
do
|
||||||
|
uapay_name="$@"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
# Format Input
|
||||||
|
uapay_formatted_name=${uapay_name// /-}-4329
|
||||||
|
|
||||||
# Grep Filter
|
# Grep Filter
|
||||||
uapay_filter="and a pay of"
|
uapay_filter="and a pay of"
|
||||||
|
|
||||||
# Query URL
|
# Query URL
|
||||||
uapay_output=$(curl -s -k --user-agent $uapay_useragent $uapay_url/$uapay_name-4329 | grep "$uapay_filter")
|
uapay_query=$(curl -s -k --user-agent $uapay_useragent $uapay_url/$uapay_formatted_name | grep "$uapay_filter")
|
||||||
|
|
||||||
# Format output
|
# Check Results
|
||||||
#echo ${uapay_output/<\/p>/}
|
if [ -z "$uapay_query" ]; then
|
||||||
uapay_output=${uapay_output/\<p class=\"lead font-16 font-weight-400\"\>/}
|
echo -e "\n$uapay_name was not found.\n"
|
||||||
uapay_output=${uapay_output/\<\/p\>/}
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n$uapay_output\n"
|
# Format Output
|
||||||
|
uapay_query=${uapay_query/\<p class=\"lead font-16 font-weight-400\"\>/}
|
||||||
|
uapay_query=${uapay_query/\<\/p\>/}
|
||||||
|
|
||||||
|
# Print Output
|
||||||
|
echo -e "\n$uapay_query\n"
|
||||||
Reference in new issue
Block a user