From a167f0a5de32d822f20955358315431d2edf6f7e Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Thu, 29 Dec 2022 17:12:56 -0500 Subject: Added some new scripts --- .local/bin/add2rss | 28 ++++++++++++++++++++++++++++ .local/bin/days2finals.py | 19 +++++++++++++++++++ .local/bin/html2pdf | 1 + .local/bin/lower | 5 +++++ .local/bin/money | Bin 0 -> 5030208 bytes .local/bin/money.py | 22 ++++++++++++++++++++++ .local/bin/physScore | Bin 0 -> 5030208 bytes .local/bin/upper | 5 +++++ .local/bin/ytrss | 15 +++++++++++++++ 9 files changed, 95 insertions(+) create mode 100755 .local/bin/add2rss create mode 100755 .local/bin/days2finals.py create mode 120000 .local/bin/html2pdf create mode 100755 .local/bin/lower create mode 100755 .local/bin/money create mode 100755 .local/bin/money.py create mode 100755 .local/bin/physScore create mode 100755 .local/bin/upper create mode 100755 .local/bin/ytrss diff --git a/.local/bin/add2rss b/.local/bin/add2rss new file mode 100755 index 0000000..cf9ea73 --- /dev/null +++ b/.local/bin/add2rss @@ -0,0 +1,28 @@ +#!/bin/sh + +RSSFILE=~/.config/newsboat/urls + +if test -n "$1"; +then + URL=$1 +elif test ! -t 0; +then + URL=$(cat < /dev/stdin) +else + echo "add2rss: No Input" + exit +fi + +if test -n "$2"; +then + URL="$URL \"$2\"" +fi + +if test -n "$(grep $URL $RSSFILE)"; +then + echo "add2rss: You already added this feed" +else + echo "$URL" >> $RSSFILE + echo "add2rss: Added" +fi + diff --git a/.local/bin/days2finals.py b/.local/bin/days2finals.py new file mode 100755 index 0000000..0e5a0fe --- /dev/null +++ b/.local/bin/days2finals.py @@ -0,0 +1,19 @@ +import datetime +now = datetime.datetime.now() + +finalsDate = datetime.datetime(2022, 12, 12, 0, 0, 0, 0) +daysLeft = finalsDate - now + +weeks = daysLeft.days // 7 +days = daysLeft.days % 7 +minutes = daysLeft.seconds // 60 +hours = minutes // 60 +minutes %= 60 +seconds = daysLeft.seconds % 60 + +output = f"{weeks} weeks {days} days {hours} hours {minutes} minutes and {seconds} seconds until finals week" + +if (weeks <=0): + output = "FINALS WEEK" + +print(output) diff --git a/.local/bin/html2pdf b/.local/bin/html2pdf new file mode 120000 index 0000000..aae33e2 --- /dev/null +++ b/.local/bin/html2pdf @@ -0,0 +1 @@ +/Users/jmm/Documents/Projects/Experiments/html2pdf/convert.sh \ No newline at end of file diff --git a/.local/bin/lower b/.local/bin/lower new file mode 100755 index 0000000..3c651f5 --- /dev/null +++ b/.local/bin/lower @@ -0,0 +1,5 @@ +#!/usr/local/bin/python3 +while True: + userIn = input("> ").lower() + if userIn == "exit": break + print(userIn) diff --git a/.local/bin/money b/.local/bin/money new file mode 100755 index 0000000..5d3c65c Binary files /dev/null and b/.local/bin/money differ diff --git a/.local/bin/money.py b/.local/bin/money.py new file mode 100755 index 0000000..4a36437 --- /dev/null +++ b/.local/bin/money.py @@ -0,0 +1,22 @@ +#!/usr/local/bin/python3 + +hours = int(input("Enter Hours Worked Per Week: ")) +wage = float(input("Enter Wage: ")) +tax = .13 + +checking = (hours * 4) * wage +checking -= checking * tax +savings = checking / 2 +checking -= savings + +miles = 830 +mpg = float(input("Enter Gas Milage: ")) +gasPrice = float(input("Enter Gas Price: ")) + +gas = (miles / mpg) * gasPrice + +expenses = gas + 10 + +checking -= expenses + +print(f"${checking+savings:,.2f} left over total\n${checking:,.2f} left over for checking each month\n${savings:,.2f} left over for savings each month\nCost of gas: ${gas:,.2f}") diff --git a/.local/bin/physScore b/.local/bin/physScore new file mode 100755 index 0000000..8337b8a Binary files /dev/null and b/.local/bin/physScore differ diff --git a/.local/bin/upper b/.local/bin/upper new file mode 100755 index 0000000..e3d8d45 --- /dev/null +++ b/.local/bin/upper @@ -0,0 +1,5 @@ +#!/usr/local/bin/python3 +while True: + userIn = input("> ").upper() + if userIn == "EXIT": break + print(userIn) diff --git a/.local/bin/ytrss b/.local/bin/ytrss new file mode 100755 index 0000000..8539b18 --- /dev/null +++ b/.local/bin/ytrss @@ -0,0 +1,15 @@ +#!/bin/sh + +if test -n "$1"; +then + id=$1 +elif test ! -t 0; +then + id=$(cat < /dev/stdin) +else + echo "ytrss: No Input" + exit +fi + +echo "https://www.youtube.com/feeds/videos.xml?channel_id="$id + -- cgit v1.2.3