Skip to content

Instantly share code, notes, and snippets.

execute "unattended-upgrades" do
command "unattended-upgrades"
only_if 'grep security /var/lib/update-notifier/updates-available'
end
<html>
<head>
<script type="text/javascript">
function init() {
var video = document.getElementById("video");
video.addEventListener('pause', stopLogging, false);
video.addEventListener('playing', startLogging, false);
console.log("READY");
}
function stopLogging() {
@rectalogic
rectalogic / index.html
Last active December 11, 2015 22:18
Play a video on iPhone, toggle between playing and pausing when device is shaken.
<html>
<head>
<script type="text/javascript">
if (typeof window.DeviceMotionEvent != 'undefined') {
// Shake sensitivity (a lower number is more)
var sensitivity = 20;
// Position variables
var x1 = 0, y1 = 0, z1 = 0, x2 = 0, y2 = 0, z2 = 0;
@rectalogic
rectalogic / gist:6322397
Created August 23, 2013 18:21
daemonize2
Running:
uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13703 1 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13704 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13705 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13706 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
ubuntu 13707 13703 0 18:19 ? 00:00:00 uwsgi --daemonize2 /tmp/pippo -M -p 4 -s :3031 --touch-logreopen /tmp/foobar
# master

ADT Dropbox

Cureatr can accept encrypted HL7 ADT batch files uploaded via sftp to our dropbox server. Cureatr has two dropbox servers, playdrop.play.aws.cureatr.com is our internal staging (play) environment and dropbox.live.aws.cureatr.com is our production (live) environment.

Cureatr will need an ssh public key file for each of these environments to provision sftp accounts for an institution, and will provide the sftp login username to the institution.

Each HL7 file should contain one or more ADT message separated by newline \n and with each segment within the message separated by carriage return \r. The file should be encrypted and BASE64 encoded using OpenSSL: openssl enc -aes-256-cbc -a -in <hl7-file> -out <hl7-file-enc>

title = self.wait_for_visible_element(By.NAME, 'Title')
self.driver.execute_script("mobile: tap", {"element": title.id, "x": 0.5, "y": 0.5})
@rectalogic
rectalogic / Slide.glsl
Last active March 17, 2016 22:31 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
// Converted from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/Slide/Slide.frag
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
// Slide Down: translateX = 0, translateY = -1
@rectalogic
rectalogic / CrossZoom.glsl
Last active March 25, 2022 05:10 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
// Converted from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/CrossZoom/CrossZoom.frag
// Which is based on https://github.com/evanw/glfx.js/blob/master/src/filters/blur/zoomblur.js
// With additional easing functions from https://github.com/rectalogic/rendermix-basic-effects/blob/master/assets/com/rendermix/Easing/Easing.glsllib
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
import zipfile
import sys
class StreamFile(object):
def __init__(self, fileobj):
self.fileobj = fileobj
self.pos = 0
def write(self, str):
import uuid
from pylons import response
@login_required_json
@jsonify2
def test_stream(self):
for i in range(10000):
response.body_file.write(u"{0} {1}\n".format(i, str(uuid.uuid4())))