Skip to content

Instantly share code, notes, and snippets.

# download pypy
wget "https://bitbucket.org/pypy/pypy/downloads/pypy-5.1.1-linux64.tar.bz2" -O - | tar -xj
# create virtual env with pypy
virtualenv -p pypy-5.1.1-linux64/bin/pypy .venv
# activate virtual environment
source .venv/bin/activate
# install uwsgi and gevent
@jlinoff
jlinoff / mysshpass.py
Last active September 14, 2022 14:22
Simple python script to emulate sshpass using only pthon standard libraries, tested on python-2.7 and python-3.4.
#!/usr/bin/env python
# License: MIT Open Source
# Copyright (c) 2016 Joe Linoff
'''
The tool runs ssh or scp as a child process with a connected psuedo
terminal (pty).
It will automatically answer yes to the "Are you sure you want to
continue connecting (yes/no)?" if it comes up.
@virtuald
virtuald / sshpass.py
Created December 20, 2014 19:49
Simple python wrapper to give SSH a password for automation purposes (with output capture)
#!/usr/bin/env python3
import os
import sys
_b = sys.version_info[0] < 3 and (lambda x:x) or (lambda x:x.encode('utf-8'))
def ssh_exec_pass(password, args, capture_output=False):
'''
Wrapper around openssh that allows you to send a password to