Bash Snipets

Z Waritkova wiki
Skočit na navigaci Skočit na vyhledávání

Get all video files in dir recursive

find . -regextype posix-extended -regex '.*\.(avi|mkv|flv|mov|mpg|wmv|mp4|m4v|rm)' -exec realpath {} + | sort

Convert subtitles from Win-1250 to UTF8

ls *.srt | while read a; do iconv -f WINDOWS-1250 -t UTF-8 "$a" > temp; mv temp "$a"; done;

NetFlows capture Eth + Loopback

nfcapd -u waritko -g waritko -w -t 3600 -b 127.0.0.1 -p 9223 -l /var/log/netflows-lo/ -S 1 -z -D -I lo
nfcapd -g waritko -u waritko -b 127.0.0.1 -p 9123 -w -z -S 1 -l /var/log/netflows/ -I em1 -T all -D

Centos 7 list all services

systemctl list-unit-files --type=service