commit 74412bbae826f2ce1abfcbdd6d589bd8813a97a4 Author: Shoofle Date: Tue Feb 8 14:49:04 2022 -0500 Prior work diff --git a/cygnus.service b/cygnus.service new file mode 100644 index 0000000..002a054 --- /dev/null +++ b/cygnus.service @@ -0,0 +1,10 @@ +[Unit] +Description=Generate a new fortune for the cygnus landing page. + +[Service] +Type=oneshot +ExecStart=python /home/shoofle/cygnus/update_fortune.py +User=shoofle + +[Install] +WantedBy=multi-user.target diff --git a/cygnus.timer b/cygnus.timer new file mode 100644 index 0000000..11f818e --- /dev/null +++ b/cygnus.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Timer for update_fortune.py + +[Timer] +OnCalendar=daily +AccuracySec=1m +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/cygnus_log b/cygnus_log new file mode 100644 index 0000000..e93a6fc --- /dev/null +++ b/cygnus_log @@ -0,0 +1,35 @@ +enable ssh +use usermod to rename pi to cygnus +make a shoofle user, add her to sudoers with usermod, move the ssh pubkey over + +set up samba +set up a samba password for the cygnus user maybe, so that i can get into the cygnus home folder +install nginx? + +added the following lines to /etc/fstab to get 55 cancri b and ct chameleontis b to mount!!! +> #okay let's go into the scary realm +> PARTUUID=9eb03fc3-01 /media/55\040Cancri\040B vfat auto,exec,rw,sync,nouser 0 0 +> PARTUUID=acafe9ba-747a-42dc-bd3e-3d6cf775a523 /media/CT\040Chameleontis\040b ntfs auto,exec,rw,sync,nouser 0 0 +changed this later so that it mounted Gliese 180 a/b to /mnt/sthose, might eventually move them to /media, whatever + +now editing the /etc/samba/smb.conf or whatever to reflect the new locations of those folders + +gotta install fuse and ntfs-3g with apt-get + +make sure that at least the relevant parts of the data store are chmod 777 because they need access from the guest user + +installed nginx! +wrote a little landing page letting people know what cygnus is. + +installed smartmontools for monitoring drive healt + +installed fortune-mod so i can get fortunes + +installed python-is-python3 and python3-pip so that i can have python working better + +wrote the service and timer files for updating the fortune, then symlinked them into /etc/systemd/system/ +if i want to restart them i can do `systemctl restart cygnus`, and perhaps if i want to reload the config file i do `systemctl daemon-reload`? oh also remember `systemctl list-timers` + +minor note but in the scripts to be run by the system, make sure that things don't depend on environment variables and such unless you really want it. for example use the explicit full path to a program instead of just `fortune` use `/usr/games/fortune` because the environment configures where to look for executables. + +installed yt-dl (through apt) and then yt-dlp because yt-dl didn't work https://github.com/yt-dlp/yt-dlp#installation diff --git a/index.html b/index.html new file mode 100644 index 0000000..61df243 --- /dev/null +++ b/index.html @@ -0,0 +1,23 @@ + + + +Welcome to cygnus! + + + +

Welcome to cygnus!

+

You've reached the cygnus homepage! Cygnus is pear house's NAS, or network attached storage. Hopefully in the future, this page will be automatically updated with information about cygnus, drive status, backups tatus, and possibly other things like a view of the backyard!

+ +

The system administrator for this computer is Ada "Shoofle" Munroe. Contact her if you have any questions or cool ideas for things cygnus could do!

+ +

Thank you for visiting!!!

+ +

The following fortune is taken from the unix fortune file and should not be considered legally binding. At some point soon I'll curate them to only have ones that I would be comfortable popping up at random to our house.

+ +
fortune goes here
+ + diff --git a/update_fortune.py b/update_fortune.py new file mode 100644 index 0000000..5da4adb --- /dev/null +++ b/update_fortune.py @@ -0,0 +1,19 @@ +from bs4 import BeautifulSoup +import os + +fortune = os.popen("/usr/games/fortune | /usr/games/cowsay").read() + +file_name = "/var/www/html/index.html" +soup = None + +print("The emergency fortune system has set the fortune to {}".format(fortune)) + +with open(file_name, "r") as the_file: + soup = BeautifulSoup(the_file, features="html.parser") + + fortune_holder = soup.find(id="fortune-container") + + fortune_holder.string = fortune + +with open(file_name, "w") as the_file: + the_file.write(str(soup))