Skip to content

Instantly share code, notes, and snippets.

View Nullpo's full-sized avatar

Pablo Nullpo

  • Argentina
View GitHub Profile
@ansulev
ansulev / convert-crt-to-jks.sh
Created August 15, 2018 10:22
Convert .CRT y .KEY Certificates to JKS Keystore
# Convert it into pkcs12 format
openssl pkcs12 -export -out jenkins.p12 -inkey certificate.key -in certificate.crt -name "jenkins-cert"
# Create keystore if not exist
https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html
# Import
keytool -importkeystore -srckeystore jenkins.p12 -srcstoretype pkcs12 -destkeystore keystore.jks
@albans
albans / ActionTestHelper.java
Created June 18, 2012 13:21
Helper class for testing struts2 actions. The static block does the minimum wiring to avoid getText to crash. The inject method is helpful for injecting parameters to the tested action.
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@pkmishra
pkmishra / MTOMSoapClient.php
Created March 29, 2012 19:57
PHP SOAP client to handle mtom message encoding
/**
* This client extends the ususal SoapClient to handle mtom encoding. Due
* to mtom encoding soap body has test apart from valid xml. This extension
* remove the text and just keeps the response xml.
*/
class MTOMSoapClient extends SoapClient {
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
$response = parent::__doRequest($request, $location, $action, $version, $one_way);
//if resposnse content type is mtom strip away everything but the xml.