aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
authorMathias Bynens <mathias@qiwi.be>2011-09-05 20:08:58 +0200
committerMathias Bynens <mathias@qiwi.be>2011-09-05 20:08:58 +0200
commit7d022705ed126d78881fb7356e28f64ee7e540f4 (patch)
tree4380e9d825f2364b42e4c145f1db3d9e29f463d0 /.functions
downloaddotfiles-7d022705ed126d78881fb7356e28f64ee7e540f4.tar.gz
dotfiles-7d022705ed126d78881fb7356e28f64ee7e540f4.tar.bz2
dotfiles-7d022705ed126d78881fb7356e28f64ee7e540f4.zip
Initial commit.
Diffstat (limited to '.functions')
-rw-r--r--.functions15
1 files changed, 15 insertions, 0 deletions
diff --git a/.functions b/.functions
new file mode 100644
index 0000000..91ec6c1
--- /dev/null
+++ b/.functions
@@ -0,0 +1,15 @@
+# Create a new directory and enter it
+md() {
+ mkdir -p "$@" && cd "$@"
+}
+
+# Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL.
+# Send a fake UA string for sites that sniff it instead of using the Accept-Encoding header. (Looking at you, ajax.googleapis.com!)
+httpcompression() {
+ encoding="$(curl -LIs -H 'User-Agent: Mozilla/5 Gecko' -H 'Accept-Encoding: gzip,deflate,compress,sdch' "$1" | grep '^Content-Encoding:')" && echo "$1 is encoded using ${encoding#* }" || echo "$1 is not using any encoding"
+}
+
+# All the dig info
+digga() {
+ dig +nocmd "$1" any +multiline +noall +answer
+}