diff options
Diffstat (limited to 'external/zsh/aliases')
| -rw-r--r-- | external/zsh/aliases/dev.zsh | 36 | ||||
| -rw-r--r-- | external/zsh/aliases/dir.zsh | 27 | ||||
| -rw-r--r-- | external/zsh/aliases/edit.zsh | 17 | ||||
| -rw-r--r-- | external/zsh/aliases/git.zsh | 70 | ||||
| -rw-r--r-- | external/zsh/aliases/ls.zsh | 22 | ||||
| -rw-r--r-- | external/zsh/aliases/npm.zsh | 20 | ||||
| -rw-r--r-- | external/zsh/aliases/system.zsh | 13 | ||||
| -rw-r--r-- | external/zsh/aliases/xplt.zsh | 55 |
8 files changed, 0 insertions, 260 deletions
diff --git a/external/zsh/aliases/dev.zsh b/external/zsh/aliases/dev.zsh deleted file mode 100644 index 1e6587f..0000000 --- a/external/zsh/aliases/dev.zsh +++ /dev/null @@ -1,36 +0,0 @@ - -alias aws="docker run --rm -it amazon/aws-cli" - -# nix shell with zsh -nix-zsh() { nix-shell --run "WITH_NIX_PREFIX='${NX_PREFIX:-':'}' zsh" "$@"; } - -# shell for node 14 -with_node_14() { NX_PREFIX="node14" nix-zsh -p nodejs-14_x "$@"; } - -# shell for docker-compose -with_dcomp() { TMPDIR=$HOME/dump/tempdir NX_PREFIX=docker-compose nix-zsh -p docker-compose; } - -# npm run for node_14 -nrx() { with_node_14 --run "npm run $*"; } - -# :: Filename Pattern Replacetext -far() { - local file_r="$1"; shift; - local matcher_r="$1"; shift; - local result="$1"; shift; - fd "$file_r" | sad "$matcher_r" "$result" -p diff-so-fancy "$@"; -} - -# :: FileType Filename -codi() { - local syntax="${1:-python}" - shift - nvim -c \ - "let g:startify_disable_at_vimenter = 1 |\ - set bt=nofile ls=0 |\ - hi ColorColumn ctermbg=NONE |\ - hi VertSplit ctermbg=NONE |\ - hi NonText ctermfg=0 |\ - Codi $syntax" "$@" -} - diff --git a/external/zsh/aliases/dir.zsh b/external/zsh/aliases/dir.zsh deleted file mode 100644 index 508634e..0000000 --- a/external/zsh/aliases/dir.zsh +++ /dev/null @@ -1,27 +0,0 @@ -take() { mkdir -p $@ && cd ${@:$#}; } - -alias ..='cd ..'; -alias ...='cd ../..'; - -alias gdv='cd ~/dev/'; - -alias gpic='cd ~/Pictures'; -alias gdl='cd ~/Downloads/dl'; -alias gm='cd ~/Downloads/music'; - -alias gnotes='cd ~/.config/vimwiki'; -alias gqute='cd ~/.config/qutebrowser'; - -alias gvim='cd ~/.config/nvim'; -alias gcmd='cd ~/scripts/commands'; -alias gzsh='cd ~/.config/zshconf'; - -alias gsuck='cd ~/.config/suckless'; -alias gdwm='cd ~/.config/suckless/dwm'; -alias gbar='cd ~/.config/suckless/dwmblocks'; - -alias gkey='cd ~/.config/suckless/shotkey'; - -alias gmutt='cd ~/.config/neomutt'; -alias gmuttp='cd ~/.work-config/neomutt'; - diff --git a/external/zsh/aliases/edit.zsh b/external/zsh/aliases/edit.zsh deleted file mode 100644 index fa5e1b6..0000000 --- a/external/zsh/aliases/edit.zsh +++ /dev/null @@ -1,17 +0,0 @@ -# Config editors -alias eorg='gnotes && sensible-editor index.md'; -alias ezsh='gzsh && sensible-editor ~/.zshrc'; -alias edot='sensible-editor ~/scripts/dotfiles.sh'; -alias evim='gvim && sensible-editor init.lua'; - -alias edwm='gdwm && sensible-editor config.def.h'; -alias ebar='gbar && sensible-editor blocks.h'; -alias ekey='gkey && sensible-editor config.h'; -alias equte='gqute && sensible-editor config.py'; -alias eas='sensible-editor ~/.config/autostart.sh'; -alias emime="sensible-editor ~/.bin/open"; - -alias ehosts='sudo nvim /etc/hosts'; - -alias emutt='gmuttp && sensible-editor ~/.config/neomutt/neomuttrc'; - diff --git a/external/zsh/aliases/git.zsh b/external/zsh/aliases/git.zsh deleted file mode 100644 index 47d8c0c..0000000 --- a/external/zsh/aliases/git.zsh +++ /dev/null @@ -1,70 +0,0 @@ -#function git_current_branch() { - #local ref - #ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) - #local ret=$? - #if [[ $ret != 0 ]]; then - #[[ $ret == 128 ]] && return # no git repo. - #ref=$(command git rev-parse --short HEAD 2> /dev/null) || return - #fi - #echo ${ref#refs/heads/} -#} - -# reset-origin a2_develop -reset-origin() { - if [[ -z $(git status -s) ]]; - then - currentBranch="$(git rev-parse --abbrev-ref HEAD)"; - branch="$1"; - git checkout $branch && - git pull && - git reset --hard origin/production && - git push -u origin $branch -f && - git checkout $currentBranch; - else - echo "Your branch is dirty. Stash or commit changed before proceeding"; - fi -} - -# Git aliases -alias g='git' - -alias ga='git add' -alias gaa='git add --all' - -alias gco='git checkout' -alias gb='git branch' - -alias gc='git commit -v' -alias gcm='git commit -v -m' -alias gc!='git commit -v --amend' - -alias gst='git status' -alias gd='git diff' -alias gl='git log' - -alias gp='git push' - -grename() { - if [[ -z "$1" || -z "$2" ]]; then - echo "Usage: $0 old_branch new_branch" - return 1 - fi - - # Rename branch locally - git branch -m "$1" "$2" - # Rename branch in origin remote - if git push origin :"$1"; then - git push --set-upstream origin "$2" - fi -} - -g_most_edited() { - git log --pretty=format: --name-only "$@" | \ - sort | \ - uniq -c | \ - sort -rg | \ - grep -E -v '.(html|scss|json)$' | \ - head -n 10 \ - ; -} - diff --git a/external/zsh/aliases/ls.zsh b/external/zsh/aliases/ls.zsh deleted file mode 100644 index b199563..0000000 --- a/external/zsh/aliases/ls.zsh +++ /dev/null @@ -1,22 +0,0 @@ -# Trash -alias trash="ls \$TRASH_TMP_DIR"; - -# List files aliases -alias ls="lsd"; -alias l="ls -1"; -alias la='ls -a'; -alias ll='ls -alF'; -alias lt='ls --tree'; -alias la='ls -A'; -alias lsize='du -h -d1'; - -lc () { # lf with cd to navigated directory on quit - tmp="$(mktemp)" - lf -last-dir-path="$tmp" "$@" - if [ -f "$tmp" ]; then - dir="$(cat "$tmp")" - rm -f "$tmp" - [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" - fi -} - diff --git a/external/zsh/aliases/npm.zsh b/external/zsh/aliases/npm.zsh deleted file mode 100644 index efc8ec7..0000000 --- a/external/zsh/aliases/npm.zsh +++ /dev/null @@ -1,20 +0,0 @@ - -# Node aliases -alias nr="npm run"; -alias ns="npm start"; -alias nt="npm test"; - -run_npm_script() { - [[ ! -f "package.json" ]] && return 1; - - local commands=$(node -e 'const pkg = require("./package.json"); Object.entries(pkg.scripts || {}).map(([key, value]) => console.log(`${key}\t\t "${value}"`))'); - - local result=$(echo -e "$commands" | fzf | cut -f1); - - [[ -z "$result" ]] && return 1; - yarn "$result"; -} - -zle -N run_npm_script; -bindkey '^B' run_npm_script; - diff --git a/external/zsh/aliases/system.zsh b/external/zsh/aliases/system.zsh deleted file mode 100644 index 48951a9..0000000 --- a/external/zsh/aliases/system.zsh +++ /dev/null @@ -1,13 +0,0 @@ - -# Pacman aliases -alias auto-remove="yay -Rcs \$(yay -Qdtq)"; -alias update="yay -Syu"; -alias mirrorlist-refresh="sudo reflector --latest 200 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist-arch" - -# Sandbox -alias sandbox="sudo ~/scripts/host-file-elb-update.sh"; - -# Runit helpers -sv_enable() { [[ -f "/etc/runit/sv/$1" ]] && sudo ln -s /etc/runit/sv/$1 /run/runit/service; } -sv_disable() { sudo unlink /run/runit/service/$1; } - diff --git a/external/zsh/aliases/xplt.zsh b/external/zsh/aliases/xplt.zsh deleted file mode 100644 index e2df43d..0000000 --- a/external/zsh/aliases/xplt.zsh +++ /dev/null @@ -1,55 +0,0 @@ -export WORDLISTS=~/dev/xploits/wordlist; -export ROCK_YOU_WORDS="$WORDLISTS/rockyou.txt"; -export URL_WORDS="$WORDLISTS/dirb/common.txt"; -export URL_WORDS_MED="$WORDLISTS/dirb/dirbuster/directory-list-lowercase-2.3-medium.txt"; - -# metasploit -alias msfc="msfconsole --quiet -x \"db_connect postgres@msf\"" -# exploitdb -alias ssplt="searchsploit" -alias sspx="searchsploit -x" - -# Port scan -alias rmap="docker run -it --rm --name rustscan rustscan/rustscan:1.10.0" - -# DVWA -alias dvwa="docker run --rm -it -p 80:80 vulnerables/web-dvwa" - -# Directory search -alias crawl="gobuster dir -w $URL_WORDS" -alias crawl_strict="gobuster dir -w $URL_WORDS_MED" - -new_room() { - take ~/dev/xploits/temp/$1; nvim README.md; -} - -jrock() { - [[ "$#" != "2" ]] && echo "jrock (format) (hashfile)" && return 1; - john -format="$1" "$2" -wordlist=$ROCK_YOU_WORDS; -} - -hrock() { - # Usage: hrock $mode $hashfile - # mode - (1800 for sha512crypt $6$) - [[ "$#" != "2" ]] && echo "hrock (mode-num) (hashfile)" && return 1; - hashcat -m "$1" "$2" -o ./out $ROCK_YOU_WORDS --force; -} - -hydra_ssh() { - # Usage: hydra_ssh $username $ip - [[ "$#" != "2" ]] && echo "hydru (username) (host)" && return 1; - hydra -l $1 -P $ROCK_YOU_WORDS ssh://$2 -V; -} -hydra_post() { - # Usage: hydra_post $username $ip $login-string - # /login:username=^USER^&password=^PASS^:incorrect - [[ "$#" != "2" ]] && echo "hydru (username) (host)" && return 1; - hydra -l $1 -P $ROCK_YOU_WORDS $2 http-post-form "$3" -V; -} - -ip_get() { - # Usage: ip_get [$ip] - curl https://json.geoiplookup.io/$1 | \ - jq '.ip + " | " + .asn + "(" + .district + ", " + .region + ")"'; -} - |
