From: Andrew Lorimer Date: Mon, 21 May 2018 10:37:32 +0000 (+1000) Subject: Add a few files X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/cfdf2d33144cee0d8fa73c4c1de14d9a03b03f14?hp=-c Add a few files --- cfdf2d33144cee0d8fa73c4c1de14d9a03b03f14 diff --git a/avchdtomp4.sh b/avchdtomp4.sh old mode 100644 new mode 100755 index e69de29..ccc5312 --- a/avchdtomp4.sh +++ b/avchdtomp4.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +# AVCHD to MP4 converter +# ffmpeg cmdline taken from http://pvdm.xs4all.nl/wiki/index.php/Convert_an_AVCHD_/_MTS_file_to_MP4_using_ffmpeg + +OPTIND=1 + +src="" +dest="" +verbose=0 + +while getopts s:d:v option; do + case "$opt" in + s) + src=$OPTARG + ;; + d) + dest=$OPTARG + ;; + v) + verbose=1 + ;; + esac +done + + + +IFS=$(echo -en "\n\b"); for i in $(find $src -name '*.MTS'); do ffmpeg -i "$i" -vcodec mpeg4 -b:v 15M -acodec libmp3lame -b:a 192k "${$i%.MTS}.mp4"; done + + diff --git a/duckduckget.sh b/duckduckget.sh new file mode 100755 index 0000000..17c50dc --- /dev/null +++ b/duckduckget.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +# get urls from duckduckgo, then parse them to wget to download + +args=("$@") +search=${args[0]} +filetype=${args[1]} + +set -f +urls=`curl -silent https://duckduckgo.com/html/\?q\=site:www.mash.dept.shef.ac.uk/Resources | +grep 'pdf$' | tr -d ' \t\r' | grep -v '^[0-9]' | awk '{print "http://" $0}'` + +for url in $urls; do + wget --cut-dirs=100 -P /mnt/andrew/literature/mathcentre/ $url +done diff --git a/google.sh b/google.sh new file mode 100755 index 0000000..3861825 --- /dev/null +++ b/google.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +clear +echo "" +echo ".=========================================================." +echo "| |" +echo "| COMMAND LINE GOOGLE SEARCH |" +echo "| --------------------------------------------------- |" +echo "| |" +echo "| Version: 1.0 |" +echo "| Developed by: Rishi Narang |" +echo "| Blog: www.wtfuzz.com |" +echo "| |" +echo "| Usage: ./gocmd.sh |" +echo "| Example: ./gocmd.sh example and test |" +echo "| |" +echo ".=========================================================." +echo "" + +if [ -z $1 ] +then + echo "ERROR: No search string supplied." + echo "USAGE: ./gocmd.sh " + echo "" + echo -n "Anyways for now, supply the search string here: " + read SEARCH +else + SEARCH=$@ +fi + +URL="http://google.com/search?hl=en&safe=off&q=" +STRING=`echo $SEARCH | sed 's/ /%20/g'` +URI="$URL%22$STRING%22" + +lynx -dump $URI > gone.tmp +sed 's/http/\^http/g' gone.tmp | tr -s "^" "\n" | grep http| sed 's/\ .*//g' > gtwo.tmp +rm gone.tmp +sed '/google.com/d' gtwo.tmp > urls +rm gtwo.tmp + +echo "SUCCESS: Extracted `wc -l urls` and listed them in '`pwd`/urls' file for reference." +echo "" +cat urls +echo "" diff --git a/mash.dept.shef.ac.uk/4_5pythagoras.pdf b/mash.dept.shef.ac.uk/4_5pythagoras.pdf new file mode 100644 index 0000000..0eaceaa Binary files /dev/null and b/mash.dept.shef.ac.uk/4_5pythagoras.pdf differ diff --git a/mash.dept.shef.ac.uk/7_1whatisacomplexnumber.pdf b/mash.dept.shef.ac.uk/7_1whatisacomplexnumber.pdf new file mode 100644 index 0000000..1f84a76 Binary files /dev/null and b/mash.dept.shef.ac.uk/7_1whatisacomplexnumber.pdf differ diff --git a/mash.dept.shef.ac.uk/A11fac.pdf b/mash.dept.shef.ac.uk/A11fac.pdf new file mode 100644 index 0000000..761f8c8 Binary files /dev/null and b/mash.dept.shef.ac.uk/A11fac.pdf differ diff --git a/mash.dept.shef.ac.uk/c1_diff1.pdf b/mash.dept.shef.ac.uk/c1_diff1.pdf new file mode 100644 index 0000000..422f2f8 Binary files /dev/null and b/mash.dept.shef.ac.uk/c1_diff1.pdf differ diff --git a/mash.dept.shef.ac.uk/cartesian.pdf b/mash.dept.shef.ac.uk/cartesian.pdf new file mode 100644 index 0000000..709ecc8 Binary files /dev/null and b/mash.dept.shef.ac.uk/cartesian.pdf differ diff --git a/mash.dept.shef.ac.uk/fractionadd.pdf b/mash.dept.shef.ac.uk/fractionadd.pdf new file mode 100644 index 0000000..020f46d Binary files /dev/null and b/mash.dept.shef.ac.uk/fractionadd.pdf differ diff --git a/mash.dept.shef.ac.uk/indices1.pdf b/mash.dept.shef.ac.uk/indices1.pdf new file mode 100644 index 0000000..58bea8d Binary files /dev/null and b/mash.dept.shef.ac.uk/indices1.pdf differ diff --git a/mash.dept.shef.ac.uk/integassum.pdf b/mash.dept.shef.ac.uk/integassum.pdf new file mode 100644 index 0000000..b883f40 Binary files /dev/null and b/mash.dept.shef.ac.uk/integassum.pdf differ diff --git a/mash.dept.shef.ac.uk/integbypartialfrac.pdf b/mash.dept.shef.ac.uk/integbypartialfrac.pdf new file mode 100644 index 0000000..6c0780b Binary files /dev/null and b/mash.dept.shef.ac.uk/integbypartialfrac.pdf differ diff --git a/mash.dept.shef.ac.uk/rearrang_formulas_2.pdf b/mash.dept.shef.ac.uk/rearrang_formulas_2.pdf new file mode 100644 index 0000000..869296a Binary files /dev/null and b/mash.dept.shef.ac.uk/rearrang_formulas_2.pdf differ diff --git a/mash.dept.shef.ac.uk/t4radians.pdf b/mash.dept.shef.ac.uk/t4radians.pdf new file mode 100644 index 0000000..e3f320c Binary files /dev/null and b/mash.dept.shef.ac.uk/t4radians.pdf differ diff --git a/mash.dept.shef.ac.uk/t7cosinerule.pdf b/mash.dept.shef.ac.uk/t7cosinerule.pdf new file mode 100644 index 0000000..f1ee623 Binary files /dev/null and b/mash.dept.shef.ac.uk/t7cosinerule.pdf differ diff --git a/mash.dept.shef.ac.uk/var_stand_deviat_ungroup.pdf b/mash.dept.shef.ac.uk/var_stand_deviat_ungroup.pdf new file mode 100644 index 0000000..5b7aa45 Binary files /dev/null and b/mash.dept.shef.ac.uk/var_stand_deviat_ungroup.pdf differ diff --git a/mash.dept.shef.ac.uk/vectors-scalarprod-tony.pdf b/mash.dept.shef.ac.uk/vectors-scalarprod-tony.pdf new file mode 100644 index 0000000..378b2c3 Binary files /dev/null and b/mash.dept.shef.ac.uk/vectors-scalarprod-tony.pdf differ diff --git a/mash.dept.shef.ac.uk/web-diffxton.pdf b/mash.dept.shef.ac.uk/web-diffxton.pdf new file mode 100644 index 0000000..c19c282 Binary files /dev/null and b/mash.dept.shef.ac.uk/web-diffxton.pdf differ diff --git a/mash.dept.shef.ac.uk/web-factorisingquadratics.pdf b/mash.dept.shef.ac.uk/web-factorisingquadratics.pdf new file mode 100644 index 0000000..f04eb6a Binary files /dev/null and b/mash.dept.shef.ac.uk/web-factorisingquadratics.pdf differ diff --git a/mash.dept.shef.ac.uk/web-integrationTRIGsub-.pdf b/mash.dept.shef.ac.uk/web-integrationTRIGsub-.pdf new file mode 100644 index 0000000..869626f Binary files /dev/null and b/mash.dept.shef.ac.uk/web-integrationTRIGsub-.pdf differ diff --git a/mash.dept.shef.ac.uk/web-polynomialdivision.pdf b/mash.dept.shef.ac.uk/web-polynomialdivision.pdf new file mode 100644 index 0000000..0e317f6 Binary files /dev/null and b/mash.dept.shef.ac.uk/web-polynomialdivision.pdf differ diff --git a/mash.dept.shef.ac.uk/web-theproductrule.pdf b/mash.dept.shef.ac.uk/web-theproductrule.pdf new file mode 100644 index 0000000..a7810c6 Binary files /dev/null and b/mash.dept.shef.ac.uk/web-theproductrule.pdf differ diff --git a/youtube-archive.sh b/youtube-archive.sh new file mode 100644 index 0000000..7d6d3ba --- /dev/null +++ b/youtube-archive.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +YOUTUBEDL='/usr/local/bin/youtube-dl' # Absolute path to youtube-dl executable +ARCHIVE='~/youtube_archive' # Absolute path to archive + +$YOUTUBEDL -U + +archive () { + mkdir -p "$ARCHIVE/$1" + cd "$ARCHIVE/$1" + rmdir -- * 2> /dev/null + rm -fv -- */*.part 2> /dev/null + rm -rf $(find . -printf '%h\n' | sort | uniq -c | while read -r n d ; do [ $n -lt 5 ] && printf '%s\n' "$d" ; done) 2> /dev/null + + $YOUTUBEDL -q --get-id https://youtube.com/$2 | while read VIDEOID; do + if [ -d "$ARCHIVE/$1/$VIDEOID" ]; then + echo -e "\\n\\n$VIDEOID already archived, skipping…\\n\\n" + else + echo -r "\\n\\nArchiving $VIDEOID.\\n\\n" + mkdir "$ARCHIVE/$1/$VIDEOID" + cd "$ARCHIVE/$1/$VIDEOID" + $YOUTUBEDL -o "%(upload_date)s.video" -- $VIDEOID + ls *.video | cut -c1-8 > date.txt + mv -v *.video video.mp4 + $YOUTUBEDL --get-title -- $VIDEOID > title.txt + $YOUTUBEDL --get-description -- $VIDEOID > description.txt + wget $($YOUTUBEDL --get-thumbnail -- $VIDEOID) + mv -v *.jpg thumbnail.jpg + fi + done +} + +# Enter channels here. For example: +# +# archive "Gronkh" Gronkh +# archive "SpiegelTV" channel/UC1w6pNGiiLdZgyNpXUnA4Zw