Prerequisites:
Software dependances
- aws-vault
- chamber
- eb cli
- aws cli
- jq
| # Setting up and using PostgreSQL with Rails on OS X | |
| # Allows you to use PostgreSQL instead of sqlite3, and have the same database type as Heroku | |
| # Install postgres using homebrew | |
| brew install postgres | |
| # Follow directions provided by postgres installation | |
| # Instructions for this part can be retrieved again using "brew info postgres" | |
| # This creates a default user according to your system name | |
| # If you encounter an error similar to this, then check out these helpful links |
| #!/bin/bash | |
| # settings the paths | |
| mirthPath="/opt/mirthconnect/" | |
| backupPath="/home/mirth/backups/" | |
| scriptPath=`pwd`"/" | |
| vDate=`date --date 'yesterday' +%Y-%m-%d` | |
| # generating console command | |
| echo exportcfg ${backupPath}mirth_backup-${vDate}.xml > ${scriptPath}backup_cmds |
| # alias aws vault | |
| alias awsv='aws-vault exec default -- ' | |
| Resources: | |
| sslSecurityGroupIngress: | |
| Type: AWS::EC2::SecurityGroupIngress | |
| Properties: | |
| GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
| IpProtocol: tcp | |
| ToPort: 443 | |
| FromPort: 443 | |
| CidrIp: 0.0.0.0/0 | |
First create ec2 Ubuntu instance
Then install all the things needed for Mirth Connect (following this video: http://www.youtube.com/watch?v=omZyAO2naqs)
# Update Ubuntu
sudo aptitude update
# Safe upgrade of Ubuntu
sudo aptitude safe-upgrade| //the Mirth file reader has a CSV file (now in the msg object) | |
| //be sure your channel's incoming data type is 'delimited text' | |
| //let's pretend this csv contains customers | |
| var customers = []; | |
| var header = msg.row[0]; | |
| for(var i=1;i<msg['row'].length();i++) | |
| { | |
| var cust = {}; | |
| for (col in msg.row[i].children()) { |
| //the Mirth file reader has a CSV file (now in the msg object) | |
| //be sure your channel's incoming data type is 'delimited text' | |
| //let's pretend this csv contains customers | |
| var customers = []; | |
| var header = msg.row[0]; | |
| for(var i=1;i<msg['row'].length();i++) | |
| { | |
| var cust = {}; | |
| for (col in msg.row[i].children()) { |
| # Migrate schema and data from Mongoid to MySQL ActiveRecord | |
| class MongoidMysqlMigrator | |
| def randomize_auto_increment_values(source_models, from=5500, to=10500) | |
| source_models.each do |model| | |
| value = rand(from-to)+from | |
| sql = %(ALTER TABLE #{model.name.tableize} AUTO_INCREMENT=#{value}) | |
| puts sql | |
| ActiveRecord::Base.connection.execute(sql) | |
| end |
| export default createApi; | |
| function createApi(options) { | |
| const basePath = '/api/v1'; | |
| const endpoint = options.endpoint || 'https://vtx-mock-api-server.herokuapp.com'; | |
| const cors = !!options.cors; | |
| const mode = cors ? 'cors' : 'basic'; | |
| const securityHandlers = options.securityHandlers || {}; | |
| const handleSecurity = (security, headers, params, operationId) => { | |
| for (let i = 0, ilen = security.length; i < ilen; i++) { | |
| let scheme = security[i]; |