big
parent
c92ea59e0f
commit
e23a797865
|
@ -1,12 +1,20 @@
|
||||||
# Bash
|
# 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).
|
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`:
|
Add to `~/.bashrc`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export HISTCONTROL=ignoreboth:erasedups
|
export HISTCONTROL=ignoreboth:erasedups
|
||||||
export HISTIGNORE="cd:cd *:ls:ls *:pwd:exit"
|
export HISTIGNORE="cd:cd *:ls:ls *:pwd:exit"
|
||||||
|
|
||||||
|
[[ -f /usr/share/bash-completion/bash_completion ]] & \
|
||||||
|
source /usr/share/bash-completion/bash_completion
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,13 +3,23 @@
|
||||||
Add to `~/.bashrc`:
|
Add to `~/.bashrc`:
|
||||||
|
|
||||||
```bash
|
```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 ]] && \
|
[[ -f /usr/share/git/completion/git-prompt.sh ]] && \
|
||||||
source /usr/share/git/completion/git-prompt.sh
|
source /usr/share/git/completion/git-prompt.sh
|
||||||
PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
|
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:
|
Prefer rebase when pull:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
@ -28,16 +38,22 @@ Push force safely:
|
||||||
git push --force-with-lease
|
git push --force-with-lease
|
||||||
```
|
```
|
||||||
|
|
||||||
Save usernames and passwords in `~/.git-credentials`:
|
Prefer rebase when pull:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git config --global credential.helper store
|
git pull --rebase
|
||||||
```
|
```
|
||||||
|
|
||||||
Use neovim when commit:
|
Clean outdated branches:
|
||||||
|
|
||||||
```sh
|
```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 :
|
Rewrite history by changing last `x` commits :
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# Development
|
||||||
|
|
||||||
|
[Go](go.md)
|
||||||
|
|
||||||
|
[Python](python.md)
|
||||||
|
|
||||||
|
[Docker](docker.md)
|
||||||
|
|
||||||
|
[Redis](redis.md)
|
||||||
|
|
||||||
|
[Prometheus](prometheus.md)
|
||||||
|
|
||||||
|
[ANTLR4](antlr4.md)
|
|
@ -1,15 +1,20 @@
|
||||||
# ANTLR4
|
# ANTLR4
|
||||||
|
|
||||||
|
| Distribution | Package |
|
||||||
|
| ------------ | -------- |
|
||||||
|
| Archlinux | `antlr4` |
|
||||||
|
| Ubuntu | `antlr4` |
|
||||||
|
|
||||||
Read [Getting Started with ANTLR v4](https://github.com/antlr/antlr4/blob/master/doc/getting-started.md).
|
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`:
|
# Ubuntu
|
||||||
|
export classpath=".:/usr/share/java/antlr4.jar:$classpath"
|
||||||
```sh
|
|
||||||
export CLASSPATH=".:/usr/share/java/antlr-complete.jar:$CLASSPATH"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Sample `Condition.g4`:
|
Sample `Condition.g4`:
|
||||||
|
|
|
@ -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
|
|
||||||
```
|
|
|
@ -1,10 +1,12 @@
|
||||||
# Docker
|
# 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
|
```sh
|
||||||
systemctl enable --now docker.service
|
systemctl enable --now docker.service
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
# Go
|
# 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:
|
```bash
|
||||||
|
|
||||||
- [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
|
|
||||||
export GOPATH=$HOME/go
|
export GOPATH=$HOME/go
|
||||||
export PATH="$PATH:$GOPATH/bin"
|
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)
|
[goimports](https://pkg.go.dev/golang.org/x/tools/cmd/goimports?tab=doc)
|
||||||
|
|
||||||
[GolangCI-Lint](https://github.com/golangci/golangci-lint)
|
[GolangCI-Lint](https://github.com/golangci/golangci-lint)
|
||||||
|
|
||||||
[gomodifytags](https://github.com/fatih/gomodifytags)
|
|
||||||
|
|
|
@ -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/).
|
|
|
@ -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
|
|
||||||
```
|
|
|
@ -11,7 +11,12 @@ docker run -d \
|
||||||
|
|
||||||
## redis-cli
|
## 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:
|
Connect:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue