Skip to content

Instantly share code, notes, and snippets.

View ppazos's full-sized avatar
🌎
All around

Pablo Pazos Gutiérrez ppazos

🌎
All around
View GitHub Profile
@ppazos
ppazos / webServer.groovy
Created June 30, 2023 01:35 — forked from renatoathaydes/webServer.groovy
A simple web server written in Groovy that provides static and code-generated content
#!/usr/bin/env groovy
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.*
import groovy.servlet.*
@Grab(group='org.eclipse.jetty.aggregate', module='jetty-all', version='7.6.15.v20140411')
def startJetty() {
def server = new Server(8080)
@ppazos
ppazos / paths_to_trees.groovy
Last active August 16, 2023 21:52
openEHR data paths to trees
import groovy.json.*
// NOTE: the prefix / was removed to help the recursion, this step could be done before starting of it can be part of the first recursion
def data = [
"name",
"category",
"context/setting",
"context/start_time",
"content(3)/data/origin",
"content(3)/data/events(1)/time",
@chunrapeepat
chunrapeepat / uptime-chart.js
Last active March 9, 2023 03:37
Uptime Chart -> Chronological timeline format (ECharts)
var data = [];
var dataCount = 20;
var startTime = +new Date();
var categories = ['14/2/2020'];
var types = [
{name: 'Offline', color: 'red'},
{name: 'Online', color: 'green'},
];
// Generate mock data
@ppazos
ppazos / git_branch_in_terminal_prompt.sh
Last active September 15, 2022 01:31
add this to the end of the .bashrc and for git repos it will show the current branch in the command prompt of the terminal
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \[\033[00m\]\[\033[32;1m\]\[\033[42m\]$(parse_git_branch)\[\033[00m\] $ '
@docwhat
docwhat / profiling.groovy
Last active September 23, 2022 15:46
In Groovy profiling
#!/usr/bin/env groovy
// This works in Jenkinsfiles without approving any scripts.
class MyProfiler {
def timings
def dsl
MyProfiler(dsl) {
this.timings = [:]
@jonbartels
jonbartels / Managing SSL Connections in MC.md
Last active January 13, 2026 13:25
Mirth Connect has many ways to manage SSL connections. This gist provides a primer on how to manage them. Edits, contributions, and corrections are appreciated!

Mirth Connect is awesome! One common question on the forums and Slack is how to manage SSL connctions. These questions mainly focus on HTTPS but also include TCP connections.

Best Practice

Switch to https://openintegrationengine.org/. The open source fork of Mirth Connect.

Open Integration Engine comes (with a free TLS plugin)[https://openintegrationengine.org/free-tls-plugin-update-2025-12-19/]. It supports more modern best practices for certificate management, has a better UI, and is freely available under an open-source license.

Historical Notes

@Bogdaan
Bogdaan / compress.sh
Created September 18, 2019 08:35
Creating password protected gzip files from command line
# encrypt
tar cz my_folder/ | openssl enc -aes-256-cbc -e > encrypted.tar.gz.enc
# decrypt
openssl aes-256-cbc -d -in encrypted.tar.gz.enc | tar xz
^((?:19|20)[0-9]{2})(?:(1[0-2]|0[1-9])(?:(3[0-1]|[1-2][0-9]|0[1-9])(?:([0-1][0-9]|2[0-3])(?:([0-5][0-9])(?:([0-5][0-9](?:\.[0-9]{1,4})?)?)?)?)?)?)?([+-](?:[0-1][0-9]|2[0-3])[0-5][0-9])?$
curl -X POST \
http://178.62.71.220:8080/rest/v1/template/ \
-H 'Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=' \
-H 'Content-Type: application/xml' \
-H 'Ehr-Session: sessionId:127.0.0.1-guest-1548250494478-1031674849-11061' \
-d '<?xml version="1.0" encoding="utf-8"?>
<!--Operational template XML automatically generated by Ocean Template Designer Version 2.8.94Beta-->
<template xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.openehr.org/v1">
<language>
<terminology_id>
package mygrailsapp
import grails.converters.JSON
import org.springframework.security.authentication.AccountExpiredException
import org.springframework.security.authentication.CredentialsExpiredException
import org.springframework.security.authentication.DisabledException
import org.springframework.security.authentication.LockedException
import org.springframework.security.web.WebAttributes
import org.springframework.security.web.authentication.session.SessionAuthenticationException
import org.springframework.web.servlet.support.RequestContextUtils