big pp
parent
a626699ff9
commit
d1322dbf59
|
@ -54,7 +54,7 @@ In macOS, Bash read `~/.bash_profile` not `~/.bashrc`, so edit `~/.bash_profile`
|
|||
source ~/.bashrc
|
||||
```
|
||||
|
||||
To use latest Bash, install `bash` from Homebrew.
|
||||
To use latest Bash, install `bash` with Homebrew.
|
||||
Then append to `/etc/shells`:
|
||||
|
||||
```txt
|
||||
|
|
|
@ -6,19 +6,12 @@
|
|||
| Ubuntu | `neovim` |
|
||||
| Homebrew | `neovim` |
|
||||
|
||||
Add to `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
export EDITOR=nvim
|
||||
|
||||
# Arch Linux, Ubuntu
|
||||
[[ -f /usr/bin/nvim ]] && \
|
||||
alias vim="nvim"
|
||||
|
||||
# Homebrew
|
||||
[[ -f /usr/local/bin/nvim ]] && \
|
||||
alias vim="nvim"
|
||||
```
|
||||
| Shorcut | Description |
|
||||
| --------------- | ------------------------- |
|
||||
| `CTRL-N` | Insert next matching word |
|
||||
| `CTRL-X CTRL-F` | File completion |
|
||||
| `CTRL-X CTRL-L` | Line completion |
|
||||
| `CTRL-X CTRL-Q` | Vim completion |
|
||||
|
||||
## Packages
|
||||
|
||||
|
@ -33,14 +26,3 @@ To load package manully:
|
|||
```vim
|
||||
packadd bar
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Completion:
|
||||
|
||||
| Command | Description |
|
||||
| --------------- | ------------------------- |
|
||||
| `CTRL-N` | Insert next matching word |
|
||||
| `CTRL-X CTRL-F` | File completion |
|
||||
| `CTRL-X CTRL-L` | Line completion |
|
||||
| `CTRL-X CTRL-Q` | Vim completion |
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# zsh
|
||||
|
||||
## macOS
|
||||
|
||||
To use latest zsh, install `zsh` with Homebrew.
|
||||
Then append to `/etc/shells`:
|
||||
|
||||
```txt
|
||||
/usr/local/bin/zsh
|
||||
```
|
||||
|
||||
Set default shell
|
||||
|
||||
```
|
||||
chsh -s /usr/local/bin/zsh
|
||||
```
|
|
@ -0,0 +1,5 @@
|
|||
# [lazydocker](https://github.com/jesseduffield/lazydocker)
|
||||
|
||||
| Distribution | Package |
|
||||
| ------------ | ------------ |
|
||||
| Homebrew | `lazydocker` |
|
|
@ -0,0 +1,7 @@
|
|||
# [redli](https://github.com/IBM-Cloud/redli)
|
||||
|
||||
Usage:
|
||||
|
||||
```sh
|
||||
redli -h localhost -p 6379 -a password
|
||||
```
|
|
@ -1,7 +0,0 @@
|
|||
# [Mosh](https://github.com/mobile-shell/mosh)
|
||||
|
||||
| Distribution | Package |
|
||||
| ------------ | ------- |
|
||||
| Arch Linux | `mosh` |
|
||||
| Ubuntu | `mosh` |
|
||||
| Homebrew | `mosh` |
|
|
@ -1,13 +0,0 @@
|
|||
# [Ncat](https://nmap.org/ncat/)
|
||||
|
||||
| Distribution | Package |
|
||||
| ------------ | ------- |
|
||||
| Arch Linux | `nmap` |
|
||||
| Ubuntu | `ncat` |
|
||||
| Homebrew | `nmap` |
|
||||
|
||||
Check connectivity:
|
||||
|
||||
```sh
|
||||
ncat -zv google.com 80
|
||||
```
|
|
@ -17,7 +17,7 @@ Add your user to `docker` group:
|
|||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
## Command-line
|
||||
## Commands
|
||||
|
||||
Remove unused data:
|
||||
|
||||
|
@ -27,6 +27,12 @@ docker system prune --volumes
|
|||
docker system prune --volumes -a
|
||||
```
|
||||
|
||||
Inside container:
|
||||
|
||||
```sh
|
||||
docker exec -it container_name /bin/bash
|
||||
```
|
||||
|
||||
Docker run options:
|
||||
|
||||
| option | example | explain |
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
# [Consul](https://www.consul.io/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 8500:8500 -p 8600:8600/udp --name=consul consul agent -server -ui -bootstrap-expect=1 -client=0.0.0.0
|
||||
```
|
||||
|
||||
UI endpoint:
|
||||
|
||||
```txt
|
||||
localhost:8500
|
||||
```
|
|
@ -1,13 +0,0 @@
|
|||
# [Grafana](https://grafana.com/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 3000:3000 --name grafana grafana/grafana
|
||||
```
|
||||
|
||||
UI endpoint, with default credentials `admin:admin`:
|
||||
|
||||
```
|
||||
localhost:3000
|
||||
```
|
|
@ -1,16 +0,0 @@
|
|||
# [MinIO](https://min.io/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 9000:9000 --name minio minio/minio server /data
|
||||
|
||||
# Persistent storage
|
||||
docker run --rm -p 9000:9000 -v "$(pwd)"/minio/data:/data --name minio minio/minio server /data
|
||||
```
|
||||
|
||||
UI endpoint, with default credentials `minioadmin:minioadmin`:
|
||||
|
||||
```txt
|
||||
localhost:9000
|
||||
```
|
|
@ -1,43 +0,0 @@
|
|||
# [Prometheus](https://prometheus.io/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 9090:9090 --name prometheus prom/prometheus
|
||||
|
||||
# Custom configuration
|
||||
docker run --rm -p 9090:9090 -v "$(pwd)"/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml --name prometheus prom/prometheus
|
||||
```
|
||||
|
||||
UI endpoint:
|
||||
|
||||
```txt
|
||||
localhost:9090
|
||||
localhost:9090/metrics
|
||||
```
|
||||
|
||||
## Pushing metrics
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 9091:9091 --name pushgateway prom/pushgateway
|
||||
```
|
||||
|
||||
UI endpoint:
|
||||
|
||||
```txt
|
||||
localhost:9091
|
||||
localhost:9091/metrics
|
||||
```
|
||||
|
||||
To configure the Pushgateway as a target to scrape by Prometheus,
|
||||
add to Prometheus configuration file:
|
||||
|
||||
```yaml
|
||||
scrape_configs:
|
||||
- job_name: "pushgateway"
|
||||
honor_labels: true
|
||||
static_configs:
|
||||
- targets: ["localhost:9091"]
|
||||
```
|
|
@ -1 +0,0 @@
|
|||
# Services
|
|
@ -1,13 +0,0 @@
|
|||
# [RabbitMQ](https://www.rabbitmq.com/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management-alpine
|
||||
```
|
||||
|
||||
UI endpoint, with default credentials `guest:guest`:
|
||||
|
||||
```txt
|
||||
localhost:15672
|
||||
```
|
|
@ -1,53 +0,0 @@
|
|||
# [Redis](https://redis.io/)
|
||||
|
||||
Docker:
|
||||
|
||||
```sh
|
||||
docker run --rm -p 6379:6379 --name redis redis:alpine
|
||||
```
|
||||
|
||||
## Command-line interface
|
||||
|
||||
### redis-cli
|
||||
|
||||
| Distribution | Package |
|
||||
| ------------ | ------------- |
|
||||
| Arch Linux | `redis` |
|
||||
| Ubuntu | `redis-tools` |
|
||||
| Homebrew | `redis` |
|
||||
|
||||
Connect:
|
||||
|
||||
```sh
|
||||
redis-cli -h localhost -p 6379
|
||||
```
|
||||
|
||||
### [Redli](https://github.com/IBM-Cloud/redli)
|
||||
|
||||
Connect:
|
||||
|
||||
```sh
|
||||
redli -h localhost -p 6379
|
||||
```
|
||||
|
||||
### Commands
|
||||
|
||||
Get all keys:
|
||||
|
||||
```redis
|
||||
keys *
|
||||
```
|
||||
|
||||
Delete all keys:
|
||||
|
||||
```redis
|
||||
flushall
|
||||
```
|
||||
|
||||
Get/Set/Delete key:
|
||||
|
||||
```redis
|
||||
get mykey
|
||||
set mykey myvalue
|
||||
del mykey
|
||||
```
|
|
@ -12,6 +12,7 @@
|
|||
- [rsync](Applications/Essential/rsync.md)
|
||||
- [tldr](Applications/Essential/tldr.md)
|
||||
- [tmux](Applications/Essential/tmux.md)
|
||||
- [zsh](Applications/Essential/zsh.md)
|
||||
- [Misc](Applications/Misc/README.md)
|
||||
- [ncdu](Applications/Misc/ncdu.md)
|
||||
- [Cheat](Applications/Misc/Cheat.md)
|
||||
|
@ -20,12 +21,12 @@
|
|||
- [Steam](Applications/Misc/Steam.md)
|
||||
- [Ventoy](Applications/Misc/Ventoy.md)
|
||||
- [mdBook](Applications/Misc/mdBook.md)
|
||||
- [lazydocker](Applications/Misc/lazydocker.md)
|
||||
- [redli](Applications/Misc/redli.md)
|
||||
- [mpv](Applications/Misc/mpv.md)
|
||||
- [Network](Applications/Network/README.md)
|
||||
- [EasySSH](Applications/Network/EasySSH.md)
|
||||
- [HTTPie](Applications/Network/HTTPie.md)
|
||||
- [Mosh](Applications/Network/Mosh.md)
|
||||
- [Ncat](Applications/Network/Ncat.md)
|
||||
- [OpenSSH](Applications/Network/OpenSSH.md)
|
||||
- [OpenVPN](Applications/Network/OpenVPN.md)
|
||||
- [Telnet](Applications/Network/Telnet.md)
|
||||
|
@ -53,13 +54,6 @@
|
|||
- [subprocess](Development/Python/subprocess.md)
|
||||
- [tarfile](Development/Python/tarfile.md)
|
||||
- [venv](Development/Python/venv.md)
|
||||
- [Services](Development/Services/README.md)
|
||||
- [Consul](Development/Services/Consul.md)
|
||||
- [Grafana](Development/Services/Grafana.md)
|
||||
- [MinIO](Development/Services/MinIO.md)
|
||||
- [Prometheus](Development/Services/Prometheus.md)
|
||||
- [RabbitMQ](Development/Services/RabbitMQ.md)
|
||||
- [Redis](Development/Services/Redis.md)
|
||||
- [Docker](Development/Docker.md)
|
||||
- [Knowledge](Knowledge/README.md)
|
||||
- [Regular expression](Knowledge/regex.md)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
# Summary
|
||||
|
||||
- [Chapter 1](./chapter_1.md)
|
|
@ -0,0 +1 @@
|
|||
# Chapter 1
|
Loading…
Reference in New Issue