Compare commits

...

14 Commits

8 changed files with 135 additions and 60 deletions

View File

@ -41,6 +41,13 @@ Set default branch to `main`:
git config --global init.defaultBranch main
```
Sign:
```sh
git config --global commit.gpgsign true
git config --global tag.gpgSign true
```
## Commands
Prefer rebase when pull:

View File

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

View File

@ -10,22 +10,22 @@ Daily workflow:
```sh
# Update modules
go get -u ./...
go get -d -u ./...
# Install module with chosen commit or version
go get public.git.com/module@version
# Add module with chosen commit or 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
go mod tidy
# Copy modules to local vendor directory
# Copy modules to local vendor directory (vendor is not recommend anymore)
go mod vendor
```
Outside modules:
```sh
GOMODULE11=on go get example.com/foo/bar
# Why use module
go mod why -m public.git.com/path/to/module
```
Update go version:
@ -34,20 +34,12 @@ Update go version:
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`:
```sh
export GOPRIVATE=private.git.com
```
## Thanks
- https://encore.dev/guide/go.mod

View File

@ -1,5 +1,3 @@
# [Go](https://golang.org/)
| Distribution | Package |
| ------------ | ---------------- |
| Arch Linux | `go`, `go-tools` |
@ -13,20 +11,19 @@ export PATH="$PATH:$GOPATH/bin"
## Guideline
[Effective Go](https://go.dev/doc/effective_go)
[CommonMistakes](https://github.com/golang/go/wiki/CommonMistakes)
[CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments)
[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
[gomock](https://github.com/golang/mock)
[goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports)
[GolangCI-Lint](https://github.com/golangci/golangci-lint)
[vim-go](https://github.com/fatih/vim-go)
- https://github.com/matryer/moq
- https://github.com/golang/mock
- https://github.com/stretchr/testify
- https://github.com/mvdan/gofumpt
- https://github.com/golangci/golangci-lint
- https://github.com/fatih/vim-go

View File

@ -11,3 +11,13 @@ Unwrap error:
```go
rootErr := errors.Unwrap(err)
```
Compare error:
```go
// Don't
if err == CustomErr
// Do
if errors.Is(err, CustomErr)
```

21
LICENSE Normal file
View File

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

View File

@ -5,6 +5,7 @@
List fonts:
```sh
# Linux
fc-list
```
@ -54,13 +55,39 @@ fc-list
[Iosevka](https://github.com/be5invis/Iosevka)
| Distribution | Package |
| ------------ | ------------- |
| Arch Linux | `ttc-iosevka` |
[Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans)
| Distribution | Package |
| ------------ | ------------------------- |
| Arch Linux | `ttf-fantasque-sans-mono` |
| 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)

View File

@ -26,13 +26,7 @@ ls /sys/firmware/efi/efivars
#### Connect to the internet
Use [iwd](https://wiki.archlinux.org/index.php/Iwd).
#### Update the system clock
```sh
timedatectl set-ntp true
```
For wifi, use [iwd](https://wiki.archlinux.org/index.php/Iwd).
#### Partition the disks
@ -104,33 +98,31 @@ mount -o compress=zstd /dev/root_partition /mnt
mount /dev/RootGroup/rootvol /mnt
# efi
mkdir /mnt/efi
mount /dev/efi_system_partition /mnt/efi
mount --mkdir /dev/efi_system_partition /mnt/efi
# boot
mkdir /mnt/boot
mount /dev/extended_boot_loader_partition /mnt/boot
mount --mkdir /dev/extended_boot_loader_partition /mnt/boot
```
### Installation
```sh
pacstrap /mnt base linux linux-firmware
pacstrap -K /mnt base linux linux-firmware
# AMD
pacstrap /mnt amd-ucode
pacstrap -K /mnt amd-ucode
# Intel
pacstrap /mnt intel-ucode
pacstrap -K /mnt intel-ucode
# Btrfs
pacstrap /mnt btrfs-progs
pacstrap -K /mnt btrfs-progs
# LVM
pacstrap /mnt lvm2
pacstrap -K /mnt lvm2
# Text editor
pacstrap /mnt neovim
pacstrap -K /mnt neovim
```
### Configure
@ -188,6 +180,7 @@ myhostname
Edit `/etc/mkinitcpio.conf`:
```txt
# LVM
# https://wiki.archlinux.org/title/Install_Arch_Linux_on_LVM#Adding_mkinitcpio_hooks
HOOKS=(base udev ... block lvm2 filesystems)
@ -250,7 +243,7 @@ useradd -m -G wheel -s /usr/bin/zsh -c "The Joker" 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
systemctl enable systemd-homed.service
@ -278,16 +271,16 @@ pacman -Syu xorg-server
```sh
pacman -Syu gnome-shell \
gnome-control-center gnome-system-monitor \
gnome-terminal gnome-backgrounds gnome-screenshot gnome-keyring \
nautilus xdg-user-dirs-gtk file-roller \
evince eog
gnome-tweaks gnome-backgrounds gnome-screenshot gnome-keyring gnome-logs \
gnome-console gnome-text-editor \
nautilus xdg-user-dirs-gtk file-roller evince eog
# Login manager
pacman -Syu gdm
systemctl enable gdm.service
```
#### [KDE](https://wiki.archlinux.org/title/KDE)
#### [KDE (WIP)](https://wiki.archlinux.org/title/KDE)
```sh
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/Reflector
https://wiki.archlinux.org/title/PRIME
## In the end