Skip to content

Instantly share code, notes, and snippets.

View s1monj's full-sized avatar

Simon s1monj

View GitHub Profile
@s1monj
s1monj / whitebrick_mirth_send_to_sqs_channel_config.xml
Created September 9, 2022 00:18
Mirth channel XML to send messages to Amazon SQS
<channel version="4.1.0">
<id>84a0bbfe-72dd-43ca-b9d7-d0bdfdfbf606</id>
<nextMetaDataId>5</nextMetaDataId>
<name>SQS Test</name>
<description></description>
<revision>3</revision>
<sourceConnector version="4.1.0">
<metaDataId>0</metaDataId>
<name>sourceConnector</name>
<properties class="com.mirth.connect.connectors.file.FileReceiverProperties" version="4.1.0">
CREATE USER hasurauser WITH PASSWORD 'hasurapwd';
-- for demo purposes, see below for production:
-- https://hasura.io/docs/latest/graphql/core/deployment/postgres-requirements.html
ALTER USER hasurauser WITH SUPERUSER;
CREATE DATABASE pipelinedemo WITH OWNER hasurauser;
\c pipelinedemo
class MyApp < Sinatra::Base
FILE_PATHS = [
'document.pdf',
'movie.mov'
]
get "/zip" do
body = ZipStreamer.make_streaming_body(file_paths: file_paths)
headers = {'Transfer-Encoding' => 'chunked', 'Content-Disposition' => 'attachment; filename="myzip.zip"'}
[200,headers,body]
end
map "/tar" do
use RailsEnvConfigMiddleware
use Rack::Auth::Basic, "Private data" do |username, password|
User.auth(username,password)
end
run StreamTar
end
StreamTar = ->(env) {
hijack_proc = ->(socket) {
IO.popen("tar --to-stdout -c #{env['tar_path']}", external_encoding: Encoding::BINARY) do |tar_io|
@s1monj
s1monj / -rails_semantic_json_logging_viewing_lnav_aws_elastic_beanstalk.md
Last active October 21, 2019 14:15
Tailing JSON logs with lnav on AWS Elastic Beanstalk through eb ssh

Using Rails Semantic Logger for logging, JSON logs can be tailed on AWS Elastic Beanstalk with lnav JSON log viewer from an eb ssh command line session with this config.