Posts

Showing posts from April, 2024

secure transmit sensitive data over the internet with RSA encrypt & decrypt algorithm in node.js via 'crypto'

Image
To securely transmit sensitive data over the internet, such as passwords for login, it's crucial to encrypt or hash the data. HTTPS alone may not be enough. The process involves generating a key pair on the server backend, consisting of a public key and a private key. The server keeps the private key secure and sends the public key to the client as a cookie. On the client side, the public key is used to encrypt data, such as passwords, before sending it to the server. When the server receives th   ...

use Self hosted runners in github workflow action

Image
once you migrated your repos into github. you might want to set up some workflow actions whenever there is something changed on the github repo. In the actions, you might try invoking some APIs which is not public faced but internal private ones to do some checkup such as checkmarx scan. If you use github default runners, which is ubuntu-latest, you might encounter errors like could not resolve host. 0curl: (6) Could not resolve host: your.internal.host.com Use self-hosted runners here you a   ...

get the github.event json and branch name in github Actions workflow scripts

Image
Assuming you want to run checkmarx scan on any push event to make sure the codes committed do not have major secruity concerns. You can set up a workflow like below: name: Trigger Checkmarx Scan Workflow on: push: branches-ignore: - main - master - develop jobs: checkmarxscan: runs-on: linux steps: - name: Trigger Checkmarx Scan env: checkmarx_scan_webhook : yourwebhookjenkinsjoburl=&checkmarxProjectId= project_name: yourche   ...

git fetch error in jenkins pipeline, use skipDefaultCheckout and dir directive for the fix

Image
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress git@github.com:xxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128: stdout: stderr: ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Double confirm the repo url and credentials used for git command you might see the above errors sometimes in your Jenkins pipeline. the error message might b   ...

react native run on android Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.Jj: java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null

Image
Today I would like to continue my react native app development work. After I run npm start , I got below quite strange error. I build the app via android studio, no build issue. Quite strange problem. Caused by: java.util.concurrent.ExecutionException: com.android.tools.r8.internal.Jj: java.lang.NullPointerException: Cannot invoke "String.length()" because "" is null Caused by: com.android.builder.dexing.DexArchiveBuilderException: Error while dexing. at com.android.builder.dexing.D8De   ...