Lets say you want to do some math like 3/5 or 1/2, etc (any float point math). You can do something like this echo 3 5 | awk '{print $1/$2}' The problemRead More…
watch_execve & watch_kill – see new commands & kills – FreeBSD – Snoopy for FreeBSD
watch_execve – FreeBSD – see processes being created In Linux you can use the following 2 articles/methods to monitor commands as they happen on any shell on your server (good for studyingRead More…
Mounting NTFS (windows filesystem) on Linux with ntfs-3g or ufsd
You can mount ntfs a couple of different ways in linux. Here is how you do it with ufsd or ntfs-3g. ufsd needs a kernel module installed. ntfs-3g can just be installedRead More…
iptables -A INPUT -m conntrack –ctstate ESTABLISHED,RELATED -j ACCEPT
Firewalls usually block all inbound connections (unless we have a port forward setup, or the traffic is return traffic). Also firewalls usually allow all outbound traffic (unless we are in a veryRead More…
How Versions of SAMBA relate to versions of SMB/CIFS
Wait you thought Samba and SMB and CIFs are all the same thing? Well kind of. The are all part of the same protocol that allows file sharing, and gives you theRead More…
WordPress Count Users Created Each Day Stats
Login to Mysql (notice username and password touch the -u and -p argument) # mysql -uusername -ppassword mysql> SHOW databases; +——————–+ | Database | +——————–+ | information_schema | | mysql | |Read More…
See if files/folders/symlinks/etc… are missing from Debian Package
Lets see what files are missing from packages that are partially installed. Note this will not work on packages that are not at least part way installed (they need to be listedRead More…
inotify-utils: Monitor new files before they delete – example /tmp scripts
If you have binary programs or scripts generating files in /tmp and you want to grab them before they disappear, then use this script. You can copy them. If you copy themRead More…
Debian – See all files in packages with word in them – double xargs
Final: (PKG="linux"; dpkg -l | grep $PKG | awk '{print $2}' | xargs -I %% /bin/bash -c 'echo "—%%—-"; dpkg -L "%%" | xargs -I @@ /bin/bash -c "[[ -f '@@' ]]Read More…
Check Line Ending Type with Hex tool like OD – EOL end of line character
Check for line endings with od (also you can use other hex tools with -c option – which is the Printable Characters format) od -c file DOS: \r \n (carriage return andRead More…