git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
import paramiko | |
k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
c = paramiko.SSHClient() | |
c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
print "connecting" | |
c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
print "connected" | |
commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
for command in commands: | |
print "Executing {}".format( command ) |
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |
rsync -raXi --size-only /path/to/folder-to-backup/ /destinations/path/to/folder-to-backup | |
same as | |
rsync -rlptgoDXi --size-only /path/to/folder-to-backup/ /destinations/path/to/folder-to-backup | |
same as | |
rsync -rlptgoDXi --size-only /path/to/folder-to-backup /destinations/path/to | |
-r recursive | |
-l preserve links | |
-p preserve permissions (also updates permission on not transferred files) | |
-t preserve time (also updates time on not transferred files) |
using System; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class ProcessAsyncHelper | |
{ | |
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout) | |
{ | |
var result = new ProcessResult(); |