Skip to content

Instantly share code, notes, and snippets.

View Jay-Jay-D's full-sized avatar

Juan José D'Ambrosio Jay-Jay-D

  • Entre Ríos, Argentina
View GitHub Profile
@AlexMAS
AlexMAS / ProcessAsyncHelper.cs
Last active April 22, 2024 02:50
The right way to run external process in .NET (async version)
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();
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@niun
niun / rsync-cheatsheet.txt
Last active June 29, 2018 16:15
rsync backup cheatsheet
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)
@tuxfight3r
tuxfight3r / 01.bash_shortcuts_v2.md
Last active May 4, 2024 16:58
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@batok
batok / paramiko_example.py
Created April 10, 2012 16:11
Paramiko example using private key
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 )
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream