Simple one, it monitor regularly the Established connection to file: Continue reading “Monitor TCP Connection in bash regularly”
find files more than specific size
find ./ -size +5G -exec sh -c ‘ls -h “{}”|egrep -i -q “*.(avi|AVI|mkv|MKV|mp4|MP4)$”‘ ‘;’ -print
Execute the same command on multiple Linux host in once
I found difficult to maintain updates over multiple hosts however, some tool exist to facilitate that time of maintenance steps.
Alternatively, some python script could also be used however I have decided to present that one for now.
Continue reading “Execute the same command on multiple Linux host in once”
Download file from box using cli (wget)
wget -v -O myfile.tgz -L https://xxxx.box.com/shared/static/xxxxx.tgz
Log rotation in bash
This is a little bash script that rotate logs as when the file reach a specified limit.
Monitor wlan0 Interface (Wireless) to avoid disconnection from Raspberry Pi
I had implemented my raspberry pi to use wireless network, unfortunately the connection might after a while disconnect, the only option that I have found was to run a script that check the connection and re-connect if network is down.
Continue reading “Monitor wlan0 Interface (Wireless) to avoid disconnection from Raspberry Pi”
Hydra in bash
Run Hydra in bash upon a password list;
ncat for the potential port for each protocol, some additional port / protocol could be added of course.
You will require to set couple of file, one would be login (one user per line) + password (still one by line)
Handbrake-cli on Centos
First, let install the prerequisites as if needed:
removing lines number in bash (using sed)
Working from text files, sometime you might come accross the need to remove the line numbers from line into a file.
cat file_with_line_nbers | sed 's/ *[0-9]*.//' > my_new_file
Sensor CPU check in bash
This script is checking the CPU Temp sensor; If one reach the threshold then a notification or shutdown (if needed) is done.
A few variables required to be set; then you are done