Tuesday, July 16, 2024

Shell scripts with optional parameters


while [[ $# -gt 0 ]]; do

        key="$1"

        case $key in
                -m)
                        MVN_COMMANDS=$2
                        shift # past argument
                        shift # past argument
                        ;;
                -bp)
BUILD_DIR=$2
shift
shift
;;
                -sc)
SKIP_CPP=1
shift
;;
                *)    # unknown option
                        echo Usage "$APPNAME -m \"<maven commands="">\""
                        echo "                     -bp \"<build path="">\""
                        exit 2
                        ;;
        esac
done

Sunday, July 07, 2024

GPG useful commands

List secret keys

gpg2 --list-secret-keys -v --keyid-format=long --with-subkey-fingerprints
gpg2 -K -v --keyid-format=long --with-subkey-fingerprints

List public keys

gpg2 --list-keys -v --keyid-format=long --with-subkey-fingerprints
gpg2 -k -v --keyid-format=long --with-subkey-fingerprints

Edit keys

gpg2 --edit-key xxx

Generate new key

gpg --full-generate-key

Encrypt

tar cf - tmpfile | gpg2 -u xxxx -vaser xxxx - >> tmp14.tar.gpg

tar cf tmpefile.tar tmpfile
gpg2 -u xxxx -vaser xxxx tmpefile.tar >> tmp14.tar.gpg 

gpg2 -u xxxx -o tmp14.tar.gpg -vaser xxxx tmpefile.tar

Decrypt

gpg2 -d file3.txt >> file

Show keys in a file

gpg2 -v --keyid-format=long --with-subkey-fingerprints --show-keys gpg.key

Export keys

gpg2 --export -a -o <filename>
gpg2 --export-secret-keys -a -o <filename>

Thursday, September 26, 2019

Unit test ordering in maven

Sometimes your unit tests may give different results on different platforms and this might be caused by the order that maven runs your tests.
In Windows maven defaults to run tests in alphabetical order. This is not the case in Linux.
This can fortunately be changed.

<runOrder>String</runOrder>

Using the value "random" could be useful.

Wednesday, November 28, 2018

4 December is Microsoft Connect Day

Microsoft

Connect();
2018
Build the apps of tomorrow, today.

Tune in online on December 4, 2018 for a full day of dev-focused delight—including updates on Azure and Visual Studio, keynotes, demos, and real-time coding with experts—live from the Microsoft Azure and AI Conference.

Tuesday, November 27, 2018

Sunday, November 11, 2018

Quick guide to MongoDB

The most basic and common commands in MongoDB.

Sunday, October 28, 2018

JDK9 Migration guides

Here are a couple of good links to read when migrating to Java 9 or later

Oracle Code One 2018

The sessions I attended.

Oracle's Youtube page:
https://www.youtube.com/channel/UCdDhYMT2USoLdh4SZIsu_1g/videos

Code One page:

Wednesday, January 29, 2014

Coin Market Prices

Here's another good site to remember with a wide collection of crypocurrencies and their current value.