Thransoft Light Utils R2 ======================== Licenced under the Three-Clause BSD Licence. See licence.txt for reference. 1. Simple Qotd Server --------------------- Returns a quote read in from a text file. Uses the very simple QOTD protocol as defined by RFC 865. I'm not a Python developer so please be considerate! I've a feeling that slapping everything in "global" isn't the python way. Perhaps there's a better OO or functional approach. But this is meant to be nothing more than a silly hackjob. Usage: qotd.py [quote text file] Language: Python Platforms Tested: GNU/Linux and Windows Client Usage: Use Telnet/Raw to connect to port 17 of your host. The server will send the current QOTD then close the connection. Alternatively run 'nc [hostname] 17' on the Unix environment of your choice. Server Usage: This must be run either as a super-user on GNU/Linux or as an Administrator on Windows. Otherwise QOTD cannot bind to port 17. Known Bugs: -There's no way to stop the server on Windows. I tried to implement a -Ctrl-C Keyboard Interrupt but it doesn't work on Windows; it does on Linux. Improvements: Could I make it pull QOTDs from some configurable online souce? Could I make it actually a Quote of the DAY and rotate the sent quote each day? It needs much better error handling and efficiency improvements. Implement it in C, Rust, Erlang or some better-adapted language. Release History: R1: 25/04/2019. First functional release with ability to read in text files. 2. locatehere ------------- When using the "locate" tool to search your filesystem it zealously returns every match from the whole file system. So I wrote this simple script to return matches only inside the current directory and its subdirectories. Installation: Copy to /usr/bin. Requires "locate" to be already installed. Usage: locatehere Language: Bash Platforms Tested: GNU/Linux Known Bugs: -None yet. Improvements: Better installation method. I'm looking at makefiles. Release History: R2: 20/08/2019. First release. 3. retart --------- Just for fun. Sometimes you mean "bake a tart again" instead of "boot the computer again". Fresh and crispy each time. Installation: 'mv retart.sh /usr/bin/retart' Usage: retart Language: Bash Platforms Tested: GNU/Linux Improvements: We need more than one variety of tart. Perhaps implement this by way of getopts or positional parameters. Release History: R2: 20/08/2019. First release. 4. copyLogs.sh -------------- I set my raspberry pi to mount its log directory as a "tmpfs" or RAM drive. This was to ease wear on the SD card; I had my previous one ground to death from logfile writes. However I wished to preserve my logs after a system reboot. And hence, copyLogs was born. It copies the contents of the "/var/log" directory to a (likely) network location at regular intervals. These are then tarred and gzipped with the date as a filename. Also, it is meant to purge the log storage location of logs older than a set date but that doesn't work yet. Installation: -Copy "copyLogs.sh" somewhere appropriate, such as /usr/local/bin -Copy "copyLogs.config" to somewhere appropriate, such as /usr/local/etc -Edit copyLogs.sh to ensure the config file path is correct. -Configure copyLogs.config as you desire -Run crontab -e. Set '/bin/bash /path/to/copyLogs.sh' to run at the desired interval. The call to /bin/bash is necessary or the script will not be called. Usage: Leave it to cron. Language: Bash Platforms Tested: GNU/Linux Known Bugs: -The "purge logs" function is implemented but broken. Still, the script is good for its true calling without this working. Release History: R2: 20/08/2019. First release.