-
-
Save pnlinh/8eb1105da2416e8cac36faaf1ee4d30c to your computer and use it in GitHub Desktop.
Revisions
-
populov revised this gist
Sep 28, 2022 . 1 changed file with 11 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,37 +9,35 @@ ## Install prerequisites (Ubuntu): # sudo apt-get install flameshot openssh-client notify-send xclip # # Uncomment last line to delete screenshot file after upload PORT=2221 USER="SergeyPopulov" SFTPSERVER="jing.saritasa.com" STORAGE=~/Pictures/Screenshots PASSWORD=oh-noooooooo #STORAGE=/tmp RND=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-8} | head -n 1) DATE=$(date +%Y-%m-%d_%H-%M) FILE=$DATE"_"$RND".png" flameshot gui --raw > $STORAGE/$FILE if [[ ! -s $STORAGE/$FILE ]]; then rm $STORAGE/$FILE exit 0 fi echo "$FILE created!" scp -i ~/.ssh/interesnee -P $PORT -o PasswordAuthentication=no -o PubkeyAcceptedKeyTypes=+ssh-rsa $STORAGE/$FILE ${USER}@${SFTPSERVER}:/ #sshpass -p $PASSWORD scp -vvv -P $PORT -o PasswordAuthentication=yes $STORAGE/$FILE ${USER}@${SFTPSERVER}:/ if [ $? -ne 0 ]; then notify-send --icon terminal --category 'transfer.error' "Screenshot upload error" "Could not upload $FILE to $SFTPSERVER" else URL="https://${SFTPSERVER}/${USER}/${FILE}" echo $URL | xclip -selection clipboard notify-send --icon flameshot --category 'transfer.complete' --expire-time 10 "Screenshot uploaded" "$URL copied to clipboard" fi # rm $STORAGE/$FILE -
populov revised this gist
Apr 16, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ # sudo apt-get install flameshot openssh-client notify-send xclip # # Upload your ssh key to SSH/SFTP server (should ask for password): # ssh-copy-id -i ~/.ssh/id_rsa.pub -p $PORT [email protected] # # Uncomment last line to delete screenshot file after upload -
populov revised this gist
Apr 16, 2021 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,9 @@ ## Install prerequisites (Ubuntu): # sudo apt-get install flameshot openssh-client notify-send xclip # # Upload your ssh key to SSH/SFTP server (should ask for password): # ssh-copy-id -i ~/.ssh/id_rsa -p $PORT [email protected] # # Uncomment last line to delete screenshot file after upload PORT=2221 -
populov revised this gist
Apr 16, 2021 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,11 @@ if [ $? -ne 0 ]; then fi echo "$FILE created!" scp -i ~/.ssh/id_rsa -o PasswordAuthentication=no -P $PORT $STORAGE/$FILE ${USER}@${SFTPSERVER}:/ if [ $? -ne 0 ]; then notify-send --icon terminal --category 'transfer.error' "Screenshot upload error" "Could not upload $FILE to $SFTPSERVER" fi URL="https://${SFTPSERVER}/${USER}/${FILE}" echo $URL | xclip -selection clipboard -
populov revised this gist
Apr 16, 2021 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -12,9 +12,9 @@ # Uncomment last line to delete screenshot file after upload PORT=2221 USER="UserName" SFTPSERVER="sftp.server.com" STORAGE=~/Pictures/Screenshots #STORAGE=/tmp RND=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-8} | head -n 1) @@ -29,9 +29,9 @@ if [ $? -ne 0 ]; then fi echo "$FILE created!" scp -i ~/.ssh/id_rsa -o IdentitiesOnly=yes -P $PORT $STORAGE/$FILE ${USER}@${SFTPSERVER}:/ URL="https://${SFTPSERVER}/${USER}/${FILE}" echo $URL | xclip -selection clipboard notify-send --icon flameshot --category 'transfer.complete' --expire-time 10 "Screenshot uploaded" "$URL copied to clipboard" -
populov revised this gist
Apr 14, 2021 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ #!/bin/bash # Prerequisites: # * flameshost (Take screenshot + basic edit): https://flameshot.org # * scp (OpenSSH/SFTP file copy client) https://www.mankier.com/1/scp # * notify-send (Desktop notifications) https://ss64.com/bash/notify-send.html # * xclip (copy to clipboard) https://opensource.com/article/19/7/xclip # ## Install prerequisites (Ubuntu): # sudo apt-get install flameshot openssh-client notify-send xclip # # Uncomment last line to delete screenshot file after upload -
populov created this gist
Apr 14, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #!/bin/bash # Prerequisites: # * flameshost: https://flameshot.org # * scp (OpenSSH file copy client) # * notify-send (Desktop notifications) https://ss64.com/bash/notify-send.html # * xclip (copy to clipboard) https://opensource.com/article/19/7/xclip # ## Install prerequisites: # sudo apt-get install flameshot scp notify-send xclip # # Uncomment last line to delete screenshot file after upload PORT=2221 JINGUSER="SergeyPopulov" JINGDOMAIN="jing.saritasa.com" STORAGE=/home/populov/Pictures/Screenshots #STORAGE=/tmp RND=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w ${1:-8} | head -n 1) DATE=$(date +%Y-%m-%d_%H-%M) FILE=$DATE"_"$RND".png" flameshot gui -r > $STORAGE/$FILE if [ $? -ne 0 ]; then cat $STORAGE/$FILE rm $STORAGE/$FILE exit 0 fi echo "$FILE created!" scp -i ~/.ssh/id_rsa -o IdentitiesOnly=yes -P $PORT $STORAGE/$FILE $JINGUSER@$JINGDOMAIN:/ URL="https://${JINGDOMAIN}/${JINGUSER}/${FILE}" echo $URL | xclip -selection clipboard notify-send --icon flameshot --category 'transfer.complete' --expire-time 10 "Screenshot uploaded" "$URL copied to clipboard" # rm $STORAGE/$FILE