Skip to content

Instantly share code, notes, and snippets.

View thukim's full-sized avatar
🍓

Kimmie thukim

🍓
  • Ho Chi Minh city, Vietnam
View GitHub Profile
namespace :aws do
task :set_bucket_objects_permission do
AWS.config(access_key_id: ENV['AWS_ACCESS_KEY_ID'], secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], region: 'ap-southeast-1', :s3 => { :region => 'ap-southeast-1' })
bucket = AWS::S3.new.buckets[ENV['S3_BUCKET_NAME']]
if bucket.exists?
bucket.objects.each do |object|
puts object.key
object.acl = :public_read
# subdomains.rake in /lib/tasks
namespace :subdomains do
desc "adds the necessary hosts to your /etc/hosts file from current subdomains in your application"
task :setup => :environment do
# NOTE: default_hosts is used as a locator for the line to update in /etc/hosts
tmp_file, changed = '/tmp/etc_hosts_copy', false
default_hosts, hosts = %w(blog.local emptyblog.blog.local), []
# find all the subdomains used in your app (push to hosts array) - modify this to suit your app