1
0
Fork 0

update function and scripts

This commit is contained in:
Massaki Archambault 2018-04-11 15:52:53 -04:00
parent 0b866e6c06
commit c3b7530ae2
3 changed files with 18 additions and 5 deletions

View File

@ -2,10 +2,7 @@ alias svim="sudo -e"
alias vissh="$EDITOR ~/.ssh/config"
alias vihosts="sudo -e /etc/hosts"
if type htop >/dev/null; then
alias top="htop"
fi
alias top="htop"
alias http-server="python -m http.server"
alias rename="perl-rename"

View File

@ -1,19 +1,22 @@
# edit alias
vialias() {
$EDITOR $ZSH_CUSTOM/100-alias.zsh
source $ZSH_CUSTOM/100-alias.zsh
}
# edit function
vifunction() {
$EDITOR $ZSH_CUSTOM/101-function.zsh
source $ZSH_CUSTOM/101-function.zsh
}
# scan network
nmap-libvirt() {
__nmap_iface 'virbr[0-9]+' $@
}
nmap-tun() {
__nmap_iface 'tun[0-9]+' $@
__nmap_iface '(tun|tap)[0-9]+' $@
}
nmap-local() {
@ -34,3 +37,8 @@ __nmap_iface() {
printf "Scanning %s\n" "$addr"
nmap $opt $addr_list
}
# calculator
\=() {
bc -l <<<"$*"
}

8
files/.local/bin/lsiommu Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
shopt -s nullglob
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done;