Skip to content

Instantly share code, notes, and snippets.

View tkaczenko's full-sized avatar
🎯
Focusing

Andrii Tkachenko tkaczenko

🎯
Focusing
View GitHub Profile
@tkaczenko
tkaczenko / work-with-multiple-git-accounts.md
Created March 25, 2024 15:15
Work With Multiple Git accounts

Work With Multiple Git accounts

Generate SSH key

Github

Full instruction is here.

  1. Run command.
@tkaczenko
tkaczenko / preparing-backup-for-sqls.md
Last active March 25, 2024 14:17
Preparing backup for SQLs

Preparing backup for SQLs

Let's image a situation when you need to run some SQLs manually on PRODUCTION environment. Before applying any changes on PRODUCTION, It's always better to prepare backups and rollbacks for the affected data if you would need to return the previous changes.

Backup

One of the possible ways to prepare a backup is storing the affected data into the backup table. Your user should be able to create new tables.

@tkaczenko
tkaczenko / run-e2e-on-win-via-wsl.md
Last active March 25, 2024 14:19
How to run e2e on Windows with specific Chrome via WSL?

How to run e2e on Windows via WSL

Install X server

It allows to run Chrome in WSL and show the Chrome window on Windows.

  1. Download and install vcxsrv

  2. Run it. Most settings can be left by default except for the next one.

  3. Make sure to check to Disable access control

@tkaczenko
tkaczenko / merge-from-one-git-to-another.md
Last active March 25, 2024 14:21
How to merge changes from one repository to another one?

How to merge changes from one Git repository to another one?

For example, we need to migrate the Github (old) repository to Bitbucket (new) repository and we need to keep both of them for a while.

To do it we need to make the next steps

  1. Git clone Bitbucket (new) repository
 git clone git@bitbucket.org/example.git
@tkaczenko
tkaczenko / git-settings.md
Last active March 25, 2024 14:21
Correct settings for Git for Unix, Windows

Correct settings for Git for Unix, Windows

You can find that you haven't made any useful changes in the repository, but Git thinks that you did: the diff is in CRLF to LF or opposite. In general, this issue occurs for Windows.

In Windows, it's better to set

git config --global core.autocrlf false

In Unix-like system (Linux, MacOS), it's better to set

@tkaczenko
tkaczenko / cert-path-validator-exception.md
Last active March 25, 2024 14:22
CertPathValidatorException: Algorithm constraints check failed on keysize limits: RSA 1024 bit key used with certificate: CN=SSL_Self_Signed_Fallback

How to resolve CertPathValidatorException: Algorithm constraints check failed on keysize limits: RSA 1024 bit key used with certificate: CN=SSL_Self_Signed_Fallback?

Root cause of this issue lies on diferrences between SSL certificate and specified Java security policies.

The simpliest way to resolve it is disabling crypto-policies alignment, but It might be not a solution in some cases:

-Djava.security.disableSystemPropertiesFile=true

In my case, It was a solution.

@tkaczenko
tkaczenko / !-ssl-certificates.md
Last active March 25, 2024 14:26
SSL certificates in Java

SSL certificates in Java

How to setup SSL certificate in Java to establish secure connection (HTTPS etc.)?

  1. Get the SSL certificate (public key, ssl.crt) to the resource
    • Download it (ssl.crt) via your browser. For example, you can use this article
    • Download it (ssl.crt) with openssl
    openssl s_client -showcerts -connect secure.veris.net:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > ssl.crt
@tkaczenko
tkaczenko / wsl-temporary-failure-in-name-resolution.md
Last active March 25, 2024 14:25
WSL2: Temporary Failure in Name Resolution
@tkaczenko
tkaczenko / current-subscriptions.component.spec.ts
Created December 11, 2020 16:55
How to make Angular component testing? (Mocking, Observable, Emitters)
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CurrentSubscriptionsComponent } from './current-subscriptions.component';
import { BaseReportConfig, CoverageConfig, QbePoliciesReportPeriod, ReportType, ResidentType } from '../../../models/report-config';
import {
DayOfWeek,
MomentOfMonth,
Periodicity,
ReportSubscriptionBasePeriodicity,
ReportSubscriptionConfig,
@tkaczenko
tkaczenko / DataConnection.java
Last active January 18, 2020 22:25
Чтение данных биометрического паспорта (на примере id-карты Украины) с использованием NFC ридера и JMRTD / Reading data from biometric passport (for example, Ukrainian ePassport or Ukrainian ID) using NFC reader with JMRTD
package com.github.tkaczenko.cardreader.service;
import lombok.RequiredArgsConstructor;
import net.sf.scuba.smartcards.CardServiceException;
import org.jmrtd.PACEKeySpec;
import org.jmrtd.PassportService;
import org.jmrtd.lds.CardAccessFile;
import org.jmrtd.lds.PACEInfo;
import org.jmrtd.lds.SecurityInfo;
import org.slf4j.Logger;