Skip to content

Instantly share code, notes, and snippets.

@beryllium
beryllium / remote-diff.sh
Created March 13, 2013 22:30
So you're trying to piece together what exploded between two remote servers. You want to be able to diff files on them, but you don't want to be doing a whole bunch of manual file transfers. Enter: remote-diff.sh
#!/bin/bash
if [ -z "$1" -o -z "$2" -o -z "$3" ]
then
echo "Usage: remote-diff.sh [user@]host1 [user@]host2 path_to_file"
echo ""
echo "Note: If you need to specify a valid key or optional username for the host,"
echo " you are encouraged to add the host configuration to your ~/.ssh/config file."
exit 1
fi
@beryllium
beryllium / cert_check.sh
Created February 23, 2013 00:06
So, you've got a bunch of servers with SSL certs and you're constantly forgetting when to renew? Fret no more! Now there's one more tool you can add to the pages-long list of tools that can solve this problem.
#!/bin/bash
servers[0]=server0.example.com
servers[1]=server1.example.com
servers[2]=server2.example.com
TMP_CERT_QUIT=/tmp/check_cert_quit.tmp
TMP_CERT_CHECK=/tmp/check_cert.tmp
if [ -f "$TMP_CERT_CHECK" ]
@beryllium
beryllium / autosvnsync.sh
Created October 26, 2012 22:05
Automatic SVN synchronization with UUID autocopy
#!/bin/bash
# autosvnsync.sh is a tool for automatically synchronizing/mirroring SVN repositories.
# By default, the script assumes that you have configured a "syncuser" account on the SRC and DEST servers,
# and that you are running the script as "syncuser" on the DEST server (presumably behind a firewall).
#Remote SVN info
SVN_HOST="syncuser@example.com" #User and host, for SSH - alternatively, you can use ~/.ssh/config to specialize something
SVN_LOC="data/svn"
SVN_REPO="svn+ssh://$SVN_HOST/$SVN_LOC"