{{ project:sorry_vole_error.gif}} * LINUX BASICS Public Wiki by Over and LiPo: [[http://wiki.li-on.cz/|http://wiki.li-on.cz/]] * A lot of interesting and useful commands and info for Linux machine [BASH positive] - to be rewritten to Doc: [[https://over23.github.io/r00t_l4b/useful_linux.html|https://over23.github.io/r00t_l4b/useful_linux.html]] ===== test machine and scripts ===== [[test questions]] [[broken machine]] ===== parse IRC logs only for http - example ===== grep -A 2 http ~/irclogs/freenode/#labka.log | uniq | grep -v -e "-!-"> ~/grep_irssi_http2.txt ===== transform Czech and other diacritics to pure ascii ===== $ cat pismenka1.txt | iconv -f utf8 -t ascii//TRANSLIT//IGNO RE> ascii.txt ===== invert text to reverse [whatever = revetahw] ===== $ echo "whatever" | rev ===== get me emails from gmail - fokin dangerous!!! ===== curl -u "email":"passwd" --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "\t" if //; print "$2\n" if /<(title|name)>(.*)/;' | awk -v FS="(|)" '{print $2}' * get me emails from gmail * parse only number of new emails there ===== used swap space ===== for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2" " $3}END{print ""}' $file; done | sort -k 2 -n -r | less ===== change fish to bash ===== usermod -s /usr/bin/fish username ====== Tools ====== * nikto * sqlmap * [[https://www.owasp.org/index.php/ZAP|https://www.owasp.org/index.php/ZAP]] * files over 50Megs find . -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' * find and kill some running process kill `ps aux | grep -F 'myServer' | grep -v -F 'grep' | awk '{ print $2 }'` ====== OpenVPN ====== * [[https://www.howtoforge.com/tutorial/how-to-install-openvpn-on-centos-7/|https://www.howtoforge.com/tutorial/how-to-install-openvpn-on-centos-7/]] {{ :project:siroky_vtip.jpg?800}} ====== FFMPEG convert script ====== #!/bin/bash -x for f in *.mp4 do soubor="/Users/pavouk/Movies/xxx/$f" soubor2="/Users/pavouk/Movies/xxx_h265/$f" /usr/local/bin/ffmpeg -i ${soubor} -c:v libx265 -preset medium -codec:a aac -strict experimental -b:a 128k ${soubor2} done ====== Get a rid of spaces in dir ====== for f in *\ *; do mv "$f" "${f// /_}"; done