Store my configuration
cd ~
git clone https://github.com/Homebrew/brew homebrew
mkdir ~/usr/local
# installed packaged directory
echo "export HOMEBREW_PREFIX=~/usr/local" >> ~/.zshrc
echo "export PATH=$PATH:~/homebrew/bin:HOMEBREW_PREFIX/bin" >> ~/.zshrc
# the brew items dir
brew --prefix
https://superuser.com/a/1689758/1644368
# 101 https://sdkman.io/usage
curl -s https://get.sdkman.io | bash
export JAVA_HOME=<jdk_location>
- https://www.azul.com/downloads/?package=jdk#download-openjdk
- https://adoptium.net/index.html
- https://docs.microsoft.com/en-us/java/openjdk/download
- https://devblogs.microsoft.com/java/end-of-updates-support-and-availability-of-zulu-for-azure/
brew tap muesli/tap && brew tap homebrew/cask-fonts && brew tap ringohub/redis-cli buo/cask-upgrade
brew rm curl && brew install curl-openssl
brew install git coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep httpie pwgen tree zopfli mozjpeg duf pyenv tig helm minikube ripgrep jq ncdu zlib bzip2 libiconv libzip imap-uw libedit gitmoji redis-cli tfenv kubectl rclone logstalgia gnu-time shellcheck entr z tfenv pwgen
brew install --cask keka iterm2 sublime-text visual-studio-code dbeaver-community sourcetree insomnia postman google-chrome eloston-chromium imageoptim crunch mockoon devtoys
# font
brew install --cask font-go-mono-nerd-font font-jetbrains-mono-nerd-font font-caskaydia-cove-nerd-font font-terminess-ttf-nerd-font font-3270-nerd-font font-blex-mono-nerd-font font-bigblue-terminal-nerd-font font-redhat
# npm
npm i -g @squoosh/cli
npm install -g tldr
npm i -g whistle && w2 start --init
# py
pip install diagrams
# git stat
## reference https://github.com/casperdcl/git-fame
pip install git-fame
# optional
brew install stubby dnsmasq
# for grep
# All commands have been installed with the prefix 'g'.
echo 'export PATH="$(brew --prefix)/opt/libiconv/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/bzip2/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/mozjpeg/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/gnu-getopt/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/gnu-indent/libexec/gnubin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/libiconv/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/curl/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$(brew --prefix)/opt/git/bin:$PATH"' >> ~/.zshrc
echo 'MANPATH="$(brew --prefix)/opt/coreutils/libexec/gnuman:$MANPATH"' >> ~/.zshrc
# ref
https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities
# ncdu
ncdu --color=dark
https://gist.github.com/uraimo/c651cbf3477994f95d8dbc7c60031697
https://dnsprivacy.org/wiki/pages/viewpage.action?pageId=3145812 https://dnsprivacy.org/wiki/display/DP/Configuring+Stubby#ConfiguringStubby-DNSSEC
https://dnsprivacy.org/wiki/display/DP/DNS+Privacy+Test+Servers
- https://gist.github.com/alanbuxey/8713073e232adfd56198e8cd8ee1258b
- https://gist.github.com/uraimo/c651cbf3477994f95d8dbc7c60031697
- https://wiki.archlinux.org/index.php/Stubby
ref: https://github.com/getdnsapi/stubby/issues/87#issuecomment-377929340
echo | openssl s_client -connect '1.1.1.1:853' 2>/dev/null | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
od9obscoXQND56/DikypZrJkXGvbQV5Y61QGfcNitHo=
### test
1. https://dnsinstitute.com/documentation/dnssec-guide/ch03s02.html - dnssec
1. https://superuser.com/questions/1532975/how-to-query-for-dns-over-https-dns-over-tls-using-command-line - DoT
1. https://ns1.com/blog/using-dig-trace - using-dig-trace
```console
dnssec
kdig 216.58.208.110 google.com A +dnssec +multiline +tls
kdig -d @1.1.1.1 +tls-ca +tls-host=cloudflare-dns.com +dnssec example.com
http://en.conn.internet.nl/connection/
http://www.dnssec-tools.org/
http://dnssec.vs.uni-due.de/
DoT
https://www.cloudflare.com/ssl/encrypted-sni/
phpbrew install 8.0.2 +default +dbs +curl
https://github.com/juliuscaesar/unicorn
- https://github.com/starship/starship
- https://github.com/sindresorhus/pure
- https://dev.to/abdfnx/oh-my-zsh-powerlevel10k-cool-terminal-1no0
brew cask install font-go-mono-nerd-font
# 14 is the len of the string
openssl rand -base64 14
brew install pwgen
pwgen -sBy 10 1
ssh-keygen -t ed25519 -C "email"
sudo pacman -S pacaur
# core
yay -S zsh neovim docker docker-compose
# tools
https://github.com/cjbassi/gotop
# json
go get -u github.com/simeji/jid/cmd/jid
# utils
yay -S ripgrep docker docker-compose glances fzf-git zopflipng-git mozjpeg tig xdotool ttyrec ttygif ripgrep powershell-bin ctop-bin
# Change shell
`sudo chsh`
# node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
npm i -g diff-so-fancy
# whistle
npm install -g whistle
ttf gif (https://github.com/icholy/ttygif)
1. Create ttyrec recording
$ ttyrec myrecording
Hit CTRL-D or type exit when done recording.
2. Convert to gif
$ ttygif myrecording
On OSX optionally you can set a -f flag which will bypass cropping which is needed for terminal apps which aren't full screen. Both standard Terminal and iTerm apps are supported.
$ ttygif myrecording -f
# theme
ZSH_THEME=""
autoload -U promptinit; promptinit
prompt pure
# Git alias
EDITOR=vim
alias vi="vim"
alias g="git"
alias gss="git status"
alias gp="git push"
alias gc="git commit"
alias ga="git add"
alias gt="git tag"
alias gf="git f"
alias gco="git checkout"
alias gr="git rebase"
alias gup="git pull --rebase"
# alias cat="bat"
# k8s
alias kk="kubectl"
# show all fonts
alias show_fonts='system_profiler -json SPFontsDataType | grep \"family | sort | uniq'
# Alias
alias vi=vim
# alias top=glances
# alias cat=ccat
alias fzf="fzf --preview 'cat -n {}'"
alias mi="micro"
alias composer="composer.phar"
alias gg="gitmoji"
export EDITOR='vim'
export VISUAL='vim'
# export TERM='terminator'
# ttf
# export WINDOWID=$(xdotool getwindowfocus)
# Go
export GOPATH=$HOME/works
export GOENV_ROOT="$HOME/.goenv"
eval "$(goenv init -)"
export PATH="$GOENV_ROOT/bin:$PATH"
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
# py
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# tf
export PATH="$HOME/.tfenv/bin:$PATH"
# php
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
# http server
alias http="python -m SimpleHTTPServer"
# tools
export PATH="/usr/local/opt/mozjpeg/bin:$PATH"
# local
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# gnu-coreutils
# All commands have been installed with the prefix 'g'.
export PATH="$(brew --prefix)/opt/libiconv/bin:$PATH"
export PATH="$(brew --prefix)/opt/bzip2/bin:$PATH"
export PATH="$(brew --prefix)/opt/mozjpeg/bin:$PATH"
export PATH="$(brew --prefix)/opt/gnu-getopt/bin:$PATH"
export PATH="$(brew --prefix)/opt/gnu-indent/libexec/gnubin:$PATH"
export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
export PATH="$(brew --prefix)/opt/libiconv/bin:$PATH"
export PATH="$(brew --prefix)/opt/bzip2/bin:$PATH"
export PATH="$(brew --prefix)/opt/curl/bin:$PATH"
export PATH="$(brew --prefix)/opt/git/bin:$PATH"
https://github.com/PowerShell/PowerShell/blob/master/docs/installation/linux.md#arch-linux
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
# Alias list
set-alias vi vim
set-alias g git
set-alias top glances
set-alias gss "g status"
# Env var
$env:GOPATH = "$HOME/works"
$env:GOROOT = "$HOME/go"
$env:Path += "$GOROOT/bin:$GOPATH/bin"
# git
import-module posh-git
import-module oh-my-posh
set-theme Paradox
#
# Fix home end button
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# Kubectl
if [ $commands[kubectl] ]; then
source <(kubectl completion zsh)
fi
# Alias
alias vi=vim
alias top=glances
alias cat=ccat
alias open=nautilus
alias fzf=fzf --preview 'cat -n {}'
export EDITOR='vim'
export VISUAL='vim'
export TERM='terminator'
# ttf
export WINDOWID=$(xdotool getwindowfocus)
# Go
export GOROOT=$HOME/go
export GOPATH=$HOME/works
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ZSH_THEME="amuse"
Reference: http://ehellman.github.io/blog/2013/04/16/manually-install-a-font-in-arch-linux/
mv font.ttf /usr/share/fonts/
fc-cache -vf
vi ~/.kde4/Autostart
pritunl-client-gtk &
sudo tee -a /etc/pacman.conf << EOF
[pritunl]
Server = https://repo.pritunl.com/stable/pacman
EOF
sudo pacman-key --keyserver hkp://keyserver.ubuntu.com -r 7568D9BB55FF9E5287D586017AE645C0CF8E292A
sudo pacman-key --lsign-key 7568D9BB55FF9E5287D586017AE645C0CF8E292A
sudo pacman -Sy
sudo pacman -S pritunl-client-gtk
# ~/.xprofile
# http://hyperrate.com/thread.php?tid=31637
# https://manjaro-zh.blogspot.hk/2015/05/manjaro-linux-gcin.html
export GTK_IM_MODULE=gcin
export QT_IM_MODULE=gcin
export XMODIFIERS="@im=gcin"
gcin &
export EDITOR='vim'
export VISUAL='vim'
ln -s ~/.vimrc ~/.config/nvim/init.vim
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Install Plugins:
# Launch vim and run
:PluginInstall
:GoInstallBinaries
https://github.com/scrooloose/nerdtree
https://github.com/google/vim-codefmt
brew install macvim --with-lua
# If you haven't launched Xcode after updating it, do so now. Xcode will ask for permission to install additional components.
# Let it install those components. Once that is done, try the MacVim build again.
# use brew vim if present
/usr/local/bin/vim --version > /dev/null 2>&1
BREW_VIM_INSTALLED=$?
if [ $BREW_VIM_INSTALLED -eq 0 ]; then
alias vi="/usr/local/bin/vim"
fi
Installation
npm i -g diff-so-fancy
# Setting for the new UTF-8 terminal support in Lion
export LC_CTYPE="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
go get -u gopkg.in/alecthomas/gometalinter.v1
go get -u github.com/jingweno/ccat
It's recommended to alias ccat to cat:
alias cat=ccat
Installation
npm install -g tldr
on-my-zsh
plugins=(git bundler osx rake ruby thefuck)
pacaur -S fzf-git
fzf --preview 'cat -n {}'
find ~ -name game
- https://www.lifewire.com/uses-of-linux-command-find-2201100
- grep -nrw source
cat -n filename.txt
- zopflipng-git (png)
- install
pacaur -S zopflipng-git
- run
zopflipng -m infile.png outfile.png
- install
- https://github.com/mozilla/mozjpeg (jpg)
- install
pacaur -S mozjpeg
- run
cjpeg -optimize in.png > out.jpg
ls ./*.jpg|xargs -I@ cjpeg -quality 10 -outfile ./out/@ @
to loop allbrew install mozjpeg
- install
- cwebp (webp)
brew install guetzli
- https://github.com/chrissimpkins/Crunch
brew cask install crunch
https://github.com/hishamhm/htop
https://github.com/nicolargo/glances
# Set pip3
export PY_USER_BIN=$(python3 -c 'import site; print(site.USER_BASE + "/bin")')
export PATH=$PY_USER_BIN:$PATH
https://github.com/railsware/upterm
http://depado.markdownblog.com/2015-12-07-setting-up-caddy-server-on-debian