Skip to content

Instantly share code, notes, and snippets.

@dw
dw / step1.sh
Created September 15, 2017 09:41
Ansiblol
ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/dmw/.ansible/cp/4e8d7ac1b9 u '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
@dw
dw / step1.sh
Last active September 27, 2017 03:51
Ansiblol
ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/Users/dmw/.ansible/cp/4e8d7ac1b9 u
'/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
@dw
dw / script.py
Created February 13, 2018 14:39
import mitogen
import requests
def get_url(url):
return requests.get(url).text
@mitogen.main()
def main(router):
host = router.ssh(hostname='k3')
print host.call(get_url, 'https://www.google.com/')
import mitogen
import time
import traceback
import os
import mitogen.core
@mitogen.core.takes_router