AWSPlay (Python CSV Parsing)

#csvCreds.py import csv def getSecret(file=”C:\Users\cstgeorge\Downloads\credentials.csv”): with open(file, “rb”) as ofile: reader = csv.DictReader(ofile, delimiter=’,’) for row in reader: return row[‘Secret Access Key’] def getID(file=”C:\Users\cstgeorge\Downloads\credentials.csv”): with open(file, “rb”) as ofile: reader = csv.DictReader(ofile, delimiter=’,’) for row in reader: return row[‘Access Key Id’] #awsPlay.py import csvCreds import boto from boto.s3.key import Key if __name__ == “__main__”: conn[…]

s3fs on Ubuntu

#To install and mount s3fs on Ubuntu: root@mikrojenkins:/usr/src# apt-get remove fuse root@mikrojenkins:/usr/src# apt-get install build-essential libcurl4-openssl-dev libxml2-dev mime-support root@mikrojenkins:/usr/src# wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz root@mikrojenkins:/usr/src# tar xzf fuse-2.9.3.tar.gz root@mikrojenkins:/usr/src# cd fuse-2.9.3 root@mikrojenkins:/usr/src/fuse-2.9.3# ./configure –prefix=/usr/local root@mikrojenkins:/usr/src/fuse-2.9.3# make && make install root@mikrojenkins:/usr/src/fuse-2.9.3# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig root@mikrojenkins:/usr/src/fuse-2.9.3# ldconfig root@mikrojenkins:/usr/src/fuse-2.9.3# modprobe fuse root@mikrojenkins:/usr/src# wget https://s3fs.googlecode.com/files/s3fs-1.74.tar.gz root@mikrojenkins:/usr/src# tar xzf s3fs-1.74.tar.gz root@mikrojenkins:/usr/src/s3fs-1.74# cd s3fs-1.74 root@mikrojenkins:/usr/src/s3fs-1.74#[…]

s3cmd on Windows

#s3cmd on Windows Install Python 2.7: https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi Add ;C:\Python27;C:\Python27\Scripts to PATH environment variable #setx /m PATH “%PATH%;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin” Download pip: https://bootstrap.pypa.io/get-pip.py python get-pip.py Install: http://files.gpg4win.org/gpg4win-2.2.1.exe #git clone https://github.com/s3tools/s3cmd.git c:\s3cmd Download and unpack: https://github.com/s3tools/s3cmd/archive/master.zip pip install python-dateutil pip install python-magic c:\s3cmd>python s3cmd –configure ERROR: Option –preserve is not yet supported on MS Windows[…]