Skip to content

Instantly share code, notes, and snippets.

View mvadstrup's full-sized avatar

Morten Vadstrup mvadstrup

View GitHub Profile
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes:
@mvadstrup
mvadstrup / gist:4409388
Created December 29, 2012 21:08
Add to hosts file
#
# Powershell script for adding/removing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
$file = "C:\Windows\System32\drivers\etc\hosts"
function add-host([string]$filename, [string]$ip, [string]$hostname) {