Skip to content

Instantly share code, notes, and snippets.

View daubac402's full-sized avatar
πŸ‡»πŸ‡³
πŸŽ„

NguyenTheAnh daubac402

πŸ‡»πŸ‡³
πŸŽ„
View GitHub Profile
@daubac402
daubac402 / JavaPassByValueTest.java
Created May 23, 2025 03:01
Java Pass By Value Test
import java.util.*;
public class MyClass {
public static void main(String args[]) {
ArrayList<String> a = new ArrayList<>();
add1(a,"1");
System.out.println("a:" + a); // Guess the output
add2(a,"2");
@daubac402
daubac402 / Setup WDS on TpLink Archer C6.md
Last active May 22, 2025 23:44
Setup WDS on TpLink Archer C6
@daubac402
daubac402 / How to fix podman machine stuck on Currently starting.md
Created May 12, 2025 00:26
How to fix podman machine stuck on "Currently starting"

How to fix podman machine stuck on "Currently starting"

  1. Find the file ~/.config/containers/podman/machine/applehv/<your podman machine name>.json (In my case: podman-machine-default.json)
  2. Near the end of the file, change "Starting":true to "Starting":false
  3. Back to your Podman and restart it.
@daubac402
daubac402 / NextCloud in Snap in Raspberry Pi tips.md
Last active March 15, 2024 01:23
NextCloud in Snap in Raspberry Pi tips

NextCloud in Snap in Raspberry Pi tips

Installation

sudo apt-get update
sudo apt-get upgrade

sudo apt install snapd

Liquibase CLI notes

Installation

https://www.liquibase.com/download

Preparation

Download database driver (.jar file) then put it in /your_liquibase_installation_path/lib

Make Java project works with Self-signed certificate in IntelliJ

Problem

Your company is using a proxy to decrypt the HTTPS in between. It has a self-signed certificate. You will get this kind of Exception when sending a HTTPS request if your Java project doesn't have that self-signed certificate in its CaCerts

detailed message sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
@daubac402
daubac402 / make-github-copilot-works-with-self-certificate-in-IntelliJ-Windows.md
Last active September 14, 2023 07:29
Make Github copilot works with self-certificate in IntelliJ (Windows)

Make Github copilot works with self-certificate in IntelliJ (Windows)

Problem

You can't login to Github to use Github Colpilot in your IntelliJ due to you are using self-certificate.
And you got this error message

Sign in failed. Reason: Request signInInitiate failed with message: self signed certificate in certificate chain, request id: 3, error code: -32603
@daubac402
daubac402 / Git revert to a previous tag then push to origin-master.md
Created December 7, 2022 08:31
Git revert to a previous tag then push to origin:master

Git revert to a previous tag then push to origin:master

There are 2 ways to do that

Reset the HEAD then force push to remote

$ git checkout master
$ git pull
$ git reset --hard tag_ABC
@daubac402
daubac402 / install-docker.md
Created May 23, 2022 02:42 β€” forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@daubac402
daubac402 / git.migrate
Created January 28, 2022 04:57 β€” forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.