Skip to content

Instantly share code, notes, and snippets.

View aldaris's full-sized avatar

Peter Major aldaris

  • Identity Fusion
  • Bristol, United Kingdom
  • X @majorpetya
View GitHub Profile
import org.apache.wicket.request.Request;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.Url.QueryParameter;
import org.apache.wicket.request.component.IRequestablePage;
import org.apache.wicket.request.mapper.MountedMapper;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.mapper.parameter.PageParametersEncoder;
import org.apache.wicket.util.string.Strings;
/**
import java.net.*;
/**
* Usage: java -Djavax.net.ssl.trustStore=/path/to/cacerts -Djavax.net.ssl.trustStorePassword=changeit HttpsCertChecker
*/
public class HttpsCertChecker {
public static void main(String[] args) throws Exception {
URL url = new URL("https://stewie.sch.bme.hu");
url.openConnection().getInputStream();
}
@aldaris
aldaris / jenkins+artifactory
Last active December 17, 2015 16:59
Jenkins+Artifactory notes
How the Jenkins build works:
To debug the start of the Maven build go for MavenModuleSetBuildExecution#doRun.
Basically during job start some of the extensions are called to create these build properties file that contains lots of information on where to deploy and what, the same set of data hence should be available when actually running the build. (becomes a temp file in tempdir), after it's set up.
ProcessCache#MavenProcess constructor is a good place to actually see the maven-agent3 starting cli command, although it should be logged in build console as well.
At somewhere very low on the stack a ProcessCache#call method will be invoked.
Basically when you do a Maven build that will kick off a new process running using the Maven3Main class from maven3-agent, and uses TCP connections to share data across the processes. On the forked process side you can look at Maven3Launcher class, where it will actually invoke the Maven3 execute method, after that you just run the build nicely from Maven itself.
Artifactor
@aldaris
aldaris / AES-research.txt
Last active December 26, 2015 17:49
Links for AES research
http://stackoverflow.com/questions/1220751/how-to-choose-an-aes-encryption-mode-cbc-ecb-ctr-ocb-cfb
http://stackoverflow.com/questions/19626080/aes-with-password-based-secretkeyspec-vs-pbe
http://www.rfc-editor.org/rfc/rfc2898.txt section 4
http://stackoverflow.com/questions/8622367/what-are-best-practices-for-using-aes-encryption-in-android
and my pending question:
http://stackoverflow.com/questions/19626080/aes-with-password-based-secretkeyspec-vs-pbe
http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html
http://stackoverflow.com/questions/8320100/java-encryption-by-client-and-decryption-by-server-using-pbkdf2withhmacsha1-and
@aldaris
aldaris / jbossadmin
Created October 28, 2014 11:12
Making WildFly a little bit more usable
#!/bin/bash
WILDFLY_HOME=/Users/aldaris/wildfly-8.1.0.Final
CONNECT_EXCEPTION=ConnectException
RUNNING=running
function usage {
echo "Usage: jbossadmin start|stop|restart [<counter>]"
echo "If <counter> is absent, 1 is assumed"
exit -1
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* modify the Session object so that it tracks when it was last refreshed and when one asks for timeleft/etc fields, it would take that time difference into account instead of forcing people to refresh sessions even during cache period.
* make XUI CSP friendly
* change push authentication to display a code in both browser and app to allow end-users correlate authentication requests
* Write credential storage system a'la Jenkins
* Come up with a special token/name that can be used in SAML and OAuth2/OIDC settings that maps to the user's group/role/filteredrole memberships (retrieved via idrepo APIs)
* Move openam-auth-securid to an external project as an extension
* Create LDAPConnectionFactoryBuilder
* Update @UpgradeStepInfo (or create a new annotation even for service helpers) to contain metadata about which version the step is necessary for - get rid of legacy upgrade steps.
@aldaris
aldaris / buildDJ3.sh
Created March 31, 2017 18:43
Shell script to build OpenDJ 3.0.0 from opendj-public repository
#!/bin/bash
function build() {
mvn clean install
if [ $? -ne 0 ] ; then
exit 1;
fi
}
mkdir commons
@aldaris
aldaris / buildAM13.sh
Created April 4, 2017 08:05
Shell script to build OpenAM 13.0.0 from openam-public repository
#!/bin/bash
#Run buildDJ3.sh script first in the same folder from: https://gist.github.com/aldaris/fe234d76f3940c42ae9bb5aa69b8e98e
function build() {
mvn clean install
if [ $? -ne 0 ] ; then
exit 1;
fi
}
@aldaris
aldaris / vim-tips
Last active April 19, 2017 21:42
vim tips
b - back a word
w - go to next word
e - go to the end of the current word
d - delete
y - copy
0 - go to the beginning of line
$ - go to the end of the line
o - insert new line and turn on editor mode
a - editor mode and move cursor one character (append)
i - editor mode and leave cursor at location (insert)