Jul 16, 2024

Maven

Configure settings.xml

$ cat ~/.m2/settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>...</id>
<username>...</username>
<password>...</password>
</server>
<server>
<id>...</id>
<username>...</username>
<password>...</password>
</server>
</servers>
</settings>

Setup path

$ cat .profile | tail
...
export MAVEN_PATH=/home/user/BUILD_ENV/MAVEN/LATEST
export PATH=${PATH}:${MAVEN_PATH}/bin

Apr 9, 2024

JKS

Show content

$ keytool -v -list -keystore test.jks

Generate aes key

$ keytool -genseckey -alias aes-key-1 -keyalg aes -keysize 128 -storetype jceks -keystore ks.jks
$ keytool -genseckey -alias aes-key-2 -keyalg aes -keysize 128 -storetype pkcs12 -keystore ks.p12

Import the pkcs12 into jks

$ keytool -importkeystore -srckeystore aes-ks.p12 -destkeystore aes-ks.jks -srcstoretype pkcs12 -alias aes-key-2

Import jks into pkcs12

$ keytool -importkeystore -srckeystore aes-ks.jks -destkeystore aes-ks.p12 -srcstoretype jceks -alias aes-key-1

Delete key from keystore by alias

$ keytool -delete -alias aes-key-2 -keystore aes-ks.jks

Apr 2, 2024

DNS

Name request to a specific Domain Name Server

$ dig @8.8.8.8 www.google.com

Feb 20, 2024

Gradle

Installation

Download Gradle and extract it to /usr/gradle/

Configuration

Set PATH to extracted archive

$ vim ~/.profile

export GRADLE_PATH=/usr/gradle/7.x
export PATH=${PATH}:${GRADLE_PATH}/bin

$ source ~/.profile

Build

$ ./gradlew build -x test

Clean

$ ./gradlew clean --quiet

Feb 15, 2024

Idea

 1. Download archive with Idea from official website.

2. Copy it to special folder

    $ sudo mkdir /usr/idea

    $ sudo cp ~/Downloads/ideaIC-2023.3.4.tar.gz /usr/idea

    $ rm ~/Downloads/ideaIC-2023.3.4.tar.gz

3. Unpack the archive

    $ cd /usr/idea

    $ sudo tar xvfz ideaIC-2023.3.4.tar.gz

    $ sudo rm ideaIC-2023.3.4.tar.gz

4. Add environment variable

    $ vim ~/.profile

    export IDEA_HOME=/usr/idea/idea-IC-233.14475.28

    export PATH=${PATH}:${IDEA_HOME}/bin

5. Apply changes

    $ source ~/.profile

6. Start Idea

     $ idea.sh

7. Create Desktop Entry

Settings (gear) > Create Desktop Entry...


Feb 12, 2024

Foundation DB

Installation

$ sudo dpkg -i foundationdb-clients_*.deb foundationdb-server_*.deb

Check connection to DB

$ fdbcli

Using cluster file `/etc/foundationdb/fdb.cluster'.

The database is available.

Welcome to the fdbcli. For help, type `help'.

fdb>

Configure TLS for server side

Up to root privs

$ sudo su

Edit fdb.cluster file

$ vim /etc/foundationdb/fdb.cluster

<some symbols>:<some symbols>@127.0.0.1:4500:tls

Check connection to DB by TLS

$ fdbcli

ERROR: fdbcli is not configured with TLS, but all of the coordinators have TLS addresses.

Generate certs

$ cd ~

$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out cert.crt

$ cat cert.crt private.key > fdb.pem

Copy certs to FDB dir

$ sudo cp * /etc/foundationdb/

$ chmod +r /etc/foundationdb/private.key

Edit FDB conf

$ sudo vim  /etc/foundationdb/foundationdb.conf

...
[fdbserver.4500]
Public - address = 127.0.0.1:4500: TLS
listen-address = public
tls_certificate_file = /etc/foundationdb/fdb.pem
tls_ca_file = /etc/foundationdb/cert.crt
tls_key_file = /etc/foundationdb/private.key
tls_verify_peers= Check.Valid=0
...

Configure TLS for client side

Check connection by TLS

$ fdbcli -C /etc/foundationdb/fdb.cluster --tls_certificate_file /etc/foundationdb/cert.crt --tls_ca_file /etc/foundationdb/cert.crt --tls_verify_peers "Check.Valid=0" --tls-key-file /etc/foundationdb/private.key

Using cluster file `/etc/foundationdb/fdb.cluster'.

The database is available.

Welcome to the fdbcli. For help, type `help'.

fdb>

Configure ENV variables for client side

$ export FDB_TLS_CERTIFICATE_FILE=/etc/foundationdb/cert.crt
$ export FDB_TLS_CA_FILE=/etc/foundationdb/cert.crt
$ export FDB_TLS_KEY_FILE=/etc/foundationdb/private.key
$ export FDB_TLS_VERIFY_PEERS=Check.Valid=0

Check connection by TLS

$ fdbcli

Using cluster file `/etc/foundationdb/fdb.cluster'.

The database is available.

Welcome to the fdbcli. For help, type `help'.

fdb>


Kubernetes

kubectl installation $ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl...