Skip to content

Instantly share code, notes, and snippets.

View daubac402's full-sized avatar
🇻🇳
🎄

NguyenTheAnh daubac402

🇻🇳
🎄
View GitHub Profile
@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.
@daubac402
daubac402 / CentOS-Base.repo for CentOS 6, using vault.centos.org instead of mirror.centos.org.repo
Last active May 21, 2023 01:36
CentOS-Base.repo for CentOS 6, using vault.centos.org instead of mirror.centos.org
# vim /etc/yum.repos.d/CentOS-Base.repo
# Because mirror.centos.org now doesn't support CentOS, we use vault.centos.org instead
# Change version "6.4" with your CentOS 6.x version: rpm -q centos-release
# Some old CentOS 6 server has old SSL so that it can't connect to https site, so need to add: "sslverify=0"
[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/6.4/os/$basearch/
gpgcheck=1
@daubac402
daubac402 / Setup DKIM on Postfix Mail server.txt
Last active February 24, 2022 01:59
Setup DKIM on Postfix Mail server.txt
$ MYDOMAIN=yourdomain.com
$ mkdir -p /etc/mail/dkim-keys/$MYDOMAIN
$ cd /etc/mail/dkim-keys/$MYDOMAIN
$ opendkim-genkey -t -s mail -d $MYDOMAIN
# if opendkim-genkey command is not found, install it#
# Eg: With Centos 7:
$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum install -y opendkim
@daubac402
daubac402 / AWS - EC - EBS - Expand xvda + Mount xvdb to CentOS
Last active May 27, 2022 09:51
AWS - EC - EBS - Expand /dev/xvda + Make an Amazon EBS volume (/dev/xvdb) available for use to CentOS
# Check current partitions status
lsblk
# Expand /dev/xvda from 8GB (default) to your current EBS size (please increase your EBS volume in AWS Console then run these below commands)
sudo yum install -y epel-release
sudo yum install -y cloud-utils-growpart
growpart /dev/xvda 1
reboot
# Make an Amazon EBS volume available for use on Linux (for eg: /dev/xvdb)