This file contains hidden or 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
| CallDataRecord.find_each do |cdr| | |
| next if cdr.file.attached? | |
| cdr_url = "https://s3-ap-southeast-1.amazonaws.com/cdr.somleng.org/store/#{cdr.file_id}" | |
| cdr.file.attach( | |
| io: open(cdr_url), | |
| filename: cdr.file_filename, | |
| content_type: cdr.file_content_type | |
| ) | |
| end |
This file contains hidden or 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
| # On Elastic Beanstalk machine | |
| yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-libs-11.4-1PGDG.rhel6.x86_64.rpm | |
| yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-11.4-1PGDG.rhel6.x86_64.rpm | |
| yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-6-x86_64/postgresql11-server-11.4-1PGDG.rhel6.x86_64.rpm | |
| pg_dump --version | |
| EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir) | |
| EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |
This file contains hidden or 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 "net/http" | |
| require "uri" | |
| require "pry" | |
| require "link-header-parser" # https://github.com/jgarber623/link-header-parser-ruby | |
| require "time" | |
| SOURCE_HOST = "https://dashboard.ews1294.info" | |
| SOURCE_API_KEY = "[your API key]" | |
| DESTINATION_HOST = "https://scfm.somleng.org" |
This file contains hidden or 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 "csv" | |
| require "httparty" | |
| DATA_FILE = "tmp/phone_test.csv".freeze | |
| API_ENDPOINT = "https://scfm.somleng.org/api/contact_data".freeze | |
| API_KEY = "REPLACE_ME".freeze | |
| def update_contact!(row) | |
| response = HTTParty.post( | |
| API_ENDPOINT, |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Say voice="Polly.Ricardo" language="pt-BR">Hello World</Say> | |
| <Say voice="Polly.Vitoria" language="pt-BR">Hello World</Say> | |
| </Response> |
This file contains hidden or 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 "csv" | |
| require "httparty" | |
| DATA_FILE = "tmp/maap_numbers.csv".freeze | |
| API_ENDPOINT = "https://scfm.somleng.org/api/contact_data".freeze | |
| API_KEY = "REPLACE_ME_WITH_SCFM_API_KEY".freeze | |
| def create_contact!(row) | |
| response = HTTParty.post( | |
| API_ENDPOINT, |
This file contains hidden or 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
| p SensorEvent.where("payload->>'created_at' = '0000-00-00 00:00:00 UTC+7'").delete_all | |
| p SensorEvent.where("payload->'created_at' is not null").update_all("created_at = (payload->>'created_at')::timestamp without time zone") |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Play>https://s3.ap-southeast-1.amazonaws.com/audio.ews1294.info/9a7fee16-9d09-48fd-a25e-d0ade953d947-SampleAudio.mp3</Play> | |
| </Response> |
This file contains hidden or 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 | |
| RESULTS_FILE = "test_mt_results.json" | |
| ACCOUNT_SID = "REPLACE_ME" | |
| AUTH_TOKEN = "REPLACE ME" | |
| CALLER_ID = "345" | |
| require 'httparty' | |
| results = {} |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Say>Please record your message after the tone</Say> | |
| <Record action="https://requestb.in/1m351lo1" recordingStatusCallback="https://requestb.in/ysgqk6ys"/> | |
| </Response> |