I hereby claim:
- I am danielromero on github.
- I am danielromero (https://keybase.io/danielromero) on keybase.
- I have a public key ASBxCKptskvGkbX3002uMvlQV6LnK2eO41UfnOWApGyF8go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| # Get all hosts (change regex to fit your structure) | |
| targets=($(cap production ec2:status | egrep -o "ec2.*com")) | |
| for host in `echo $targets` | |
| do | |
| echo fetching logs from ${host} | |
| # Command to execute (example, download logs from all machines) | |
| scp ubuntu@${host}:/var/www/my_app_name/shared/log/production.log ./production${host}.log | |
| done | |
| echo done! |
| #!/usr/bin/env ruby | |
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'etc' | |
| # home user path | |
| home_path = Etc.getpwnam(Etc.getlogin).dir | |
| wallpaper_folder = "#{home_path}/Pictures/wallpapers" |
| <% if !flash.blank? %> | |
| <% if flash[:notice] %> | |
| <div class="alert alert-success auto_close"> | |
| <div aria-hidden="true" class="close" data-dismiss="alert"> | |
| <div class="fa fa-times"></div> | |
| </div> | |
| <div class="fa fa-check"></div> | |
| <%= raw flash[:notice] %> | |
| </div> | |
| <% end %> |
| module SessionsHelper | |
| def sign_in(user) | |
| logger.debug "Starting session..." | |
| reset_session | |
| remember_token = SecureRandom.urlsafe_base64.to_s | |
| create_session_cookie(remember_token) | |
| user.update_attribute(:remember_token, Digest::SHA2.hexdigest(remember_token)) | |
| current_user = user | |
| logger.debug "Session started for #{user.class.to_s} with id #{user.id}" |