Skip to content

Instantly share code, notes, and snippets.

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

NguyenTheAnh daubac402

πŸ‡»πŸ‡³
πŸŽ„
View GitHub Profile
@daubac402
daubac402 / Create a self-issued HTTPS certificate for your site for testing (for eg: localhost).md
Last active July 16, 2025 23:52
Create a self-issued HTTPS certificate for your site for testing (for eg: localhost)

Create a self-issued HTTPS certificate for your site for testing (for eg: localhost)

Create the certificate (Output: public key cert + private key)

brew install mkcert
 
# First time
# If you want to add to Java as well, need to go to IntelliJ > Choose your project on the left side > F4 to open Project Structure > Project > SDK > Edit > Get the PATH to setup JAVA_HOME
# Eg: Mine is: /Users/your_name/Library/Java/JavaVirtualMachines/corretto-19.0.2/Contents/Home
@daubac402
daubac402 / How to fix podman machine stuck on "Currently starting".md
Last active July 16, 2025 23:40
How to fix podman machine stuck on "Currently starting"

How to fix podman machine stuck on "Currently starting"

Credit to https://camillehdl.dev/podman-machine-stuck-currently-starting/

If podman machine list (or Podman Desktop) shows your machine β€œCurrently starting” but it never actually starts, this might help you.

Steps

Find the file ~/.config/containers/podman/machine/applehv/<your podman machine name>.json (in my case, ~/.config/containers/podman/machine/applehv/podman-machine-default.json) and edit it.

@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 / 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