From 332ad7d6c5c4312588276e8215358610f598a69c Mon Sep 17 00:00:00 2001
From: Matthew Owens <matthew@owens.tech>
Date: Fri, 10 Dec 2021 16:13:01 +0000
Subject: [PATCH] added more scripts

---
 abyss-module | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 fvps         |  1 +
 mkv2mp4      |  4 ++++
 print        |  3 +++
 proj         | 36 ++++++++++++++++++++++++++++++++
 webmify      |  6 ++++++
 6 files changed, 109 insertions(+)
 create mode 100755 abyss-module
 create mode 100755 fvps
 create mode 100755 mkv2mp4
 create mode 100755 print
 create mode 100755 proj
 create mode 100755 webmify

diff --git a/abyss-module b/abyss-module
new file mode 100755
index 0000000..f23a428
--- /dev/null
+++ b/abyss-module
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+[ -z $GIT_DIR ] && GIT_DIR=~/git
+ORG=AbyssalThistle
+MODULE_NAME=$1
+ME=${0##*/}
+
+function usage
+{
+	echo "usage: $ME <module_name>"
+}
+
+function sanity_check
+{
+	prereqs=(gh git)
+	which ${prereqs[*]} > /dev/null 2>&1
+
+	if [ $? -ne 0 ]; then
+		echo "error: env is insane, ensure the following are installed: ${prereqs[*]}"
+		exit 1
+	fi
+
+	if [ -z $MODULE_NAME ]; then
+		echo "error: no module name"
+		usage
+		exit 1
+	fi
+
+	gh repo view $ORG/module-template > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "error: no access to $ORG/module-template on github!"
+		exit 1
+	fi
+
+	gh repo view $ORG/test-template > /dev/null 2>&1
+	if [ $? -ne 0 ]; then
+		echo "error: no access to $ORG/test-template on github!"
+		exit 1
+	fi
+}
+
+sanity_check
+
+ABYSS_DIR=$GIT_DIR/$ORG
+cd $ABYSS_DIR
+
+gh repo create $ORG/$MODULE_NAME --template $ORG/module-template --private -y
+gh repo create $ORG/$MODULE_NAME-test --template $ORG/test-template --private -y
+# removing the local test dir, since we'll add it as a submodule later
+rm -rf $MODULE_NAME-test
+
+cd $MODULE_NAME
+./init_module.sh $MODULE_NAME
+git submodule add git@github.com:$ORG/$MODULE_NAME-test
+cd $MODULE_NAME-test
+./init_tests.sh $MODULE_NAME
+cd ..
+git commit -am "added $MODULE_NAME-test submodule"
+git push
diff --git a/fvps b/fvps
new file mode 100755
index 0000000..6c34994
--- /dev/null
+++ b/fvps
@@ -0,0 +1 @@
+ssh ec2-user@moradinsfoundry.co.uk
diff --git a/mkv2mp4 b/mkv2mp4
new file mode 100755
index 0000000..6444268
--- /dev/null
+++ b/mkv2mp4
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+#ffmpeg -i $1 -c copy $2
+ffmpeg -i $1 -filter:v fps=fps=20 $2
diff --git a/print b/print
new file mode 100755
index 0000000..14b6532
--- /dev/null
+++ b/print
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+lp -d HP_ENVY_4500_series_58B5E5_ $1
diff --git a/proj b/proj
new file mode 100755
index 0000000..a935215
--- /dev/null
+++ b/proj
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+Usage()
+{
+	echo "Usage: $0 [project name]"
+}
+
+if [ $# -ne 1 ]; then
+	Usage
+fi
+
+folderPath=$(find $HOME/git/ -maxdepth 3 -type d -name $1)
+folderCount=$(find $HOME/git/ -maxdepth 3 -type d -name $1 | wc -l)
+
+if [ $folderCount -gt 1 ]; then
+	echo "err: multiple possible projects found for '$1'"
+	echo $folderPath
+	exit
+elif [ $folderCount -eq 0 ]; then
+	echo "err: no possible projects found for '$1'"
+	exit
+fi
+ 
+# is the session already running?
+if [ $(tmux ls | grep $1 | wc  -l) -eq 1 ]; then
+	tmux new-session -A -s $1
+	exit
+else
+	cd $folderPath
+	tmux new-session -d -s $1
+	tmux rename-window src
+	tmux send-keys "cd src;clear" ENTER
+	tmux new-window -n build -c $folderPath
+	tmux select-window -t src
+	tmux -2 attach-session -d
+fi
diff --git a/webmify b/webmify
new file mode 100755
index 0000000..e99a62f
--- /dev/null
+++ b/webmify
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+#ffmpeg -i 2021-05-25_12-29-38.mkv -q:v 10 -crf 19 -b:v 1M -vcodec libvpx -acodec libvorbis door.webm
+#ffmpeg -i $1 -q:v 10 -crf 19 -b:v 2M -vcodec libvpx -acodec libvorbis $2
+
+ffmpeg -i $1 -vcodec libvpx -acodec libvorbis $2
-- 
2.20.1