Ver código fonte

fixed mshot, added pbin

master
mort 9 anos atrás
pai
commit
3eb38071c4
2 arquivos alterados com 25 adições e 1 exclusões
  1. 3
    1
      bin/mshot
  2. 22
    0
      bin/pbin

+ 3
- 1
bin/mshot Ver arquivo

@@ -8,4 +8,6 @@ sleep 0.2
DIR=`mktemp -d`
gnome-screenshot -f "$DIR/pic.png"
scp "$DIR/pic.png" "martin@serve.mort.coffee:/var/www/mort.coffee/d/public/img/${1}.png"
echo "http://d.mort.coffee/img/${1}.png"
URL="http://d.mort.coffee/img/${1}.png"
echo $URL | xclip
echo $URL

+ 22
- 0
bin/pbin Ver arquivo

@@ -0,0 +1,22 @@
#!/bin/sh

url="www.pbin.in/upload.php"

if [ "$1" = "" ]; then
echo "pbin <file> [name]"
exit
elif [ ! -s "$1" ]; then
echo "$1: no such file"
exit
fi

content=`cat $1`

name=`curl "$url" -s -F "name=$2" -F "content=$content"`

if [ $? -eq 0 ]; then
echo "http://pbin.in/$name" | xclip
echo "http://pbin.in/$name"
else
echo "There was an error. The file you provided may be too big."
fi

Carregando…
Cancelar
Salvar