Skip to content

Instantly share code, notes, and snippets.

View xtrasimplicity's full-sized avatar

Andrew xtrasimplicity

  • Melbourne, Australia
View GitHub Profile
Aug 09, 2017 8:01:56 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8051"]
Aug 09, 2017 8:01:56 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Aug 09, 2017 8:01:56 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Aug 09, 2017 8:01:56 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.12
Aug 09, 2017 8:01:56 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
@xtrasimplicity
xtrasimplicity / gist:85a2a4b718dc44a90a2658f51f1895f4
Created August 31, 2017 05:40
OpenMRS - General patient overview - Stacktrace
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:167)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
at org.openmrs.Concept_$$_jvstb1f_11.getUuid(Concept_$$_jvstb1f_11.java)
at org.openmrs.BaseOpenmrsObject.equals(BaseOpenmrsObject.java:89)
at sun.reflect.GeneratedMethodAccessor632.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
@xtrasimplicity
xtrasimplicity / gist:eef1a73b6b3782db37a2b78b0b0faed8
Created September 1, 2017 02:06
OpenMRS - Bahmni endTB 1.5.0 (Bahmni 0.85) - Hibernate SessionFactory freeze
Sep 01, 2017 12:01:29 PM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/'. The path [openmrs] does not meet these criteria and has been changed to [/openmrs]
Sep 01, 2017 12:01:30 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8050"]
Sep 01, 2017 12:01:30 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Sep 01, 2017 12:01:30 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Sep 01, 2017 12:01:30 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.12
@xtrasimplicity
xtrasimplicity / gist:bbbc829f2be02dc25c6eeb942ffab151
Last active October 25, 2017 20:41
OpenMRS - Reports -- After manually creating the `bahmni_reports` database using an official Bahmni vagrant box as a template. Origin issue: https://talk.openmrs.org/t/unsatisfied-dependency-exception-whilst-running-reports/12731/4
<!DOCTYPE html><html><head><title>Apache Tomcat/8.0.12 - Error report</title><style type="text/css">H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}.line {height: 1px; background-color: #525D76; border: none;}</style> </head><body><h1>HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception</h1><div class="line"></div><p><b>type</b> Exception report</p><p><b>message</b> <u>Servlet.init() for servlet dispatcher threw exception</u></p><p><b>description</b> <u>The server encountered an inter
@xtrasimplicity
xtrasimplicity / bahmni_reports_structure.sql
Last active October 27, 2017 01:39
Base `bahmni_reports` database structure for Bahmni v0.85. NOTE: This does NOT include the default "report cleaner" cron job!
-- MySQL dump 10.13 Distrib 5.6.34, for Linux (x86_64)
--
-- Host: localhost Database: bahmni_reports
-- ------------------------------------------------------
-- Server version 5.6.34
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@xtrasimplicity
xtrasimplicity / papercut_os-x_automated_launchd_deployment.rb
Last active June 1, 2018 09:21
Automated Launchd plist file deployment for the PaperCut OS X client. (Automates https://www.papercut.com/kb/Main/MacClientStartupWithLaunchd)
#!/usr/bin/env ruby
require 'fileutils'
abort "You must run this command as root." unless Process.uid === 0
PLIST_FILE = 'com.papercut.client.plist'.freeze # The path to your com.papercut.client.plist file
PLIST_DESTINATION_PATH = '/Library/LaunchAgents/'.freeze
puts "Deploying launch configuration..."
puts "---> Copying plist file to #{PLIST_DESTINATION_PATH}..."
@xtrasimplicity
xtrasimplicity / securepay_au_directpost_fingerprint_example.rb
Last active June 1, 2018 09:14
Generating a fingerprint for SecurePay Australia's DirectPost integration.
require 'openssl'
raw_fingerprint = [merchant_id, merchant_password, transaction_type, reference_id, amount, timestamp].join('|')
digest = OpenSSL::Digest.new('sha256')
fingerprint = OpenSSL::HMAC.hexdigest(digest, merchant_password, raw_fingerprint)
@xtrasimplicity
xtrasimplicity / Dockerfile
Last active January 8, 2022 01:25
Thinking Sphinx + Rails + Docker
FROM debian AS build
WORKDIR /tmp
RUN apt-get update && \
apt-get install --no-install-recommends -y curl && \
curl http://sphinxsearch.com/files/sphinx-3.2.1-f152e0b-linux-amd64.tar.gz -o sphinx.tar.gz && \
mkdir sphinx && \
tar xfz sphinx.tar.gz -C sphinx/ && \
rm sphinx.tar.gz && \
rm -rf /var/lib/apt/lists/*
@xtrasimplicity
xtrasimplicity / dmesg.txt
Created February 12, 2020 03:51
dmesg output (filtered by evdi and drm) for https://github.com/DisplayLink/evdi/issues/186
[ 5619.089195] evdi: [V] copy_primary_pixels:164 copy rect 0,0-2560,1440
[ 5619.097472] [drm:drm_ioctl [drm]] pid=13097, dev=0xe202, auth=1, EVDI_REQUEST_UPDATE
[ 5619.097476] evdi: [V] evdi_painter_request_update_ioctl:883 Painter lock
[ 5619.097477] evdi: [V] evdi_painter_request_update_ioctl:896 Painter unlock
[ 5619.106633] [drm:evdi_map_dma_buf [evdi]] [DEV:0000:00:02.0] size:14745600 dir=0
[ 5619.107606] evdi: [V] evdi_painter_set_scanout_buffer:943 Painter lock
[ 5619.107608] evdi: [V] evdi_painter_set_scanout_buffer:948 Painter unlock
[ 5619.107624] evdi: [V] evdi_painter_mark_dirty:494 Painter lock
[ 5619.107626] evdi: [V] evdi_painter_mark_dirty:504 (dev=1) 0,0-2560,1440
[ 5619.107627] evdi: [V] evdi_painter_mark_dirty:519 Painter unlock
@xtrasimplicity
xtrasimplicity / script.ps1
Created August 19, 2020 03:04
PowerShell: Automatically remove Disabled users from an array of groups
# Define the groups to work with
$groups = @("My AD Group Name", "My other AD Group Name");
foreach($groupName in $groups) {
$members = Get-ADGroupMember -Identity $groupName | Where { $_.objectClass -eq "user" }
foreach($member in $members) {
$user = Get-ADUser -Identity $member.SamAccountName -Properties Enabled
if ($user.Enabled -eq $false) {