Skip to content

Instantly share code, notes, and snippets.

View ChristianLutz's full-sized avatar

Christian ChristianLutz

  • inovel systeme AG
  • Germany
View GitHub Profile
@birkhoff
birkhoff / tycho_build-SNAPSHOT.gradle
Created May 18, 2012 14:49
Tycho Gradle Build Script
apply plugin: 'base'
import groovy.io.FileType
tychoVersion = "0.14.1"
try{
workspacePath = workspacePath
}catch(MissingPropertyException e){
workspacePath = "../"
import requests
from requests.auth import HTTPBasicAuth
import re
from StringIO import StringIO
JIRA_URL = 'https://your-jira-url.tld/'
JIRA_ACCOUNT = ('jira-username', 'jira-password')
# the JIRA project ID (short)
JIRA_PROJECT = 'PRO'
GITLAB_URL = 'http://your-gitlab-url.tld/'
@amccarty
amccarty / CORS config for jetty
Created July 15, 2016 17:09
CORS config for jetty
# /path/to/server/solr-webapp/webapp/WEB-INF/web.xml
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
<param-name>allowedOrigins</param-name>
<param-value>http://localhost*</param-value>
</init-param>
<init-param>
@thomasdarimont
thomasdarimont / KeycloakClientAuthExample.java
Last active July 22, 2024 15:52
Retrieve and verify AccessToken with Keycloak Client.
package de.tdlabs.keycloak.client;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.keycloak.OAuth2Constants;
import org.keycloak.RSATokenVerifier;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.common.VerificationException;
import org.keycloak.jose.jws.JWSHeader;
import org.keycloak.representations.AccessToken;
@mudlee
mudlee / tcpudp.java
Created May 3, 2017 17:52
Java & Vert.x UDP & TCP
tcpServer = vertx.createNetServer(new NetServerOptions().setPort(SERVER_PORT).setSsl(false).setHost(SERVER_HOST).setReuseAddress(true));
tcpServer.connectHandler(socket -> {
LOGGER.debug("[TCP] connection from {}:{}", socket.remoteAddress().host(), socket.remoteAddress().port());
socket.handler(buffer -> {
String data = new String(buffer.getBytes());
LOGGER.debug("[TCP] data receiving from {}:{}, length is {}, data: {}", socket.remoteAddress().host(), socket.remoteAddress().port(), buffer.length(), data);
Optional<NetworkCommand> command = NetworkCommandParser.parse(data);
if (!command.isPresent()) {
return;
@joeljeske
joeljeske / patch-android-studio-check.js
Created April 2, 2018 14:40
Fixes android plugin install that fail because it cannot find AndroidManifest.xml
/**
* This hook overrides a function check at runtime. Currently, cordova-android 7+ incorrectly detects that we are using
* an eclipse style project. This causes a lot of plugins to fail at install time due to paths actually being setup
* for an Android Studio project. Some plugins choose to install things into 'platforms/android/libs' which makes
* this original function assume it is an ecplise project.
*/
module.exports = function(context) {
if (context.opts.cordova.platforms.indexOf('android') < 0) {
return;
}
@xmeng1
xmeng1 / wsl2-network.ps1
Created July 14, 2019 06:50
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}