-
-
Save kotnik/dedb6aa52068e31e170a to your computer and use it in GitHub Desktop.
putfile & pastebin
This file contains hidden or 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 | |
file=$(mktemp ~/Documents/Pastes/XXXXXX) | |
mv $file $file.html | |
file="$file.html" | |
chmod 644 ${file} | |
[[ ! -z "$1" ]] && lang="-s $1" | |
cat - > ${file}.in | |
source-highlight -i ${file}.in -o ${file} ${lang} | |
rm ${file}.in | |
scp -q -o "LogLevel quiet" ${file} foo@main:www/ | |
echo "https://bin.foo/${file##*/}" | xclip -f -selection clipboard |
This file contains hidden or 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 | |
if [[ -z "$1" ]]; then | |
echo "Need filename" | |
exit 1 | |
fi | |
file_ext=$(echo $1 |awk -F . '{if (NF>1) {print $NF}}') | |
if [ -z "$file_ext" ]; then | |
file_ext="txt" | |
fi | |
file=$(mktemp /tmp/XXXXXX.$file_ext) | |
cp "$1" $file | |
chmod 644 $file | |
scp -q -o "LogLevel quiet" "$file" bin_kotur_org@main:www/ | |
echo "https://bin.kotur.org/$(basename $file)" | xclip -f -selection clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment