Skip to content

Instantly share code, notes, and snippets.

@bobmaerten
Last active December 16, 2015 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobmaerten/5489254 to your computer and use it in GitHub Desktop.
Save bobmaerten/5489254 to your computer and use it in GitHub Desktop.
#!/bin/sh
SCP_USER='bob'
SCP_HOST='host'
SCP_PATH='/path/to/web/files/host.net/x/'
HTTP_URL="http://host.net/x/"
FILENAME=`(cat /dev/urandom|head -c 10; date) | md5 | head -c 10`.png
FILEPATH=/tmp/$FILENAME
scrot -s -b $FILEPATH
if [ -f $FILEPATH ]
then
echo $HTTP_URL$FILENAME | xclip -sel clip
scp $FILEPATH ${SCP_USER}@${SCP_HOST}:$SCP_PATH
rm $FILEPATH
echo `date` $HTTP_URL$FILENAME >> ~/bin/capture.log
fi
#!/usr/bin/env ruby
require 'digest/md5'
while file = ARGF.gets
file.each_line do |line|
puts Digest::MD5.hexdigest(line)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment