-
-
Save Hamcha/5689b322596b92d947fd to your computer and use it in GitHub Desktop.
Quick and dirty ix.io alternative for when ix is down or something - Completely backend free (requires ssh/cat and a webserver) - Assumes keyless auth
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/sh | |
SERVER_USER=<<your ssh user>> | |
SERVER_HOST=<<your ssh server address>> | |
PUBLIC_PATH="<<public url (ie https://myhost/pastes/)>>" | |
SERVER_PATH="<<server path (ie /var/www/pastes/)>>" | |
SERVER_FLAGS="<<additional flags (ex. custom ssh port)>>" | |
HASH=$(date +%s%N | shasum | head -c7) | |
ssh ${SERVER_USER}@${SERVER_HOST} ${SERVER_FLAGS} "cat > ${SERVER_PATH}${HASH}" && echo ${PUBLIC_PATH}${HASH} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment