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 vissh="$EDITOR ~/.ssh/config"
alias vihosts="sudo -e /etc/hosts" alias vihosts="sudo -e /etc/hosts"
if type htop >/dev/null; then alias top="htop"
alias top="htop"
fi
alias http-server="python -m http.server" alias http-server="python -m http.server"
alias rename="perl-rename" alias rename="perl-rename"

View File

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