dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 2539562e3a7516f4dbb77930d4057ed5d23d4aa5
parent 03a4bbf0c332b1a512770e2dd1c878cb66c551bd
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Thu, 15 Mar 2018 11:35:13 -0400

Add numerous $HOME/bin/ scripts

Diffstat:
Alinks/bin/analysis-ssh | 6++++++
Alinks/bin/anders | 14++++++++++++++
Alinks/bin/asciicast2gif | 2++
Alinks/bin/cosmo-ssh | 12++++++++++++
Alinks/bin/cosmo-sshfs | 3+++
Alinks/bin/cosmo-sshfs-unmount | 2++
Alinks/bin/ejectall | 8++++++++
Alinks/bin/gfdl-ssh | 6++++++
Alinks/bin/granular-status.sh | 2++
Alinks/bin/nethogs | 2++
Alinks/bin/offlineimap-kill.sh | 3+++
Alinks/bin/pvpython | 12++++++++++++
Alinks/bin/tiger-ssh | 6++++++
Alinks/bin/tmux-fix-scaling.sh | 4++++
14 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/links/bin/analysis-ssh b/links/bin/analysis-ssh @@ -0,0 +1,6 @@ +#!/bin/sh +# for tput commands: see `man 5 terminfo` +echo "$(tput setaf 1)## Make sure to connect to Princeton VPN (Connect\ Tunnel.app) first ##$(tput sgr0)" +pass -c Uni/noaa-rsa-pin +echo "$(tput setaf 2)# Paste passphrase from clipboard (Cmd-v) + 6 RSA fob digits$(tput sgr0)" +ssh Anders.Damsgaard@analysis-rsa.princeton.rdhpcs.noaa.gov diff --git a/links/bin/anders b/links/bin/anders @@ -0,0 +1,14 @@ +#!/bin/bash + +# cmd-line args as message +msg="$@" + +# use STDIN if no args are passed +if [ $# -eq 0 ]; then + msg="$(cat)" +fi + +#to="Susan Louise Damsgaard Sonnesen" +to="Anders Damsgaard" + +osascript -e 'tell application "Messages" to send "'"$msg"'" to buddy "'"$to"'"' diff --git a/links/bin/asciicast2gif b/links/bin/asciicast2gif @@ -0,0 +1,2 @@ +#!/bin/sh +~/src/asciicast2gif/asciicast2gif $@ diff --git a/links/bin/cosmo-ssh b/links/bin/cosmo-ssh @@ -0,0 +1,12 @@ +#!/bin/bash + +#if [[ "$(ip addr | grep 10.17.8)" ]]; then +if [[ "$(ifconfig | grep 10.17)" ]]; then + echo "On geo lan. Connecting directly..." + #ssh -X adc@cosmo-server.au.dk + ssh adc@cosmo-server.au.dk +else + echo "Outside geo lan, connecting through fresh-horse..." + #autossh -X adc@fh.cs.au.dk -t 'autossh -X cosmo-server.au.dk' + autossh -M 1234 adc@fh.cs.au.dk -t 'ssh cosmo-server.au.dk -t "./console.sh"' +fi diff --git a/links/bin/cosmo-sshfs b/links/bin/cosmo-sshfs @@ -0,0 +1,3 @@ +#!/bin/sh +ssh -f adc@fh.cs.au.dk -L 2222:cosmo-server.au.dk:22 -N +sshfs -p 2222 adc@localhost:/home/adc/ /Users/ad/cosmo-server diff --git a/links/bin/cosmo-sshfs-unmount b/links/bin/cosmo-sshfs-unmount @@ -0,0 +1,2 @@ +#!/bin/sh +fusermount -u /Users/ad/cosmo-server diff --git a/links/bin/ejectall b/links/bin/ejectall @@ -0,0 +1,8 @@ +#!/bin/bash +for f in "/Volumes/"*; do + if [ "$f" != "/Volumes/Macintosh HD" ]; then + if [ "$f" != "/Volumes/MobileBackups" ]; then + diskutil eject $f; + fi + fi +done diff --git a/links/bin/gfdl-ssh b/links/bin/gfdl-ssh @@ -0,0 +1,6 @@ +#!/bin/bash +# for tput commands: see `man 5 terminfo` +echo "$(tput setaf 1)## Make sure to connect to Princeton VPN (Connect\ Tunnel.app) first ##$(tput sgr0)" +pass -c Uni/noaa-rsa-pin +echo "$(tput setaf 2)# Paste passphrase from clipboard (Cmd-v) + 6 RSA fob digits$(tput sgr0)" +ssh Anders.Damsgaard@ssh-rsa.gfdl.noaa.gov diff --git a/links/bin/granular-status.sh b/links/bin/granular-status.sh @@ -0,0 +1 @@ +/Users/ad/code/Granular/granular-status.sh+ \ No newline at end of file diff --git a/links/bin/nethogs b/links/bin/nethogs @@ -0,0 +1,2 @@ +#!/bin/sh +sudo /usr/local/sbin/nethogs diff --git a/links/bin/offlineimap-kill.sh b/links/bin/offlineimap-kill.sh @@ -0,0 +1,3 @@ +#!/bin/sh +pid=$(ps aux|grep offlineimap|grep python|awk ' {print $2}') +kill -9 $pid diff --git a/links/bin/pvpython b/links/bin/pvpython @@ -0,0 +1,12 @@ +#!/bin/sh +#orig_dir=$(pwd) +#set -e +#cd /Applications/Paraview-5.4.0.app/Contents/bin +#./pvpython $orig_dir/$@ + +pvpath=/Applications/Paraview-5.4.0.app + +#export \ + #PYTHONPATH=$pvpath/Contents/Python:$pvpath/Contents/Python/vtk:$pvpath/Libraries:$PYTHONPATH + +$pvpath/Contents/bin/pvpython $@ diff --git a/links/bin/tiger-ssh b/links/bin/tiger-ssh @@ -0,0 +1,6 @@ +#!/bin/sh +# for tput commands: see `man 5 terminfo` +echo "$(tput setaf 1)## Make sure to connect to Princeton VPN (Connect\ Tunnel.app) first ##$(tput sgr0)" +pass -c Uni/princeton-netID-andersd +echo "$(tput setaf 2)# Paste passphrase from clipboard (Cmd-v)$(tput sgr0)" +ssh andersd@tiger.princeton.edu diff --git a/links/bin/tmux-fix-scaling.sh b/links/bin/tmux-fix-scaling.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +status_width=`echo "$(tput cols)/3"|bc|tr -d '\n'` +tmux new-window -n resize \ + "tmux set status-right-length $status_width; tmux set status-left-length $status_width"