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
| def withAutoTimestampSuppression(entity, closure) { | |
| toggleAutoTimestamp(entity, false) | |
| try { | |
| def result = closure() | |
| return result | |
| } finally { | |
| toggleAutoTimestamp(entity, true) | |
| } | |
| } |
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
| import com.jcraft.jsch.Channel | |
| import com.jcraft.jsch.ChannelSftp | |
| import com.jcraft.jsch.JSch | |
| import com.jcraft.jsch.Session | |
| import java.util.concurrent.TimeUnit | |
| class Ssh { | |
| JSch jsch = new JSch() |
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
| function rm () { | |
| local path | |
| for path in "$@"; do | |
| # ignore any arguments | |
| if [[ "$path" = -* ]]; then : | |
| else | |
| local dst=${path##*/} | |
| # append the time if necessary | |
| while [ -e ~/.Trash/"$dst" ]; do | |
| dst="$dst "$(date +%H-%M-%S) |
NewerOlder