commit 5cb23ba9c0ffe180e41910ee61ae78df9309f087
parent 14fcb2796da0c88b1d647d0d6c033e5c13cdc0e8
Author: sin <sin@2f30.org>
Date: Thu, 20 Jun 2013 13:07:37 +0100
Add colordump, sprunge and utubify
Diffstat:
3 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/colordump b/colordump
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Usage: colordump
+# Dump 256 ansi colors to the terminal.
+
+printf "How each ANSI color is displayed on your terminal:\n\n"
+
+i=0
+row=0
+while [ $i -lt 255 ];
+do
+ newrow=$(expr $i / 10)
+ test $newrow -ne $row && printf "\n"
+ row=$newrow
+ printf "\e[%dm %03d \e[0m" $i $i
+ i=$(expr $i + 1)
+done
+
+printf '\n\n e.g., "\\e[41mTEXT\\e[0m" '
+printf "\e[41m(for TEXT like this)\e[0m\n"
diff --git a/sprunge b/sprunge
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+SPRUNGE() {
+ curl -F 'sprunge=<-' http://sprunge.us
+}
+
+if test -z "$1"
+then cat - | SPRUNGE
+else cat "$1" | SPRUNGE
+fi
diff --git a/utubify b/utubify
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Simple script to use youtube-dl for all youtube links
+# and your browser of choice otherwise
+
+export LINK=$@
+
+if [ -z ${LINK} ]; then
+ echo "usage: $0 <link>"
+ exit 1
+fi
+
+echo ${LINK} | grep -ie "https\?://\(\(\(www.\)\?youtube.com/.*\(?v=\|&v=\).\+\)\|\(youtu.be/.\+\)\)"
+if [ $? -eq 0 ]; then
+ urxvt -e sh -c 'mplayer $(youtube-dl -g ${LINK})' &
+else
+ chromium ${LINK} &
+fi