diff --git a/bin/countships b/bin/countships new file mode 100755 index 0000000..5700456 --- /dev/null +++ b/bin/countships @@ -0,0 +1,27 @@ +#!/bin/sh +all_users=$(grep -E '1[0-9]{3}' "/etc/passwd" | grep 'home' | awk -F":" '{print $1}') + +finish () { + if [ -f "$temp_shiplist" ]; then + rm "$temp_shiplist" + fi +} +trap finish EXIT + +# use temp file for accumulator +temp_shiplist=$(mktemp -t "$(basename "$0").shiplist.XXXXXXX") || exit 1 + +# find all ship folders +find "/var/gopher/" -maxdepth 1 ! -path "/var/gopher/" ! -path "/var/gopher/ships" ! -path "/var/gopher/log" -type d | while read -r shipdir +do + owner=$(stat -c %U "$shipdir") + printf "%s\\n" "$owner" >> "$temp_shiplist" +done + +sort "$temp_shiplist" | uniq -c | sort -k1,1nr -k2,2n | awk '{print $1, $2}' + +for u in $all_users; do + if ! grep -q "$u" "$temp_shiplist"; then + printf "0 %s\\n" "$u" + fi +done diff --git a/man/cosmic.voyage.1 b/man/cosmic.voyage.1 index c223a43..897be13 100644 --- a/man/cosmic.voyage.1 +++ b/man/cosmic.voyage.1 @@ -50,6 +50,16 @@ Finally, users may find up-to-date comprehensive guides on the system wiki by running the .B wiki command. +.SH NOTES +This is a full Ubuntu environment and allows users to do far more +than simply write stories. Feel free to take advantage of the +tools available here to experiment with other aspects of the +command line. We have many programming languages / compilers +installed. +.PP +Users are also allowed to run reoccuring or scheduled tasks using +cron-jobs. If you do this, please include `/usr/bin/nice -n 19' +before any tasks you run to minimize the system load over time. .SH BUGS There are probably many bugs in this system. Please report anything you find by mailing