Remove passphrase from ssh private key
To remove passphrase from an existing key, we can use ssh-keygen with -p option. Here is an example which changes passphrase of private rsa key read more
How to check if an ssh key has passphrase
To check if an ssh key has passphrase, one can look for the presence of ENCRYPTED string in the private key. Here is an example read more
Use netcat (nc) to check if a remote port is reachable
Netcat (nc) can be use to check if a remote port is reachable and client can connect to it. The following commands were tried on read more
Java System.out.format examples
System.out.format method format multiple arguments based on format string. Basic example print integer 8 characters in width print float with 2 digits after decimal point
Java System.out.print and println
System.out.println example println will append a new line after the string. System.out.print example print will not append a new line after the string.
Java – equals vs ==
String method equals check if both references points objects with same values stored in them. Operator == check if both references points to same object.
Java – array basics
Initialize arrat and print length Access element at specific index Access non existing index This will throw Index Out Of Bounds Exception
Linux – ssh agent forwarding when using bastion host
When using a bastion host (or Jumpbox) to connection to production server using ssh private keys, ssh agent forward can be used. The main advantage read more
Java – compare strings
Case sensitive comparison Compare strings using firstString.compareTo(secondString). Positive outcome means firstString > secondString and so on. Case insensitive comparison – compareToIgnoreCase