updated some aliases and scripts
This commit is contained in:
@@ -5,8 +5,10 @@ alias '+'='pushd .'
|
|||||||
alias -- '-'='popd'
|
alias -- '-'='popd'
|
||||||
[[ -f ~/.shell_aliases ]] && . ~/.shell_aliases
|
[[ -f ~/.shell_aliases ]] && . ~/.shell_aliases
|
||||||
[[ -f ~/.config/z.sh ]] && . ~/.config/z.sh
|
[[ -f ~/.config/z.sh ]] && . ~/.config/z.sh
|
||||||
[[ -f /home/tke/.http_proxy ]] && . /home/tke/.http_proxy #PROXY_A93JK2
|
[[ -f ~/.oh-my-zsh/plugins/z/z.sh ]] && . ~/.oh-my-zsh/plugins/z/z.sh && set $_Z_OWNER=$(whoami)
|
||||||
|
[[ -f ~/.cargo/bin/zoxide ]] && . <(~/.cargo/bin/zoxide init bash)
|
||||||
|
[[ -f ~/.http_proxy ]] && . /home/tke/.http_proxy #PROXY_A93JK2
|
||||||
[[ -f /usr/share/doc/fzf/examples/key-bindings.bash ]] && source /usr/share/doc/fzf/examples/key-bindings.bash
|
[[ -f /usr/share/doc/fzf/examples/key-bindings.bash ]] && source /usr/share/doc/fzf/examples/key-bindings.bash
|
||||||
[[ -f /usr/share/doc/fzf/examples/completion.bash ]] && source /usr/share/doc/fzf/examples/completion.bash
|
[[ -f /usr/share/doc/fzf/examples/completion.bash ]] && source /usr/share/doc/fzf/examples/completion.bash
|
||||||
HISTTIMEFORMAT="%F %T "
|
HISTTIMEFORMAT="%F %T "
|
||||||
shopt -s autocd
|
shopt -s autocd
|
||||||
|
|||||||
@@ -43,3 +43,6 @@ function dockertags() { tags=`wget -q https://registry.hub.docker.com/v1/rep
|
|||||||
alias pip='pip3'
|
alias pip='pip3'
|
||||||
alias python='python3'
|
alias python='python3'
|
||||||
alias usbb="usbguard list-devices -b"
|
alias usbb="usbguard list-devices -b"
|
||||||
|
alias searchpackage="apt-cache search '' | sort | cut --delimiter ' ' --fields 1 | fzf --multi --cycle --reverse --preview 'apt-cache show {1}' | xargs -r sudo apt install -y"
|
||||||
|
which exa >/dev/null && alias ll='exa -l --git --icons'
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,12 @@ def avgdiff(values):
|
|||||||
c = sum([abs(x[0]-x[1]) for x in zip(a,b)])
|
c = sum([abs(x[0]-x[1]) for x in zip(a,b)])
|
||||||
return c/len(a)
|
return c/len(a)
|
||||||
|
|
||||||
aggregator('avgdiff', avgdiff)
|
vd.aggregator('avgdiff', avgdiff)
|
||||||
|
|
||||||
def distinct_list(values):
|
def distinct_list(values):
|
||||||
return [x for x in set(values)]
|
return [x for x in set(values)]
|
||||||
|
|
||||||
aggregator('distinct_list', distinct_list)
|
vd.aggregator('distinct_list', distinct_list)
|
||||||
|
|
||||||
def logtime(val):
|
def logtime(val):
|
||||||
a=str(val)
|
a=str(val)
|
||||||
@@ -171,6 +171,15 @@ def ipinfo(ip, type="country"):
|
|||||||
except:
|
except:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
def split_number2ip(number):
|
||||||
|
number=str(number)
|
||||||
|
import re
|
||||||
|
pattern=re.compile("^([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$")
|
||||||
|
match = pattern.match(number)
|
||||||
|
if match:
|
||||||
|
return ".".join(match.groups())
|
||||||
|
else:
|
||||||
|
return number
|
||||||
|
|
||||||
@functools.lru_cache()
|
@functools.lru_cache()
|
||||||
def mx_lookup(domain):
|
def mx_lookup(domain):
|
||||||
|
|||||||
Reference in New Issue
Block a user