Skip to content

Instantly share code, notes, and snippets.

@enriquemanuel
enriquemanuel / SSHrsync.sh
Last active August 24, 2017 22:03 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)
rsync -aHAXxv --numeric-ids --delete --progress -e "ssh -T -c arcfour -o Compression=no -x" user@<source>:<source_dir> <dest_dir>
@enriquemanuel
enriquemanuel / docker_rm_containers
Created August 23, 2017 19:27
Bash commands for removing all docker images/containers
#!/bin/bash
# Remove all containers
docker rm $(docker ps -aq)
# Remove all exited containers
docker rm $(docker ps -aqf status=exited)
@enriquemanuel
enriquemanuel / docker_rm_containers
Created August 23, 2017 19:27
Bash commands for removing all docker images/containers
#!/bin/bash
# Remove all containers
docker rm $(docker ps -aq)
# Remove all exited containers
docker rm $(docker ps -aqf status=exited)
@enriquemanuel
enriquemanuel / paramiko-using-ssh-config.py
Created July 25, 2017 03:50 — forked from acdha/paramiko-using-ssh-config.py
Connecting with paramiko using the user's OpenSSH config
client = paramiko.SSHClient()
client._policy = paramiko.WarningPolicy()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh_config = paramiko.SSHConfig()
user_config_file = os.path.expanduser("~/.ssh/config")
if os.path.exists(user_config_file):
with open(user_config_file) as f:
ssh_config.parse(f)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront