Browse Source

Initial Commit

Samuel W. Flint 9 years ago
commit
f07bbc70d0
26 changed files with 686 additions and 0 deletions
  1. 10 0
      .gitignore
  2. 22 0
      Makefile
  3. 290 0
      autorandr
  4. 3 0
      demoserv
  5. 4 0
      desktop-record
  6. 9 0
      ediff
  7. 3 0
      emacs-frame
  8. 2 0
      emacsmail
  9. 25 0
      fetchrfc
  10. 54 0
      isbn2bibtex.py
  11. 6 0
      man2pdf
  12. 45 0
      moveout.sh
  13. BIN
      plantuml.jar
  14. 24 0
      pushgits
  15. 7 0
      reindent
  16. 11 0
      reindent-init.el
  17. 59 0
      reindent.el
  18. 21 0
      report
  19. 20 0
      sessionscripter
  20. 6 0
      snapshot
  21. 17 0
      ssh-proxy
  22. 17 0
      ssh-tunnel
  23. 7 0
      touchoff
  24. 7 0
      touchon
  25. 14 0
      touchtoggle
  26. 3 0
      updateorg.sh

+ 10 - 0
.gitignore

@@ -0,0 +1,10 @@
+.*
+!.gitignore
+*.aux
+*.bcf
+*.log
+*.out
+*.run.xml
+auto/*
+*~
+\#*\#

+ 22 - 0
Makefile

@@ -0,0 +1,22 @@
+EMACS=emacs
+BATCH_EMACS=$(EMACS) --batch -Q -l init.el
+
+%.html: %.org
+	$(BATCH_EMACS) $*.org -f org-html-export-to-html
+
+%.tex: %.org init.el
+	$(BATCH_EMACS) $*.org -f org-latex-export-to-latex
+
+%.el: %.org init.el
+	$(BATCH_EMACS) $*.org -f org-babel-tangle
+
+# two fancier alternatives to the above which provide a default file
+# name and encode language information
+
+%.el: %.org init.el
+	$(BATCH_EMACS) $*.org \
+	--eval '(org-babel-tangle nil "$@" (quote emacs-lisp))'
+
+%.sh: %.org init.el
+	$(BATCH_EMACS) $*.org \
+	--eval '(org-babel-tangle nil "$@" (quote bash))'

+ 290 - 0
autorandr

@@ -0,0 +1,290 @@
+#!/bin/sh
+#
+# Automatically select a display configuration based on connected devices
+#
+# Stefan Tomanek <stefan.tomanek@wertarbyte.de>
+#
+# How to use:
+#
+# Save your current display configuration and setup with:
+#  $ autorandr --save mobile
+#
+# Connect an additional display, configure your setup and save it:
+#  $ autorandr --save docked
+#
+# Now autorandr can detect which hardware setup is active:
+#  $ autorandr
+#    mobile
+#    docked (detected)
+#
+# To automatically reload your setup, just append --change to the command line
+#
+# To manually load a profile, you can use the --load <profile> option.
+#
+# autorandr tries to avoid reloading an identical configuration. To force the
+# (re)configuration, apply --force.
+#
+# To prevent a profile from being loaded, place a script call "block" in its
+# directory. The script is evaluated before the screen setup is inspected, and
+# in case of it returning a value of 0 the profile is skipped. This can be used
+# to query the status of a docking station you are about to leave.
+#
+# If no suitable profile can be identified, the current configuration is kept.
+# To change this behaviour and switch to a fallback configuration, specify
+# --default <profile>
+#
+# Another script called "postswitch "can be placed in the directory
+# ~/.autorandr as well as in all profile directories: The scripts are executed
+# after a mode switch has taken place and can notify window managers or other
+# applications about it.
+#
+#
+# While the script uses xrandr by default, calling it by the name "autodisper"
+# or "auto-disper" forces it to use the "disper" utility, which is useful for
+# controlling nvidia chipsets. The formats for fingerprinting the current setup
+# and saving/loading the current configuration are adjusted accordingly.
+
+XRANDR=/usr/bin/xrandr
+DISPER=/usr/bin/disper
+XDPYINFO=/usr/bin/xdpyinfo
+PROFILES=~/.autorandr/
+CONFIG=~/.autorandr.conf
+
+CHANGE_PROFILE=0
+FORCE_LOAD=0
+DEFAULT_PROFILE=""
+SAVE_PROFILE=""
+
+FP_METHODS="setup_fp_xrandr_edid setup_fp_sysfs_edid"
+CURRENT_CFG_METHOD="current_cfg_xrandr"
+LOAD_METHOD="load_cfg_xrandr"
+
+SCRIPTNAME="$(basename $0)"
+# when called as autodisper/auto-disper, we assume different defaults
+if [ "$SCRIPTNAME" = "auto-disper" ] || [ "$SCRIPTNAME" = "autodisper" ]; then
+	echo "Assuming disper defaults..." >&2
+	FP_METHODS="setup_fp_disper"
+	CURRENT_CFG_METHOD="current_cfg_disper"
+	LOAD_METHOD="load_cfg_disper"
+fi
+
+if [ -f $CONFIG ]; then
+	echo "Loading configuration from '$CONFIG'" >&2
+	. $CONFIG
+fi
+
+setup_fp_xrandr_edid() {
+	$XRANDR -q --verbose | awk '
+	/^[^ ]+ (dis)?connected / { DEV=$1; }
+	$1 ~ /^[a-f0-9]+$/ { ID[DEV] = ID[DEV] $1 }
+	END { for (X in ID) { print X " " ID[X]; } }'
+}
+
+setup_fp_sysfs_edid() {
+	# xrandr triggers the reloading of EDID data
+	$XRANDR -q > /dev/null
+	# hash the EDIDs of all _connected_ devices
+	for P in /sys/class/drm/card*-*/; do
+		# nothing found
+		[ ! -d "$P" ] && continue
+		if grep -q "^connected$" < "${P}status"; then
+			echo -n "$(basename "$P") "
+			md5sum ${P}edid | awk '{print $1}'
+		fi
+	done
+}
+
+setup_fp_disper() {
+	$DISPER -l | grep '^display '
+}
+
+setup_fp() {
+	local FP="";
+	for M in $FP_METHODS; do
+		FP="$($M)"
+		if [ -n "$FP" ]; then
+			break
+		fi
+	done
+	if [ -z "$FP" ]; then
+		echo "Unable to fingerprint display configuration" >&2
+		return
+	fi
+	echo "$FP"
+}
+
+current_cfg_xrandr() {
+	local PRIMARY_SETUP="";
+	if [ -x "$XDPYINFO" ]; then
+		PRIMARY_SETUP="$($XDPYINFO -ext XINERAMA | awk '/^  head #0:/ {printf $3 $5}')"
+	fi
+	$XRANDR -q | awk -v primary_setup="${PRIMARY_SETUP}" '
+	# display is connected and has a mode
+	/^[^ ]+ connected [^(]/ {
+		split($3, A, "+");
+		print "output "$1;
+		print "mode "A[1];
+		print "pos "A[2]"x"A[3];
+		if ($4 !~ /^\(/) {
+			print "rotate "$4;
+		}
+		if (A[1] A[2] "," A[3] == primary_setup)
+			print "primary";
+		next;
+	}
+	# disconnected or disabled displays
+	/^[^ ]+ (dis)?connected / ||
+	/^[^ ]+ unknown connection / {
+		print "output "$1;
+		print "off";
+		next;
+	}'
+}
+
+current_cfg_disper() {
+	$DISPER -p
+}
+
+current_cfg() {
+	$CURRENT_CFG_METHOD;
+}
+
+blocked() {
+	local PROFILE="$1"
+	[ ! -x "$PROFILES/$PROFILE/block" ] && return 1
+
+	"$PROFILES/$PROFILE/block" "$PROFILE"
+}
+
+config_equal() {
+	local PROFILE="$1"
+	if [ "$(cat "$PROFILES/$PROFILE/config")" = "$(current_cfg)" ]; then
+		echo "Config already loaded"
+		return 0
+	else
+		return 1
+	fi
+}
+
+load_cfg_xrandr() {
+	sed 's!^!--!' "$1" | xargs $XRANDR
+}
+
+load_cfg_disper() {
+	$DISPER -i < "$1"
+}
+
+load() {
+	local PROFILE="$1"
+	local CONF="$PROFILES/$PROFILE/config"
+	if [ -e "$CONF" ] ; then
+		echo " -> loading profile $PROFILE"
+		$LOAD_METHOD "$CONF"
+
+		[ -x "$PROFILES/$PROFILE/postswitch" ] && \
+			"$PROFILES/$PROFILE/postswitch" "$PROFILE"
+		[ -x "$PROFILES/postswitch" ] && \
+			"$PROFILES/postswitch" "$PROFILE"
+	fi
+}
+
+help() {
+	cat <<EOH
+Usage: $SCRIPTNAME [options]
+
+-h, --help 		get this small help
+-c, --change 		reload current setup
+-s, --save <profile>	save your current setup to profile <profile>
+-l, --load <profile> 	load profile <profile>
+-d, --default <profile> make profile <profile> the default profile 
+--force			force (re)loading of a profile
+--fingerprint		fingerprint your current hardware setup
+--config		dump your current xrandr setup
+
+ To prevent a profile from being loaded, place a script call "block" in its
+ directory. The script is evaluated before the screen setup is inspected, and
+ in case of it returning a value of 0 the profile is skipped. This can be used
+ to query the status of a docking station you are about to leave.
+
+ If no suitable profile can be identified, the current configuration is kept.
+ To change this behaviour and switch to a fallback configuration, specify
+ --default <profile>.
+
+ Another script called "postswitch "can be placed in the directory
+ ~/.autorandr as well as in any profile directories: The scripts are executed
+ after a mode switch has taken place and can notify window managers.
+
+ When called by the name "autodisper" or "auto-disper", the script uses "disper"
+ instead of "xrandr" to detect, configure and save the display configuration.
+
+EOH
+	exit
+}
+# process parameters
+OPTS=$(getopt -n autorandr -o s:l:d:cfh --long change,default:,save:,load:,force,fingerprint,config,help -- "$@")
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+eval set -- "$OPTS"
+
+while true; do
+	case "$1" in
+		-c|--change) CHANGE_PROFILE=1; shift ;;
+		-d|--default) DEFAULT_PROFILE="$2"; shift 2 ;;
+		-s|--save) SAVE_PROFILE="$2"; shift 2 ;;
+		-l|--load) LOAD_PROFILE="$2"; shift 2 ;;
+	 	-h|--help) help ;; 
+		--force) FORCE_LOAD=1; shift ;;
+		--fingerprint) setup_fp; exit 0;;
+		--config) current_cfg; exit 0;;
+		--) shift; break ;;
+		*) echo "Error: $1"; exit 1;;
+	esac
+done
+
+CURRENT_SETUP="$(setup_fp)"
+
+if [ -n "$SAVE_PROFILE" ]; then
+	echo "Saving current configuration as profile '${SAVE_PROFILE}'"
+	mkdir -p "$PROFILES/$SAVE_PROFILE"
+	echo "$CURRENT_SETUP" > "$PROFILES/$SAVE_PROFILE/setup"
+	$CURRENT_CFG_METHOD > "$PROFILES/$SAVE_PROFILE/config"
+	exit 0
+fi
+
+if [ -n "$LOAD_PROFILE" ]; then
+	CHANGE_PROFILE=1 FORCE_LOAD=1 load "$LOAD_PROFILE"
+	exit $?
+fi
+
+for SETUP_FILE in $PROFILES/*/setup; do
+	if ! [ -e $SETUP_FILE ]; then
+		break
+	fi
+	PROFILE="$(basename $(dirname "$SETUP_FILE"))"
+	echo -n "$PROFILE"
+
+	if blocked "$PROFILE"; then
+		echo " (blocked)"
+		continue
+	fi
+
+	FILE_SETUP="$(cat "$PROFILES/$PROFILE/setup")"
+	if [ "$CURRENT_SETUP" = "$FILE_SETUP" ]; then
+		echo " (detected)"
+		if [ "$CHANGE_PROFILE" -eq 1 ]; then
+			if [ "$FORCE_LOAD" -eq 1 ] || ! config_equal "$PROFILE"; then
+				load "$PROFILE"
+			fi
+		fi
+		# found the profile, exit with success
+		exit 0
+	else
+		echo ""
+	fi
+done
+
+# we did not find the profile, load default
+if [ -n "$DEFAULT_PROFILE" ]; then
+	echo "No suitable profile detected, falling back to $DEFAULT_PROFILE"
+	load "$DEFAULT_PROFILE"
+fi
+exit 1

+ 3 - 0
demoserv

@@ -0,0 +1,3 @@
+#!/bin/zsh -f
+
+python -m SimpleHTTPServer

+ 4 - 0
desktop-record

@@ -0,0 +1,4 @@
+#!/usr/bin/zsh
+
+key-mon --meta --scale=0.5 --emulate-middle --only_combo --theme clear &
+gtk-recordMyDesktop

+ 9 - 0
ediff

@@ -0,0 +1,9 @@
+#!/usr/bin/zsh
+
+progname=`basename $0`
+
+if [ $# -eq 0 ] ; then
+    echo "Usage: $progname file-1 file-2"
+fi
+
+emacsclient -diff ${1} ${2}

+ 3 - 0
emacs-frame

@@ -0,0 +1,3 @@
+#!/usr/bin/sh
+
+emacsclient -c $@

+ 2 - 0
emacsmail

@@ -0,0 +1,2 @@
+#!/bin/bash
+emacsclient -c --eval "(browse-url-mail \"$@\")"  

+ 25 - 0
fetchrfc

@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use LWP::Simple;
+$type = shift @ARGV;
+if($type eq '-rfc'){
+    $rfc = shift @ARGV;
+    getstore("http://flintfam.org/rfcs/rfc${rfc}.txt", "rfc${rfc}.txt");
+}elsif($type eq '-bcp'){
+    $bcp = shift @ARGV;
+    getstore("http://flintfam.org/rfcs/bcp/bcp${bcp}.txt", "bcp${bcp}.txt");
+}elsif($type eq '-fyi'){
+    $fyi = shift @ARGV;
+    getstore("http://flintfam.org/rfcs/fyi/fyi${fyi}.txt", "fyi${fyi}.txt");
+}elsif($type eq '-ien'){
+    $ien = shift @ARGV;
+    getstore("http://flintfam.org/rfcs/ien/ien${ien}.txt", "ien${ien}.txt");
+}elsif($type eq '-std'){
+    $std = shift @ARGV;
+    getstore("http://flintfam.org/rfcs/std/std${std}.txt", "std${std}.txt");
+}else{
+    $rfc = $type;
+    getstore("http://flintfam.org/rfcs/rfc${rfc}.txt", "rfc${rfc}.txt");
+}
+
+#getstor($url, $file)

+ 54 - 0
isbn2bibtex.py

@@ -0,0 +1,54 @@
+#!/usr/bin/python
+# Copyright FlintFam Systems Management, 2013.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import sys
+import urllib
+import urllib2
+import json
+import random
+import re
+
+accesskey = "W9V9X9VN"
+jsonreq = "http://isbndb.com/api/v2/json/" + accesskey + "/books/?i=combined&q="
+
+qstring = ""
+for arg in sys.argv:
+    qstring = qstring + " " + arg
+
+query = urllib.quote_plus(qstring)
+queryURL = jsonreq + query
+jsondata = urllib2.urlopen(queryURL).read()
+data = json.loads(jsondata)
+
+for book in data['data']:
+    if book['author_data']:
+        authorid = book['author_data'][0]['id']
+        authorlast = re.split('_', authorid)
+        rand = random.randint(0, 3000)
+        bibtexkey = authorlast[0] + str(rand)
+        authoritem = ""
+        first = 1
+        for author in book['author_data']:
+            authorname = author['name']
+            if first == 0:
+                authoritem = authoritem + " and  " + authorname
+            else:
+                authoritem = authorname
+                first = 0
+        titleitem = book['title_latin']
+        publisher = book['publisher_name']
+        entry = "@Book{" + bibtexkey + ",\nauthor = \"{" + authoritem + "}\",\ntitle = \"{" + titleitem + "}\",\npublisher = \"{" + publisher + "}\"\n}\n\n"
+        print(entry)

+ 6 - 0
man2pdf

@@ -0,0 +1,6 @@
+#!/bin/zsh
+
+man -T $1 > $1.ps
+pstopdf $1.ps
+
+mupdf $1.pdf

+ 45 - 0
moveout.sh

@@ -0,0 +1,45 @@
+#!/usr/bin/zsh
+
+#echo "Username?"
+#read username
+#echo "Server?"
+#read  server
+#echo "Foreign path?"
+#read fpath
+
+#echo "Syncing Files"
+#rsync -rlpE --progress --delete ~ ${username}@${server}:${foreignpath}
+
+echo "Copying rpm install db, this may take time!"
+rpm -qa --qf "%{NAME}\n" >rpmdb.txt
+
+echo "Copying crontab."
+crontab -l >crontab.txt
+
+echo "Moving repos.d."
+mkdir repos.d
+sudo cp -r /etc/yum.repos.d repos.d
+
+echo "Creating movein.sh"
+cat <<EOF >movein.sh
+#!/usr/bin/bash
+
+echo "Reconstituting Crontab"
+cat crontab.txt | crontab
+
+echo "Reconstituting yum repos"
+sudo cp -r repos.d /etc/yum.repos.d
+
+echo "Reconstituting software"
+software = `cat	rpmdb.txt`
+for \$pack in "\${software[@]}"
+do
+	yum install \$pack
+done
+
+#echo "Syncing Files"
+#rsync -rlpE --delete ~ ${username}@${server}:${foreignpath}
+
+EOF
+
+chmod 0777 movein.sh

BIN
plantuml.jar


+ 24 - 0
pushgits

@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys, os
+import ConfigParser, re
+from git import *
+
+config = ConfigParser.ConfigParser()
+config.read(os.path.expanduser(os.path.join('~', '.gitrepolist')))
+
+repos = re.split(',', config.get('repos', 'list'))
+
+if len(sys.argv) > 1:
+   repodir = config.get(sys.argv[1], 'directory')
+   print("Pushing Repository " + sys.argv[1] + " Location: " + repodir)
+   repo = Repo(repodir)
+   repo.remotes.origin.push()
+else:
+   for reponame in repos:
+      repodir = config.get(reponame, 'directory')
+      #   branch = config.get(reponame, 'branch')
+      print("Pushing repository: " + reponame + ", Location: " + repodir)
+      repo = Repo(repodir)
+      repo.remotes.origin.push()
+

+ 7 - 0
reindent

@@ -0,0 +1,7 @@
+#!/usr/bin/zsh
+
+INDENT_ELISP=~/bin/reindent.el
+INDENT_FUNCTION=indent-driver
+MINI_INIT=~/bin/reindent-init.el
+
+emacs -Q -batch -l ${MINI_INIT} $* -l ${INDENT_ELISP} -f ${INDENT_FUNCTION}

+ 11 - 0
reindent-init.el

@@ -0,0 +1,11 @@
+(add-to-list 'load-path "~/.emacs.d/web-mode")
+(require 'web-mode)
+(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.html\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
+(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))

+ 59 - 0
reindent.el

@@ -0,0 +1,59 @@
+;;;; reindent.el
+;;; a reindenting script to automagically indent files.
+;;; Licenced under the GNU GPLv3 or later.
+;;; Copyright © 2014, Samuel W. Flint <swflint@flintfam.org>
+
+(require 'find-lisp)
+
+(defun indent-buffer ()
+  "Indent Current Buffer"
+  (indent-region (point-min) (point-max)))
+
+(defun indent-correctly ()
+  "Indent the current buffer, unless the region is active"
+  (if (region-active-p)
+      (progn
+        (indent-region
+         (region-beginning)
+         (region-end))
+        (message "Indented Region."))
+    (indent-buffer)
+    (message "Indented Buffer.")))
+
+(defun untabify-correctly ()
+  "Untabify current buffer, unless the region is active"
+  (if (region-active-p)
+      (progn
+        (untabify (region-beginning) (region-end))
+        (message "Untabified Region"))
+    (untabify (point-min) (point-max))
+    (message "Untabified Buffer")))
+
+(defun indent-driver ()
+  (indent-correctly)
+  (untabify-correctly)
+  (save-buffer))
+
+(defun indent-driver-with-file (file-path)
+  (let ((file-buffer (find-file file-path)))
+    (with-current-buffer file-buffer
+      (indent-driver)
+      (save-buffer))
+    (kill-buffer file-buffer)))
+
+(defun reindent-directory-contents (directory regex)
+  "Reindent the files in a directory.
+
+Map `indent-driver-with-file' over files in DIRECTORY whose names
+match REGEX.  Uses `find-lisp-find-files' to locate files to map
+over.
+
+Returns 't'."
+  (interactive (list (read-directory-name "Directory: ")
+                     (read-regexp "Matching Regexp: ")))
+  (mapc #'indent-driver-with-file (find-lisp-find-files directory regex))
+  t)
+
+(provide 'reindent-tools)
+
+;;;; end reindent.el

+ 21 - 0
report

@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# This script facilities plotting of a ledger register report.  If you
+# use OS/X, and have AquaTerm installed, you will probably want to set
+# LEDGER_TERM to "aqua".
+#
+# Examples of use:
+#
+#   report -j -M reg food            # plot monthly food costs
+#   report -J reg checking           # plot checking account balance
+
+if [ -z "$LEDGER_TERM" ]; then
+  LEDGER_TERM="x11 persist"
+fi
+
+(cat <<EOF; ledger "$@") | gnuplot
+  set terminal $LEDGER_TERM
+  set xdata time
+  set timefmt "%Y-%m-%d"
+  plot "-" using 1:2 with lines
+EOF

+ 20 - 0
sessionscripter

@@ -0,0 +1,20 @@
+#! /bin/zsh -f
+
+date=(`date +%F`)
+subject=(`echo $1 | sed -e "s/ /-/g"`)
+filename=~/sessions/${date}-${subject}.sessionscript
+timingfile=~/sessions/${date}-${subject}.timing
+
+#echo Recording session $1 as $filename
+
+if [ -d ~/sessions ] ; then
+    sleep 0.05s
+else
+    mkdir ~/sessions
+fi
+
+script -f $filename
+
+cd ~/sessions
+git add ${date}-${subject}.sessionscript ${date}-${subject}.timing
+git commit

+ 6 - 0
snapshot

@@ -0,0 +1,6 @@
+#!/bin/sh
+
+date=(`date +%F`)
+
+cd ~/Pictures/
+import -window root snapshot-${date}.png

+ 17 - 0
ssh-proxy

@@ -0,0 +1,17 @@
+#!/usr/bin/zsh
+
+if [ $# -eq 0 ] ; then
+    echo "Usage: $0 user@host [port]"
+fi
+
+host=$1
+
+if [ $# -eq 2 ] ; then
+    port=$2
+else
+    port=8080
+fi
+
+echo "Configure SOCKS proxy as ${host}:${port}"
+
+ssh -N -D $port $host

+ 17 - 0
ssh-tunnel

@@ -0,0 +1,17 @@
+#!/usr/bin/zsh
+
+if [ $# -eq 0 ]; then
+    echo "Usage: $0 username@machine destination-port [local-port]"
+    exit 1
+fi
+
+destination=$1
+destinationport=$2
+
+if [ $# -eq 2 ]; then
+    localport=$destinationport
+else
+    localport=$3
+fi
+
+ssh -q -N -L ${localport}:localhost:${destinationport} $destination

+ 7 - 0
touchoff

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+declare -i ID
+ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+
+xinput disable $ID
+echo "Touchpad disabled"

+ 7 - 0
touchon

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+declare -i ID
+ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+
+xinput enable $ID
+echo "Touchpad enabled."

+ 14 - 0
touchtoggle

@@ -0,0 +1,14 @@
+#!/bin/sh
+
+declare -i ID
+ID=`xinput list | grep -Eo 'Touchpad\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
+declare -i STATE
+STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
+if [ $STATE -eq 1 ]
+then
+    xinput disable $ID
+    echo "Touchpad disabled."
+else
+    xinput enable $ID
+    echo "Touchpad enabled."
+fi

+ 3 - 0
updateorg.sh

@@ -0,0 +1,3 @@
+#!/bin/zsh
+
+cd ~/.emacs.d/org-mode ; make update