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
require 'uri' | |
require 'net/http' | |
class TwilioMessage | |
def initialize(options = {}) | |
@account_sid = ENV.fetch('TWILIO_ACCOUNT_SID') | |
@account_token = ENV.fetch('TWILIO_AUTH_TOKEN') | |
@message_service_sid = ENV.fetch('TWILIO_MSID') |
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
import { Injectable } from '@angular/core'; | |
@Injectable() | |
export class AppSettingsProvider { | |
endPoint: string; | |
baseUrl: string; | |
mode: string; | |
constructor() { |
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
Attempt to run an auto-backup script from DigitalOcean Ubuntu Droplet (running Ruby on Rails app) on PostGres database. | |
1. Setup s3cmd | |
S3cmd will upload the backup files generated. | |
The `sync` command will be executed after the autopostgresqlbackup script finished it's job (added on the POSTBACKUP command). | |
Follow the steps enumerated in https://levels.io/backup-linode-digital-ocean-vps-amazon-s3/ until the recusive part: | |
s3cmd sync --recursive --preserve /your-folder-name-to-backup s3://nameofyours3bucket | |
2. Setup AutoPostGresqlBackup | |
Follow the instructions in the `Installing and configuring autopostgresqlbackup in CentOS 7` from: |
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 attempt_login | |
authorized_user = User.authenticate(params[:username], params[:hashed_password]) | |
unless authorized_user.eql?(false) | |
session[:user_id] = authorized_user.id | |
session[:username] = authorized_user.username | |
case authorized_user.account_type | |
when "admin" | |
redirect_to :action => "index" | |
when "it" | |
redirect_to :action => "it" |