Skip to content

Instantly share code, notes, and snippets.

export DOWNLOADPAGE=$(curl http://www.oracle.com/technetwork/java/javase/downloads/index.html | grep server-jre9-downloads | sed 's/.*\(server-jre9-downloads-[[:digit:]]*.html\).*/\1/')
export DOWNLOADURL=$(curl -b "oraclelicense=accept-securebackup-cookie" http://www.oracle.com/technetwork/java/javase/downloads/$DOWNLOADPAGE | grep _linux-x64_bin.tar.gz | sed 's/.*\(http:\/\/download.oracle.com.*serverjre.*_linux-x64_bin.tar.gz\).*/\1/')
curl -L -C - -b "oraclelicense=accept-securebackup-cookie" -O $DOWNLOADURL
@paulbrodner
paulbrodner / start-app-powershell
Created March 1, 2018 11:37
start-app-powershell
Start-Process -FilePath "C:\Program Files (x86)\VMware\CobraWinLDTP\CobraWinLDTP.exe" -Verb runas
@paulbrodner
paulbrodner / whitesource-scan-differed-projects.sh
Last active December 6, 2018 13:18
do a whitesource scan on an array of projects
#!/usr/bin/env bash
# places relative to root - current folder
places=("enterpriseprojects/"
"modules/sharepoint/amp"
"packaging"
"packaging/distribution"
"packaging/distribution-docker/"
"packaging/file-transfer-receiver"
"packaging/installer/"
@paulbrodner
paulbrodner / get_version_from_pom.sh
Last active November 4, 2019 08:28
Get version from pom.xml
mvn help:evaluate -Dexpression=project.version -q -DforceStdout -pl .
VERSION=$(mvn help:evaluate -Dexpression=project.version | grep -e '^[^\[]')
# or
grep version pom.xml | grep -v -e '<?xml|~'| head -n 1 |awk -F '[><]' '{print $3}'
# or multiple version (get second version)
package org.baeldung.rest;
import java.io.IOException;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
@paulbrodner
paulbrodner / whitesource-maven.sh
Last active July 16, 2018 12:48
WhiteSource Maven scan
echo "starting whitesource scan"
mvn org.whitesource:whitesource-maven-plugin:update -Dorg.whitesource.product=Paul-SearchS-maven -Dorg.whitesource.orgToken=$WHITESOURCE_API_KEY -Dorg.whitesource.ignorePomModules=false -Dorg.whitesource.ignoredScopes=test
echo "starting whitesource scan with File System Agent"
#https://whitesource.atlassian.net/wiki/spaces/WD/pages/33718339/File+System+Agent#FileSystemAgent-Prerequisites
# download first https://s3.amazonaws.com/file-system-agent/whitesource-fs-agent-18.6.3.jar
java -jar whitesource-fs-agent-18.6.3.jar -apiKey $WHITESOURCE_API_KEY -d packaging/target/alfresco-search-services
find . -name "*.jar" -type f -printf "%f\n" |sort | uniq -c > jars.txt
#count
find . -name "*.jar" -type f -printf "%f\n" |sort | uniq -c | wc -l >> jars.txt
=IF(COUNTIF(Inventory!A$2:A$229,A1),"Yes","No")
check if value from A1 exist in range: Inventory!A$2:A$229
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.paulbrodner</groupId>
<artifactId>my-dummy-pom</artifactId>
<version>1.0</version>
<build>
<plugins>
<plugin>