restart docker in mac, random-string
This commit is contained in:
parent
c36707f620
commit
f169fe2596
@ -249,14 +249,17 @@ alias ls_folder_size="du -sch .[!.]* * | sort -h"
|
||||
alias top_by_memory="top -o %MEM"
|
||||
alias gcaa="gia .; gcF"
|
||||
alias ror_ctags="ctags -R --languages=ruby --exclude=.git --exclude=log . \$(bundle list --paths)"
|
||||
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
|
||||
alias find_large_files="sudo find / -xdev -type f -size +50M"
|
||||
alias vim_plain="vim -u NONE"
|
||||
alias edit_alias="vim $yadr_zsh/aliases.zsh $yadr_zsh/functions.zsh -p"
|
||||
alias docker_purge='docker stop $(docker ps -qa);docker rm $(docker ps -qa)'
|
||||
alias yarn_sass="SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/ yarn"
|
||||
alias vim="nvim"
|
||||
|
||||
## docker
|
||||
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
|
||||
alias docker_purge='docker stop $(docker ps -qa);docker rm $(docker ps -qa)'
|
||||
alias docker_restart_in_mac='killall Docker && open /Applications/Docker.app'
|
||||
|
||||
## source files
|
||||
alias ss="source ~/.zshrc"
|
||||
alias delete_all_binaries="find . -type f -perm -u+x -not -path './.git/*' | xargs rm"
|
||||
|
@ -156,6 +156,7 @@ function Replace () {
|
||||
SED_CMD=s${SEP}$SRC${SEP}$DST${SEP}g
|
||||
fi
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
echo "xargs sed -i '' \"${SED_CMD}\""
|
||||
echo $MATCHED_FILES | xargs sed -i '' "${SED_CMD}"
|
||||
elif [[ "$(expr substr $(uname -s) 1 5)" == "Linux" ]]; then
|
||||
echo $MATCHED_FILES | xargs sed -i ${SED_CMD}
|
||||
@ -372,3 +373,8 @@ function gcm {
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user