Skip to content

Instantly share code, notes, and snippets.

View moberwasserlechner's full-sized avatar

Michael Oberwasserlechner moberwasserlechner

View GitHub Profile
@moberwasserlechner
moberwasserlechner / Configure CSP for Ionic PWA.md
Last active May 17, 2017 06:39
How to score 100+ on Mozilla's observatory with your Ionic 3 PWA

Observatory by Mozilla

Content Security Policy

Security Header

Inline

Webserver

You should be aware that Security configured in a webserver specific file like htaccess will not be recognized by ionic serve in your local testing environment. So error only popup on production or staging environments in the field.

@moberwasserlechner
moberwasserlechner / nginx.conf
Created October 6, 2016 07:31
Default nginx.conf for AWS Elastic Beanstalk with Tomcat 2.2.0
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
@moberwasserlechner
moberwasserlechner / JCIFSEngine.java
Last active August 29, 2022 15:29
SPNEGO with NTLM is required if you want to authenticate with a MS Dynamics NAV 2009. I'm using various authentication mechanismns from "org.apache.httpcomponents:httpclient:4.2.3". But SPNEGO with NTLM is not supported out of the box. Copiing HttpClient's NTLMScheme and making some changes has done the trick.
import java.io.IOException;
import jcifs.ntlmssp.NtlmFlags;
import jcifs.ntlmssp.Type1Message;
import jcifs.ntlmssp.Type2Message;
import jcifs.ntlmssp.Type3Message;
import jcifs.util.Base64;
import org.apache.http.impl.auth.NTLMEngine;
import org.apache.http.impl.auth.NTLMEngineException;
@moberwasserlechner
moberwasserlechner / tomcat7
Last active December 10, 2015 09:38 — forked from baylisscg/tomcat7
#!/bin/sh
#
# /etc/init.d/tomcat7 -- startup script for the Tomcat 7 servlet engine
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.
# Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>.
# Additional improvements by Jason Brittain <jason.brittain@mulesoft.com>.
#