Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block henrik242

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
if [ $# -lt 3 ]; then
echo "Usage: maven-deploy-file groupId artifactId version [packaging] [repository]"
exit 1
henrik242 /
Last active Dec 17, 2015
Checks for upcoming expiry of SSL certificates, e.g. HTTPS or LDAPS. Useful for cron jobs and server monitoring.
EXPIRE=$(openssl s_client -connect $SERVER 2>/dev/null </dev/null | openssl x509 -noout -enddate | cut -d= -f2)
DAYS=$((( $(date --date "${EXPIRE}" +%s) - $(date +%s) ) / 86400));
[ $DAYS -lt $WARNDAYS ] && echo "WARNING: SSL certificate for $SERVER expires in $DAYS days"
henrik242 / Target monitor selector for
Last active Sep 26, 2017
Target monitor selector for XBMC
View Target monitor selector for

Target monitor selector for XBMC

I have a TV and a projector connected to my Mac Mini media center, and can choose either screen by using these scripts.

The scripts overwrite advancedsettings.xml in XBMC's userdata folder. I got the required data by configuring XBMC for each target screen, and diffing the resulting guisettings.xml files afterwards.

  • xbmc-for-tv.command

    My Samsung 1080p LED TV needs a -250 ms audio delay, and is the main display. It's hooked up to the Mini DisplayPort output.

henrik242 /
Created Feb 17, 2012
Productivity improving firewall script for MacOSX / BSD
## Requires pwgen, wc, sed, host, ipfw, sudo
henrik242 /
Created Dec 22, 2011
Disable validation of SSL certificates in Java
public static void disableCertificateValidation() {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {}
henrik242 / p4merge
Last active Mar 24, 2019
Helper script for p4merge and Git on MacOSX
View p4merge
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/ "${absargs[@]}"
You can’t perform that action at this time.