This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/ssh' | |
require 'highline/import' | |
def get_password | |
ask( "Enter Password: " ) {|q| q.echo = '*'} | |
end | |
def remote_sudo host, ssh_user, command, opts={} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def download_zip(image_list) | |
unless image_list.blank? | |
file_name = 'pictures.zip' | |
stringio = Zip::ZipOutputStream::write_buffer do |z| | |
z.put_next_entry("empty_folder/") ## Create a folder | |
image_list.each do |img| | |
title = img.title | |
title += '.jpg' unless title.end_with?('.jpg') |