+#! /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
+
+
--- /dev/null
+#! /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
--- /dev/null
+#!/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 <search strings> |"
+echo "| Example: ./gocmd.sh example and test |"
+echo "| |"
+echo ".=========================================================."
+echo ""
+
+if [ -z $1 ]
+then
+ echo "ERROR: No search string supplied."
+ echo "USAGE: ./gocmd.sh <search srting>"
+ 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 ""
--- /dev/null
+#!/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