Skip to content

Instantly share code, notes, and snippets.

#!/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

Prerequisites:

Software dependances

  • aws-vault
  • chamber
  • eb cli
  • aws cli
  • jq

Configure SSH Config

@bluengreen
bluengreen / Fragment
Created May 6, 2018 18:01
EB AWS Toolbox
# alias aws vault
alias awsv='aws-vault exec default -- '
@bluengreen
bluengreen / .ebextension-lets-encrypt.yaml
Created April 12, 2018 06:46 — forked from syamn/.ebextension-lets-encrypt.yaml
Let's Encrypt your Elastic Beanstalk single instance!
Resources:
sslSecurityGroupIngress:
Type: AWS::EC2::SecurityGroupIngress
Properties:
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
IpProtocol: tcp
ToPort: 443
FromPort: 443
CidrIp: 0.0.0.0/0
@bluengreen
bluengreen / mirth_setup.md
Created April 7, 2018 05:39 — forked from jgautsch/mirth_setup.md
Setting up Mirth Connect for production

Mirth Server Setup

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
@bluengreen
bluengreen / mirth-csv-to-array.js
Created April 7, 2018 05:38
Mirth CSV file to collection of JavaScript literals
//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()) {
@bluengreen
bluengreen / mirth-csv-to-array.js
Created April 7, 2018 05:38
Mirth CSV file to collection of JavaScript literals
//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()) {
@bluengreen
bluengreen / mongiod_mysql_migrator.rb
Created November 1, 2017 20:51 — forked from tomriley/mongiod_mysql_migrator.rb
Migrate a Mongoid / MongoDB database to an ActiveRecord based SQL one. One method to convert the schema, another to migrate data. Copes with most basic data types. Some hacks to infer TEXT columns. Converts embeds_one relationships to AR aggregations. I wrote this for a one-time migration. It could be a good starting point for someone doing the …
# 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];
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do