Skip to content

Instantly share code, notes, and snippets.

@govindsharma7
govindsharma7 / uploader.py
Created March 27, 2018 09:27 — forked from JordanReiter/uploader.py
Python snippet for uploading file to another server
import errno
import os
import paramiko
class Uploader(object):
def __init__(self, host, basepath='', username=None, password=None, keyfile=None, *args, **kwargs):
self.host = host
self.basepath = basepath
self.username = username
@govindsharma7
govindsharma7 / copy_remote_files.py
Created March 27, 2018 08:41 — forked from mariusavram91/copy_remote_files.py
Copy remote files to local with Python's Paramiko
import os
import paramiko
paramiko.util.log_to_file('/tmp/paramiko.log')
paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))
host = 'local'
port = 22
username = 'user'
files = ['file1', 'file2', 'file3', 'file4']
@govindsharma7
govindsharma7 / nginx.conf for supervisor
Created January 24, 2018 10:33 — forked from pahud/nginx.conf for supervisor
nginx.conf for supervisord with Docker
[program:nginx]
command=/opt/nginx/sbin/nginx -g "daemon off;"
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
#user=nobody