docs: what is dotar and its naming, network/system/string commnads
This commit is contained in:
parent
d91cf84f24
commit
fcc9a5d6fc
34
README.md
34
README.md
@ -1,7 +1,11 @@
|
|||||||
# Ruilisi dotfiles
|
<p align="center">
|
||||||
|
<img align="center" src="logo.png" width="150px" height="150px" />
|
||||||
Forked from https://github.com/skwp/dotfiles
|
</p>
|
||||||
|
<h1 align="center">Dotar</h1>
|
||||||
|
<p align="center">Dotar is an all-in-one dev configuration for your mac/linux which includes setup for zsh, spacevim(nvim), tmux and many more</p>
|
||||||
|
|
||||||
|
# The story
|
||||||
|
Dotar got its name by the combination of `dot` and `tar` which means package(`tar`) dotfiles togeter.
|
||||||
# Get started
|
# Get started
|
||||||
## Requirements
|
## Requirements
|
||||||
* `zsh`, `tmux`, `vim`, `ag` are installed and zsh is set as your login shell:
|
* `zsh`, `tmux`, `vim`, `ag` are installed and zsh is set as your login shell:
|
||||||
@ -16,11 +20,11 @@ python3 -m pip install --user --upgrade pynvim
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
bash -c "`curl -fsSL https://raw.githubusercontent.com/ruilisi/dotfiles/master/install.sh`"
|
bash -c "`curl -fsSL https://raw.githubusercontent.com/ruilisi/dotar/master/install.sh`"
|
||||||
```
|
```
|
||||||
Or
|
Or
|
||||||
```sh
|
```sh
|
||||||
bash -c "`curl -fsSL https://xiemala.com/ruilisi/dotfiles/raw/branch/master/install.sh`"
|
bash -c "`curl -fsSL https://xiemala.com/ruilisi/dotar/raw/branch/master/install.sh`"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Upgrade
|
## Upgrade
|
||||||
@ -67,6 +71,26 @@ ae | Edit alias
|
|||||||
ar | Reload alias
|
ar | Reload alias
|
||||||
ESC C-x C-e |Edit current command line in vim
|
ESC C-x C-e |Edit current command line in vim
|
||||||
|
|
||||||
|
#### Network tools
|
||||||
|
Command | Description
|
||||||
|
:-----------|:--------
|
||||||
|
test-port PORT | test whether PORT is opened
|
||||||
|
intercept-request-hosts | intercept requests and show hosts
|
||||||
|
host-ip | show host ip of your system
|
||||||
|
|
||||||
|
#### System commands
|
||||||
|
Command | Description
|
||||||
|
:-----------|:--------
|
||||||
|
yell | print the script name and all arguments to stderr
|
||||||
|
die | does the same as yell, but exits with a non-0 exit status, which means "fail".
|
||||||
|
try | uses the || (boolean OR), which only evaluates the right side if the left one didn’t fail.
|
||||||
|
list-large-files DIR | list large files sort by reversed order of size and print size in the order of `KB`, `MB`, `GB`
|
||||||
|
|
||||||
|
#### String commands
|
||||||
|
Command | Description
|
||||||
|
:------------|:--------
|
||||||
|
random-hex | print random hex
|
||||||
|
random-string| print random string of alphabets `a-zA-Z0-9`
|
||||||
|
|
||||||
#### Git Commands
|
#### Git Commands
|
||||||
YADR will take over your ~/.gitconfig, so if you want to store your git username and other settings, please put them in ~/.gitconfig.user
|
YADR will take over your ~/.gitconfig, so if you want to store your git username and other settings, please put them in ~/.gitconfig.user
|
||||||
|
@ -309,9 +309,6 @@ function dc {
|
|||||||
fi
|
fi
|
||||||
docker-compose -f $docker_file_path $@
|
docker-compose -f $docker_file_path $@
|
||||||
}
|
}
|
||||||
function get_ip_of_ssh_hostname {
|
|
||||||
ssh -G $1 | awk '/^hostname / { print $2 }'
|
|
||||||
}
|
|
||||||
unalias gc 2>/dev/null
|
unalias gc 2>/dev/null
|
||||||
unalias gcm 2>/dev/null
|
unalias gcm 2>/dev/null
|
||||||
function gc {
|
function gc {
|
||||||
@ -334,21 +331,3 @@ function gc {
|
|||||||
function gcm {
|
function gcm {
|
||||||
(gc --message $*) || return
|
(gc --message $*) || return
|
||||||
}
|
}
|
||||||
|
|
||||||
function random_hex {
|
|
||||||
openssl rand -hex $(expr $1 / 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
function random-string {
|
|
||||||
cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1
|
|
||||||
}
|
|
||||||
|
|
||||||
function list-large-files {
|
|
||||||
LIST=`du $1`
|
|
||||||
echo $LIST | grep '^[0-9.]*K.' | sort -n
|
|
||||||
echo $LIST | grep '^[0-9.]*M.' | sort -n
|
|
||||||
echo $LIST | grep '^[0-9.]*G.' | sort -n
|
|
||||||
}
|
|
||||||
yell() { echo "$0: $*" >&2; }
|
|
||||||
die() { yell "$*"; exit 111; }
|
|
||||||
try() { "$@" || die "cannot $*"; }
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
alias intercept_request_hosts="sudo tcpdump -i any -A -vv -s 0 | grep -e 'Host:'"
|
alias intercept-request-hosts="sudo tcpdump -i any -A -vv -s 0 | grep -e 'Host:'"
|
||||||
host_ip() {
|
host-ip() {
|
||||||
ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}'
|
ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}'
|
||||||
}
|
}
|
||||||
test_port() {
|
test-port() {
|
||||||
nc -z localhost $1
|
nc -z localhost $1
|
||||||
}
|
}
|
||||||
|
7
zsh/string.zsh
Normal file
7
zsh/string.zsh
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
random-hex() {
|
||||||
|
openssl rand -hex $(expr $1 / 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
random-string() {
|
||||||
|
cat /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' | fold -w ${1:-32} | head -n 1
|
||||||
|
}
|
12
zsh/system.zsh
Normal file
12
zsh/system.zsh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
yell() { echo "$0: $*" >&2; }
|
||||||
|
|
||||||
|
die() { yell "$*"; exit 111; }
|
||||||
|
|
||||||
|
try() { "$@" || die "cannot $*"; }
|
||||||
|
|
||||||
|
list-large-files() {
|
||||||
|
LIST=`du $1`
|
||||||
|
echo $LIST | grep '^[0-9.]*K.' | sort -n
|
||||||
|
echo $LIST | grep '^[0-9.]*M.' | sort -n
|
||||||
|
echo $LIST | grep '^[0-9.]*G.' | sort -n
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user