Compare commits
14 Commits
e3534bf144
...
main
Author | SHA1 | Date |
---|---|---|
sudo pacman -Syu | 1c4914a77c | |
sudo pacman -Syu | bd47bf529a | |
sudo pacman -Syu | cd1fc144ab | |
sudo pacman -Syu | 615031e84b | |
sudo pacman -Syu | 4bb77117ec | |
sudo pacman -Syu | 99375d56e1 | |
sudo pacman -Syu | defc8ea7c8 | |
sudo pacman -Syu | 7aae465cf0 | |
sudo pacman -Syu | 1f9660d9bc | |
sudo pacman -Syu | f1e7b934da | |
sudo pacman -Syu | 37dcc6cf80 | |
sudo pacman -Syu | 437bd685bc | |
sudo pacman -Syu | 15a3b0dc4b | |
sudo pacman -Syu | e4b6c61245 |
|
@ -41,6 +41,13 @@ Set default branch to `main`:
|
||||||
git config --global init.defaultBranch main
|
git config --global init.defaultBranch main
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Sign:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git config --global commit.gpgsign true
|
||||||
|
git config --global tag.gpgSign true
|
||||||
|
```
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
Prefer rebase when pull:
|
Prefer rebase when pull:
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
# [chrony](https://git.tuxfamily.org/chrony/chrony.git)
|
||||||
|
|
||||||
|
| Distribution | Package |
|
||||||
|
| ------------ | -------- |
|
||||||
|
| Arch Linux | `chrony` |
|
||||||
|
| Ubuntu | `chrony` |
|
||||||
|
|
||||||
|
## Network Time Security
|
||||||
|
|
||||||
|
https://developers.cloudflare.com/time-services/nts/
|
||||||
|
|
||||||
|
https://system76.com/time
|
||||||
|
|
||||||
|
Edit `/etc/chrony/chrony.conf`:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
server time.cloudflare.com iburst nts
|
||||||
|
server virginia.time.system76.com iburst nts
|
||||||
|
server ohio.time.system76.com iburst nts
|
||||||
|
server oregon.time.system76.com iburst nts
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
chronyc sources -v
|
||||||
|
sudo chronyc authdata -v
|
||||||
|
```
|
|
@ -10,22 +10,22 @@ Daily workflow:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Update modules
|
# Update modules
|
||||||
go get -u ./...
|
go get -d -u ./...
|
||||||
|
|
||||||
# Install module with chosen commit or version
|
# Add module with chosen commit or version
|
||||||
go get public.git.com/module@version
|
go get -d public.git.com/path/to/module@version
|
||||||
|
|
||||||
|
# Build and intall binary with latest version
|
||||||
|
go install public.git.com/path/to/module@latest
|
||||||
|
|
||||||
# Prune no longer used modules
|
# Prune no longer used modules
|
||||||
go mod tidy
|
go mod tidy
|
||||||
|
|
||||||
# Copy modules to local vendor directory
|
# Copy modules to local vendor directory (vendor is not recommend anymore)
|
||||||
go mod vendor
|
go mod vendor
|
||||||
```
|
|
||||||
|
|
||||||
Outside modules:
|
# Why use module
|
||||||
|
go mod why -m public.git.com/path/to/module
|
||||||
```sh
|
|
||||||
GOMODULE11=on go get example.com/foo/bar
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Update go version:
|
Update go version:
|
||||||
|
@ -34,20 +34,12 @@ Update go version:
|
||||||
go mod edit -go=1.XY
|
go mod edit -go=1.XY
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace module path and version pair:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go mod edit -replace old[@v]=new[@v]
|
|
||||||
```
|
|
||||||
|
|
||||||
Drop replace module path:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go mod edit -dropreplace old[@v]
|
|
||||||
```
|
|
||||||
|
|
||||||
In world of corporation, we work with private repository, add to `~/.bashrc`, `~/.zshrc`:
|
In world of corporation, we work with private repository, add to `~/.bashrc`, `~/.zshrc`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
export GOPRIVATE=private.git.com
|
export GOPRIVATE=private.git.com
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Thanks
|
||||||
|
|
||||||
|
- https://encore.dev/guide/go.mod
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
# [Go](https://golang.org/)
|
|
||||||
|
|
||||||
| Distribution | Package |
|
| Distribution | Package |
|
||||||
| ------------ | ---------------- |
|
| ------------ | ---------------- |
|
||||||
| Arch Linux | `go`, `go-tools` |
|
| Arch Linux | `go`, `go-tools` |
|
||||||
|
@ -13,20 +11,19 @@ export PATH="$PATH:$GOPATH/bin"
|
||||||
|
|
||||||
## Guideline
|
## Guideline
|
||||||
|
|
||||||
|
[Effective Go](https://go.dev/doc/effective_go)
|
||||||
|
|
||||||
[CommonMistakes](https://github.com/golang/go/wiki/CommonMistakes)
|
[CommonMistakes](https://github.com/golang/go/wiki/CommonMistakes)
|
||||||
|
|
||||||
[CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments)
|
[CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments)
|
||||||
|
|
||||||
[Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md)
|
[Uber Go Style Guide](https://github.com/uber-go/guide/blob/master/style.md)
|
||||||
|
|
||||||
[Thanos Coding Style Guide](https://thanos.io/contributing/coding-style-guide.md/)
|
## Helpful libraries
|
||||||
|
|
||||||
## Helpful
|
- https://github.com/matryer/moq
|
||||||
|
- https://github.com/golang/mock
|
||||||
[gomock](https://github.com/golang/mock)
|
- https://github.com/stretchr/testify
|
||||||
|
- https://github.com/mvdan/gofumpt
|
||||||
[goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports)
|
- https://github.com/golangci/golangci-lint
|
||||||
|
- https://github.com/fatih/vim-go
|
||||||
[GolangCI-Lint](https://github.com/golangci/golangci-lint)
|
|
||||||
|
|
||||||
[vim-go](https://github.com/fatih/vim-go)
|
|
||||||
|
|
|
@ -11,3 +11,13 @@ Unwrap error:
|
||||||
```go
|
```go
|
||||||
rootErr := errors.Unwrap(err)
|
rootErr := errors.Unwrap(err)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Compare error:
|
||||||
|
|
||||||
|
```go
|
||||||
|
// Don't
|
||||||
|
if err == CustomErr
|
||||||
|
|
||||||
|
// Do
|
||||||
|
if errors.Is(err, CustomErr)
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Hau Nguyen
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
|
@ -5,6 +5,7 @@
|
||||||
List fonts:
|
List fonts:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
# Linux
|
||||||
fc-list
|
fc-list
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -54,13 +55,39 @@ fc-list
|
||||||
|
|
||||||
[Iosevka](https://github.com/be5invis/Iosevka)
|
[Iosevka](https://github.com/be5invis/Iosevka)
|
||||||
|
|
||||||
| Distribution | Package |
|
|
||||||
| ------------ | ------------- |
|
|
||||||
| Arch Linux | `ttc-iosevka` |
|
|
||||||
|
|
||||||
[Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans)
|
[Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans)
|
||||||
|
|
||||||
| Distribution | Package |
|
| Distribution | Package |
|
||||||
| ------------ | ------------------------- |
|
| ------------ | ------------------------- |
|
||||||
| Arch Linux | `ttf-fantasque-sans-mono` |
|
| Arch Linux | `ttf-fantasque-sans-mono` |
|
||||||
| Ubuntu | `fonts-fantasque-sans` |
|
| Ubuntu | `fonts-fantasque-sans` |
|
||||||
|
|
||||||
|
[Recursive Sans & Mono](https://github.com/arrowtype/recursive)
|
||||||
|
|
||||||
|
[agave](https://github.com/blobject/agave)
|
||||||
|
|
||||||
|
| Distribution | Package |
|
||||||
|
| ------------ | ------------- |
|
||||||
|
| Ubuntu | `fonts-agave` |
|
||||||
|
|
||||||
|
[APL385 Unicode](https://apl385.com/fonts/index.htm)
|
||||||
|
|
||||||
|
[Cozette](https://github.com/slavfox/Cozette)
|
||||||
|
|
||||||
|
[Victor Mono](https://github.com/rubjo/victor-mono)
|
||||||
|
|
||||||
|
[Martian Mono](https://github.com/evilmartians/mono)
|
||||||
|
|
||||||
|
[mononoki](https://github.com/madmalik/mononoki)
|
||||||
|
|
||||||
|
[Hermit](https://github.com/pcaro90/hermit)
|
||||||
|
|
||||||
|
| Distribution | Package |
|
||||||
|
| ------------ | ---------------- |
|
||||||
|
| Ubuntu | `fonts-mononoki` |
|
||||||
|
|
||||||
|
## Wallpapers
|
||||||
|
|
||||||
|
[elementary Wallpapers](https://github.com/elementary/wallpapers)
|
||||||
|
|
||||||
|
[System76](https://system76.com/merch/desktop-wallpapers)
|
||||||
|
|
|
@ -26,13 +26,7 @@ ls /sys/firmware/efi/efivars
|
||||||
|
|
||||||
#### Connect to the internet
|
#### Connect to the internet
|
||||||
|
|
||||||
Use [iwd](https://wiki.archlinux.org/index.php/Iwd).
|
For wifi, use [iwd](https://wiki.archlinux.org/index.php/Iwd).
|
||||||
|
|
||||||
#### Update the system clock
|
|
||||||
|
|
||||||
```sh
|
|
||||||
timedatectl set-ntp true
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Partition the disks
|
#### Partition the disks
|
||||||
|
|
||||||
|
@ -104,33 +98,31 @@ mount -o compress=zstd /dev/root_partition /mnt
|
||||||
mount /dev/RootGroup/rootvol /mnt
|
mount /dev/RootGroup/rootvol /mnt
|
||||||
|
|
||||||
# efi
|
# efi
|
||||||
mkdir /mnt/efi
|
mount --mkdir /dev/efi_system_partition /mnt/efi
|
||||||
mount /dev/efi_system_partition /mnt/efi
|
|
||||||
|
|
||||||
# boot
|
# boot
|
||||||
mkdir /mnt/boot
|
mount --mkdir /dev/extended_boot_loader_partition /mnt/boot
|
||||||
mount /dev/extended_boot_loader_partition /mnt/boot
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pacstrap /mnt base linux linux-firmware
|
pacstrap -K /mnt base linux linux-firmware
|
||||||
|
|
||||||
# AMD
|
# AMD
|
||||||
pacstrap /mnt amd-ucode
|
pacstrap -K /mnt amd-ucode
|
||||||
|
|
||||||
# Intel
|
# Intel
|
||||||
pacstrap /mnt intel-ucode
|
pacstrap -K /mnt intel-ucode
|
||||||
|
|
||||||
# Btrfs
|
# Btrfs
|
||||||
pacstrap /mnt btrfs-progs
|
pacstrap -K /mnt btrfs-progs
|
||||||
|
|
||||||
# LVM
|
# LVM
|
||||||
pacstrap /mnt lvm2
|
pacstrap -K /mnt lvm2
|
||||||
|
|
||||||
# Text editor
|
# Text editor
|
||||||
pacstrap /mnt neovim
|
pacstrap -K /mnt neovim
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configure
|
### Configure
|
||||||
|
@ -188,6 +180,7 @@ myhostname
|
||||||
Edit `/etc/mkinitcpio.conf`:
|
Edit `/etc/mkinitcpio.conf`:
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
|
# LVM
|
||||||
# https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Adding_mkinitcpio_hooks
|
# https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Adding_mkinitcpio_hooks
|
||||||
HOOKS=(base udev ... block lvm2 filesystems)
|
HOOKS=(base udev ... block lvm2 filesystems)
|
||||||
|
|
||||||
|
@ -250,7 +243,7 @@ useradd -m -G wheel -s /usr/bin/zsh -c "The Joker" joker
|
||||||
passwd joker
|
passwd joker
|
||||||
```
|
```
|
||||||
|
|
||||||
[systemd-homed](https://wiki.archlinux.org/index.php/Systemd-homed):
|
[systemd-homed (WIP)](https://wiki.archlinux.org/index.php/Systemd-homed):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
systemctl enable systemd-homed.service
|
systemctl enable systemd-homed.service
|
||||||
|
@ -278,16 +271,16 @@ pacman -Syu xorg-server
|
||||||
```sh
|
```sh
|
||||||
pacman -Syu gnome-shell \
|
pacman -Syu gnome-shell \
|
||||||
gnome-control-center gnome-system-monitor \
|
gnome-control-center gnome-system-monitor \
|
||||||
gnome-terminal gnome-backgrounds gnome-screenshot gnome-keyring \
|
gnome-tweaks gnome-backgrounds gnome-screenshot gnome-keyring gnome-logs \
|
||||||
nautilus xdg-user-dirs-gtk file-roller \
|
gnome-console gnome-text-editor \
|
||||||
evince eog
|
nautilus xdg-user-dirs-gtk file-roller evince eog
|
||||||
|
|
||||||
# Login manager
|
# Login manager
|
||||||
pacman -Syu gdm
|
pacman -Syu gdm
|
||||||
systemctl enable gdm.service
|
systemctl enable gdm.service
|
||||||
```
|
```
|
||||||
|
|
||||||
#### [KDE](https://wiki.archlinux.org/title/KDE)
|
#### [KDE (WIP)](https://wiki.archlinux.org/title/KDE)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pacman -Syu plasma-meta \
|
pacman -Syu plasma-meta \
|
||||||
|
@ -326,7 +319,7 @@ https://wiki.archlinux.org/index.php/Silent_boot
|
||||||
|
|
||||||
https://wiki.archlinux.org/title/Improving_performance#Watchdogs
|
https://wiki.archlinux.org/title/Improving_performance#Watchdogs
|
||||||
|
|
||||||
https://wiki.archlinux.org/title/Reflector
|
https://wiki.archlinux.org/title/PRIME
|
||||||
|
|
||||||
## In the end
|
## In the end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue