From ecc46ef2da7fafd1e8903e5bac593d3787993e71 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 11 Dec 2021 12:10:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=20?= =?UTF-8?q?systemadmin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 48-plugins.zsh | 1 - 65-scripts.zsh | 24 ++++++++++++++++++++++++ 75-aliases.zsh | 3 +++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/48-plugins.zsh b/48-plugins.zsh index 67c80ae..8815400 100644 --- a/48-plugins.zsh +++ b/48-plugins.zsh @@ -26,7 +26,6 @@ zcomet load ohmyzsh plugins/debian zcomet load ohmyzsh plugins/isodate zcomet load ohmyzsh plugins/nmap zcomet load ohmyzsh plugins/rsync -zcomet load ohmyzsh plugins/systemadmin zcomet load ohmyzsh plugins/web-search zcomet load brymck/print-alias diff --git a/65-scripts.zsh b/65-scripts.zsh index 7826074..ab75d89 100644 --- a/65-scripts.zsh +++ b/65-scripts.zsh @@ -55,3 +55,27 @@ exdl() { fi done } + +psgrep() { + ps aux | grep "${1:-.}" | grep -v grep +} + +# Kills any process that matches a regexp passed to it +killit() { + ps aux | grep -v "grep" | grep "$@" | awk '{print $2}' | xargs sudo kill +} + +# gather external ip address +geteip() { + curl -s -S -4 https://icanhazip.com + curl -s -S -6 https://icanhazip.com +} + +# determine local IP address(es) +getip() { + if (( ${+commands[ip]} )); then + ip addr | awk '/inet /{print $2}' | command grep -v 127.0.0.1 + else + ifconfig | awk '/inet /{print $2}' | command grep -v 127.0.0.1 + fi +} diff --git a/75-aliases.zsh b/75-aliases.zsh index a2619a4..46d69a0 100644 --- a/75-aliases.zsh +++ b/75-aliases.zsh @@ -5,6 +5,9 @@ alias dotdrop="$HOME/etc/dotdrop.sh" --cfg="$HOME/etc/config.yaml" alias zcp='zmv -C' alias zln='zmv -L' +alias path='print -l $path' +alias mkdir='mkdir -pv' + # APT alias aptu='sudo apt-get update' alias aptn='sudo apt-get update && sudo apt-get dist-upgrade'