Happy Cirno⑨ day!

Today is the ⑨th day of the ⑨th month in the year 2022; that means it’s the Cirno day!

This is my first figure posting in many years (five, actually). Contrary to my usual style of writing these anime etc. figure reviews in my native Finnish and just adding a short English summary, I’m doing the opposite now and writing mostly in English.

I have fallen totally in love with all things Touhou (東方Project): the original games (yes, I’m BAD at playing them…), the spinoff games, the community/fan content – comics, videos, cosplay, games – and especially the wonderful music composed by ZUN itself and the various remixes made by the community. It seems that lately I haven’t been listening much else than Touhou related music. Fact: ZUN (太田 順也, Ōta Jun’ya) is one of the best composers of our time.

Like every Touhou fan, I have my own preferences among the denizens of Gensokyo. I like the Koishi + Kokoro couple, also the arguments between the two idiots Kaguya and Mokou are hilarious. No-one can really avoid liking Marisa… But for some reason or other the dim-witted, stubborn, overconfident, childish ice fairy Cirno seems to always rise above the others. So not to feel all alone during the Covid epidemy I had to somehow get a Nendoroid version of Cirno to stand on top of my desktop computer…

CIRNO IS THE STRON⑨EST!!!

After having graduated from the Perfect Math Class, she has also became an Einstein-grade mathematical genius. Here’s the proof:

∞+1=⑨

Right?


Cirno with her customary overconfident grin and posture.

I AM THE STRONGEST!

Side glance.

Fufufu...

Icy wings.

Admire my wings!

Wait, there’s something interesting between her legs…

Don't look!

IT’S ONLY THE NUMBER ⑨!!! BAKA!!!

Baka!

This Cirno figure is the number 167 of the “Nendoroid”-series manufactured by the Good Smile Company, originally released in August 2011. It’s bit of a shame I didn’t understand to start collecting Touhou Nendoroids back then, nowadays they are quite difficult to find, and being collector’s items, more expensive now than when new.


For those who are uneducated enough to not to be aware of the connection between Cirno and the number ⑨ (nine), please see the explanation in the Touhou Wiki.


…Ja sitten sama suomeksi… no ei, jääköön lyhyeksi yhteenvedoksi:

Tämä on tosiaan ensimmäinen figuuripostaukseni viiteen vuoteen. Tänä aikana minusta on tullut totaalinen Touhou-fani. ZUN’in musiikki ennenkaikkea kiinnostaa, mutta tottakai kaikki muukin Gensokyo’n alueella tapahtuva.

Ylläoleva Cirno-figuuri on GSC’n “Nendoroid”-sarjaa, julkaistu elokuussa 2011.

Posted in Anime | Tagged , , , , | Comments Off on Happy Cirno⑨ day!

Delaying the start of a systemd unit at boot

I’m keeping an eye on what’s going on with my servers via remote Gkrellm system monitors.

I noticed that on one server the hardware sensors seemed to need a bit more time than normal to initialize on boot, so the gkrellmd daemon occasionally missed some sensor information, requiring a manual restart of gkrellmd.service after boot.
The solution was to delay the start of gkrellmd.service on boot, by creating a file gkrellmd.timer in /etc/systemd/system/ (please note that the timer needs to have the same name as the service it controls):

  1. [Unit]
  2. Description=Delay starting of gkrellmd on boot
  3.  
  4. [Timer]
  5. OnBootSec=1min
  6.  
  7. [Install]
  8. WantedBy=timers.target

Then the original service needs to be disabled and the new timer enabled:

systemctl disable gkrellmd.service
systemctl enable gkrellmd.timer
Posted in Linux | Tagged , , | Comments Off on Delaying the start of a systemd unit at boot

Haru desu yo!!!

Lily White does her best to convince us that “Spring is here!!!”, but looking at the temperature outside, it seems that Cirno has been freezing something else beside her usual frogs…

Posted in Uncategorized | Tagged , | Comments Off on Haru desu yo!!!

Tempus fugit

Today is the 10th anniversary of when I started this – way too occasional – WordPress-based blog.
The server hardware is on its third version, software is still courtesy of Larry the Cow… er, that is, Gentoo Linux.

Ten years. Moo…

Posted in Linux | Tagged , , , , | Comments Off on Tempus fugit

WordPress backups to a remote server

Earlier, I used a WordPress plugin to do periodic backups of the sites I’m hosting, but I came to a conclusion that it would be more reliable, flexible and fun to do the backups via a system script instead, sending the resulting backup archives to a remote server. Here’s how I ended up doing it:

First, I wanted to create a separate mariadb/mysql user with only just enough privileges to be able to make a mysqldump (using the “Principle of Least Privilege“; for the same reason the backup script is executed by an user, not by root). I chose the username ‘dumpo’ because… well. he just dumbly dumps stuff:

MariaDB [(none)]> CREATE USER 'dumpo'@'localhost' IDENTIFIED BY '<dumpopasswd>';
MariaDB [(none)]> GRANT SELECT, SHOW VIEW, LOCK TABLES, RELOAD, REPLICATION CLIENT ON *.* TO 'dumpo'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;

Then, the mysqldump user’s credentials must be stored in the ~/.my.cnf file within the backup-executing user’s home directory. Afterwards, run chmod 600 ~/.my.cnf to set the correct permissions.

  1. [mysqldump]
  2. user=dumpo
  3. password=<dumpopasswd>

The actual backup script below is executed by an user’s cronjob once a week. I added a lot of comments to the example script to explain how it works.

  1. #!/bin/bash
  2.  
  3. # The device acting as a fileserver for WP backups is not always powered up,
  4. # so let's use Wake-On-LAN to make sure it is up when it is actually needed.
  5. wol <mac-address-of-fileserver>
  6.  
  7. # I happen to have the same username on both the webserver and the fileserver,
  8. # that simplifies some settings.
  9. USER=<user-running-the-script>
  10. WPUSER=dumpo
  11. BFILENAME=backupwp-$(date +%d%m%Y)
  12. # I'm mailing the backup messages somewhere.
  13. MAILADR=someone@somewhere.com
  14.  
  15. # Let's make a temporary working directory on the users home directory.
  16. cd /home/${USER}
  17. mkdir -p backupdb
  18.  
  19. # I have three Wordpress sites on the server.
  20. # Dump the mariadb databases of those sites to the working directory.
  21. mysqldump -u ${WPUSER} SITE1 > backupdb/SITE1.sql
  22. mysqldump -u ${WPUSER} SITE2 > backupdb/SITE2.sql
  23. mysqldump -u ${WPUSER} SITE3 > backupdb/SITE3.sql
  24. mysqldump -u ${WPUSER} mysql > backupdb/MYSQL.sql
  25. echo -e "Database dump: done"
  26.  
  27. # Copy the Wordpress installations to the working directory.
  28. cp -a /var/www/site1.com backupdb/
  29. cp -a /var/www/site2.com backupdb/
  30. cp -a /var/www/site3.com backupdb/
  31. echo -e "Website copy: done"
  32.  
  33. # Make a tar.gz archive of the contents of the working directory.
  34. tar -czf ${BFILENAME}.tar.gz backupdb
  35. echo -e "Archive: done"
  36.  
  37. # Check whether the fileserver is up and running. I'm checking the port 22
  38. # (ssh) because I'll be using rsync with ssh for upload. The loop waits for
  39. # 5 minutes for the connection, and then gives up and mails an error message.
  40. # Waiting for 5 minutes may actually be useless, because the fileserver usually
  41. # boots up within a minute, and making the backup archive already takes up some
  42. # 3-4 minutes. But just in case...
  43. CHECK=0
  44. until [[ `nmap <fileserver-ip-addr> -p 22 | grep "Host is up"` ]]
  45. do
  46.     if [ $CHECK -ge 60 ]; then
  47.         echo -e "File server unreachable, aborting!!! $(date '+%d-%m-%Y %T')" | mail -s "Backup" ${MAILADR}
  48.         exit 1
  49.     fi
  50.     sleep 5
  51.     let CHECK++
  52. done
  53.  
  54. # Send the backup archive to the fileserver using rsync with ssh.
  55. rsync -e ssh ${BFILENAME}.tar.gz ${USER}@<fileserver-ip-addr>:/home/${USER}/wpbackup/
  56.  
  57. # If the upload was succesful, clean up by removing the local archive and
  58. # temporary  working directory, and mail a success message; otherwise, leave
  59. # everything as it is and mail a failure message.
  60. if [[ $? == 0 ]]; then
  61.     rm ${BFILENAME}.tar.gz
  62.     rm -rf backupdb
  63.     echo -e "Wordpress and mariadb backup completed successfully at $(date '+%d-%m-%Y %T')" | mail -s "Backup" ${MAILADR}
  64. else
  65.     echo -e "Archive upload failure!!! $(date '+%d-%m-%Y %T')" | mail -s "Backup" ${MAILADR}
  66.     exit 1
  67. fi

Finally, at the fileserver end, a script – executed by the cron some time after the upload – rotates and cleans up the backups, leaving only the 4 latest backup archives:

  1. #!/bin/bash
  2.  
  3. cd /home/<user>/wpbackup
  4. echo -e "Rotating Wordpress backups, removing following files:\n"
  5. ls -1t | tail -n +5 | xargs rm -v # That is 'ls dash one t'.
Posted in Linux | Tagged , , , , | Comments Off on WordPress backups to a remote server