Created
October 4, 2013 00:07
-
-
Save gotcake/6819048 to your computer and use it in GitHub Desktop.
A script for remotely submitting things via RIT CS's try system, from your own computer. Set up SSH keys first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script allows remote submissions to try via scp uploads and remote ssh commands | |
# | |
# For this script to be effective, you should set up SSH to use | |
# key files instead of passwords. The steps are in the comments below. | |
# It will still work if you don't but you'll have to enter your password a bunch. | |
# | |
# $ ssh-keygen -t rsa # don't use a password here | |
# $ ssh user@host "mkdir .ssh; chmod 700 .ssh" | |
# $ scp .ssh/id_rsa.pub user@host:.ssh/authorized_keys2 | |
# | |
USERNAME="abc1234" # put your username here | |
HOST="yes.cs.rit.edu" # take your pick of cs machines | |
ROOT_LOCATION="~/try" # pick a folder where your submissions will go | |
CLASS=$1 | |
shift | |
SUBMISSION=$1 | |
shift | |
FILES=$@ | |
LOCATION=$ROOT_LOCATION/$CLASS/$SUBMISSION | |
ssh $USERNAME@$HOST "mkdir -p $LOCATION" | |
echo "Uploading files..." | |
scp $FILES $USERNAME@$HOST:$LOCATION | |
echo "Trying submission $SUBMISSION to $CLASS..." | |
ssh $USERNAME@$HOST "cd $LOCATION; try $CLASS $SUBMISSION $FILES < /dev/null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment