Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻

Jan Philipp knalli

👨‍💻
View GitHub Profile
@knalli
knalli / Jenkinsfile
Last active Apr 27, 2020
Jenkinsfile with custom function for reading a file as environment variables
View Jenkinsfile
node {
stage('Demo') {
echo "Hello world"
withConfigEnv('env') {
echo "Here we go:"
sh "printenv"
}
}
}
View jstatd.service
# /etc/systemd/system/jstatd.service
#
# Install:
# - Put this file on /etc/systemd/system/jstatd.service
# - Rewrite <host ip>
#
# Usage:
# sudo systemctl enable jstatd
# sudo systemctl start jstatd
#
@knalli
knalli / CheckActiveDirectoryConnectionViaLdap_ForSpringSecurity.java
Created Jan 17, 2018
Checks whether the given setup with user credentials are valid for authentication (quick check)
View CheckActiveDirectoryConnectionViaLdap_ForSpringSecurity.java
import javax.naming.NamingException;
import javax.naming.spi.NamingManager;
import java.util.Hashtable;
public class CheckActiveDirectoryConnectionViaLdap_ForSpringSecurity {
public static void main(String... args) throws NamingException {
Hashtable<String, String> table = new Hashtable<>();
table.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory");
table.put("java.naming.provider.url", "ldap://$HOST:389");
View ApiGateway1.java
@MessagingGateway
public interface ApiGateway {
@Gateway(requestChannel = "requestChannel", replyChannel = "resultChannel")
Response handle(Request request);
}
@knalli
knalli / install-pcp.sh
Created Oct 30, 2015 — forked from johanstenberg92/install-pcp.sh
Install Performance Co-Pilot on Amazon Linux AMI
View install-pcp.sh
#!/bin/sh
if [ "$(id -u)" != "0" ]; then
echo "Sorry, you are not root."
exit 1
fi
if !(type pcp 2>/dev/null;) then
yum -y install git bison flex gcc-c++ perl-Tk-devel libmicrohttpd-devel
git clone git://git.pcp.io/pcp
View PilightWebsocket.js
'use strict';
let Service = require("HAP-NodeJS").Service;
let Characteristic = require("HAP-NodeJS").Characteristic;
let WebSocketClient = require('websocket').client;
class Utils {
assertUtf8Message(message) {
return new Promise((resolve, reject) => {
if (message.type === 'utf8') {
@knalli
knalli / 030_modify_plist.sh
Last active Sep 17, 2015 — forked from flpwgr/030_modify_plist.sh
Cordova Hook for App Transport Security iOS 9
View 030_modify_plist.sh
#!/bin/bash
PLIST=platforms/ios/*/*-Info.plist
cat << EOF |
Add :NSAppTransportSecurity dict
Add :NSAppTransportSecurity:NSAllowsArbitraryLoads bool YES
EOF
while read line
do
@knalli
knalli / gist:27527a8841a878e1e0f8
Last active Aug 29, 2015
Jenkins, Xcode, Github, Testflight/Hockey on a Mac Mini
View gist:27527a8841a878e1e0f8
  • Buy a mac mini
  • Install 10.8
  • Create a user account for Jenkins
  • Install xcode
  • Turn on screen sharing
  • Turn off energy save sleeping
  • Login as your jenkins user
  • Use ssh-keygen to create a key for github
  • Create a github account for your build machine
  • Add the key to your build machine github account
@knalli
knalli / OraclePhysicalNamingStrategy.java
Created Jul 12, 2015
Hibernate 5 PhysicalNamingStrategy (untested), Java8
View OraclePhysicalNamingStrategy.java
package de.knallisworld.hibernate5;
import org.hibernate.boot.model.naming.Identifier;
import org.hibernate.boot.model.naming.PhysicalNamingStrategy;
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
import java.util.Optional;
import java.util.StringTokenizer;
@knalli
knalli / wrapper.babel.js
Last active Aug 29, 2015
angular-vertxbus ES6 Comparsion
View wrapper.babel.js
"use strict";
var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = pr
You can’t perform that action at this time.