Tran Hau 2020-05-10 01:30:08 +07:00
parent c92ea59e0f
commit e23a797865
10 changed files with 73 additions and 69 deletions

View File

@ -1,12 +1,20 @@
# Bash
Read [Bash](https://wiki.archlinux.org/index.php/Bash).
Read [Default Keyboard Shortcuts for Bash](https://catonmat.net/ftp/readline-emacs-editing-mode-cheat-sheet.pdf).
Bash completion:
| Distribution | Package |
| ------------ | ----------------- |
| Archlinux | `bash-completion` |
| Ubuntu | `bash-completion` |
Add to `~/.bashrc`:
```bash
export HISTCONTROL=ignoreboth:erasedups
export HISTIGNORE="cd:cd *:ls:ls *:pwd:exit"
[[ -f /usr/share/bash-completion/bash_completion ]] & \
source /usr/share/bash-completion/bash_completion
```

View File

@ -3,13 +3,23 @@
Add to `~/.bashrc`:
```bash
[[ -f /usr/share/git/completion/git-completion.bash ]] && \
source /usr/share/git/completion/git-completion.bash
[[ -f /usr/share/git/completion/git-prompt.sh ]] && \
source /usr/share/git/completion/git-prompt.sh
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
```
Save usernames and passwords in `~/.git-credentials`:
```sh
git config --global credential.helper store
```
Use neovim when commit:
```sh
git config --global core.editor nvim
```
Prefer rebase when pull:
```sh
@ -28,16 +38,22 @@ Push force safely:
git push --force-with-lease
```
Save usernames and passwords in `~/.git-credentials`:
Prefer rebase when pull:
```sh
git config --global credential.helper store
git pull --rebase
```
Use neovim when commit:
Clean outdated branches:
```sh
git config --global core.editor nvim
git fetch --prune
```
Push force safely:
```sh
git push --force-with-lease
```
Rewrite history by changing last `x` commits :

13
Development/README.md Normal file
View File

@ -0,0 +1,13 @@
# Development
[Go](go.md)
[Python](python.md)
[Docker](docker.md)
[Redis](redis.md)
[Prometheus](prometheus.md)
[ANTLR4](antlr4.md)

View File

@ -1,15 +1,20 @@
# ANTLR4
| Distribution | Package |
| ------------ | -------- |
| Archlinux | `antlr4` |
| Ubuntu | `antlr4` |
Read [Getting Started with ANTLR v4](https://github.com/antlr/antlr4/blob/master/doc/getting-started.md).
Assume you use Archlinux.
Add to `~/.bashrc`:
Install [antlr4](https://www.archlinux.org/packages/extra/any/antlr4/).
```bash
# Archlinux
export classpath=".:/usr/share/java/antlr-complete.jar:$classpath"
Add to `~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`:
```sh
export CLASSPATH=".:/usr/share/java/antlr-complete.jar:$CLASSPATH"
# Ubuntu
export classpath=".:/usr/share/java/antlr4.jar:$classpath"
```
Sample `Condition.g4`:

View File

@ -1,17 +0,0 @@
# Consul
Assume you use Archlinux.
Install [consul](https://www.archlinux.org/packages/community/x86_64/consul/).
Run:
```sh
consul agent -dev
```
UI:
```txt
http://localhost:8500/ui
```

View File

@ -1,10 +1,12 @@
# Docker
Assume you use Archlinux.
| Distribution | Package |
| ------------ | ----------------------------------------------------- |
| Archlinux | `docker` |
| Ubuntu | [See](https://docs.docker.com/engine/install/ubuntu/) |
Read [Docker](https://wiki.archlinux.org/index.php/Docker).
On Archlinux, enable and start service:
Enable and start service:
```sh
systemctl enable --now docker.service

View File

@ -1,17 +1,13 @@
# Go
## Set up
| Distribution | Package |
| ------------ | ----------------------------------------------- |
| Archlinux | `go`, `go-tools` |
| Ubuntu | [See](https://github.com/golang/go/wiki/Ubuntu) |
Read [Go](https://wiki.archlinux.org/index.php/Go).
Add to `~/.bashrc`:
Install:
- [go](https://www.archlinux.org/packages/community/x86_64/go/)
- [go-tools](https://www.archlinux.org/packages/community/x86_64/go-tools/)
Add to `~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`:
```sh
```bash
export GOPATH=$HOME/go
export PATH="$PATH:$GOPATH/bin"
```
@ -31,5 +27,3 @@ export PATH="$PATH:$GOPATH/bin"
[goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports?tab=doc)
[GolangCI-Lint](https://github.com/golangci/golangci-lint)
[gomodifytags](https://github.com/fatih/gomodifytags)

View File

@ -1,7 +0,0 @@
# JetBrains
Install [Toolbox App](https://www.jetbrains.com/toolbox-app/).
Assume you use Linux.
Dependencies: [fuse2](https://www.archlinux.org/packages/extra/x86_64/fuse2/).

View File

@ -1,15 +0,0 @@
# Kafka
Assume you use Archlinux.
Read [Apache Kafka](https://wiki.archlinux.org/index.php/Apache_Kafka).
Install [kafka](https://aur.archlinux.org/packages/kafka/), [zookeeper](https://aur.archlinux.org/packages/zookeeper/).
Start/enable service:
```sh
systemctl start kafka.service
systemctl enable kafka.service
```

View File

@ -11,7 +11,12 @@ docker run -d \
## redis-cli
`redis-cli` is included in [redis](https://www.archlinux.org/packages/community/x86_64/redis/).
`redis-cli` is included in:
| Distribution | Package |
| ------------ | -------------- |
| Archlinux | `redis` |
| Ubuntu | `redis-server` |
Connect: