8 bells and all’s well

I'm a geek. This should surprise noone reading this. I'm also a nut for all things nautical. After watching a movie with a phantom ship and it's bell, I came up with the idea of having my computer alert me every hour, with a bell. Basically a reminder to get up every now and again and move, so I don't end up with more back issues. Simple enough, add a cron entry of

0 * * * * /usr/bin/play /home/vulpine/.wavs/Dagon-Bell.wav

Simple...but not historically accurate. Traditionally, a bell was rung every half hour in a watch, up to 8 times. Watches started at midnight, and ran 4 hours. So if you started at midnight, and heard 5 bells, you'd know it was 2:30am and you still had 90 min to go. Simple enough

So I started pondering how I could write a script to do this...and after a few minutes of pondering counts and calls and such, I went for the not so elegant, but easy process of writing 8 seperate crontab entries, one for each bell count. So it looks as such.

30 0,4,8,12,16,20 * * * /usr/bin/mplayer -loop 1 /home/vulpine/.wavs/Dagon-Bell.wav
00 1,5,9,13,17,21 * * * /usr/bin/mplayer -loop 2 /home/vulpine/.wavs/Dagon-Bell.wav
30 1,5,9,13,17,21 * * * /usr/bin/mplayer -loop 3 /home/vulpine/.wavs/Dagon-Bell.wav
00 2,6,10,14,18,22 * * * /usr/bin/mplayer -loop 4 /home/vulpine/.wavs/Dagon-Bell.wav
30 2,6,10,14,18,22 * * * /usr/bin/mplayer -loop 5 /home/vulpine/.wavs/Dagon-Bell.wav
00 3,7,11,15,19,23 * * * /usr/bin/mplayer -loop 6 /home/vulpine/.wavs/Dagon-Bell.wav
30 3,7,11,15,19,23 * * * /usr/bin/mplayer -loop 7 /home/vulpine/.wavs/Dagon-Bell.wav
00 0,4,8,12,16,20 * * * /usr/bin/mplayer -loop 8 /home/vulpine/.wavs/Dagon-Bell.wav

I used mplayer over play or other apps because it was the easiest to find a command to play X repeates (the -loop). The cron times match up with when each bell set would ring, so 8 lines and about 3 min vs Cthulhu knows how long to write a single script that was called every 30 min, and kept a self count. Given my druthers, and my career of writing these kind of kludges because I had some crazy file foo dumped on my desk, and I didn't want to manually tweak the data, I prefer the 3 min kludge.

If you're bored, and want your computer to be all Age of Sail, all need is the above crontab entries (modified for your home directory path, and if mplayer is located somewhere else in your directory structure), the bell sound (there's a ton of free ones out there, the one I use can be grabbed here), and well a Unix based install with mplayer installed. Mac users, this probably will work for you, though you may need some other player program. Windows users, sorry...while it shouldn't be hard to replicate this, I have no clue off the top of my head. Good luck?

If you don't have your bells and watches memorized, here's a handy guide.

Time as marked by the bells

Mid Morning Forenoon Afternoon Dogs First
0030 - 1 bell 0430 - 1 bell 0830 - 1 bell 1230 - 1 bell 1630 - 1 bell 2030 - 1 bell
0100 - 2 bells 0500 - 2 bells 0900 - 2 bells 1300 - 2 bells 1700 - 2 bells 2100 - 2 bells
0130 - 3 bells 0530 - 3 bells 0930 - 3 bells 1330 - 3 bells 1730 - 3 bells 2130 - 3 bells
0200 - 4 bells 0600 - 4 bells 1000 - 4 bells 1400 - 4 bells 1800 - 4 bells 2200 - 4 bells
0230 - 5 bells 0630 - 5 bells 1030 - 5 bells 1430 - 5 bells 1830 - 5 bells 2230 - 5 bells
0300 - 6 bells 0700 - 6 bells 1100 - 6 bells 1500 - 6 bells 1900 - 6 bells 2300 - 6 bells
0330 - 7 bells 0730 - 7 bells 1130 - 7 bells 1530 - 7 bells 1930 - 7 bells 2330 - 7 bells
0400 - 8 bells** 0800 - 8 bells 1200 - 8 bells 1600 - 8 bells 2000 - 8 bells 2400 - 8 bells
(Guide cheerfully commandeered from the US Navy website, original site is at http://www.navy.mil/navydata/questions/bells.html)

So that's how I've spent a bit of New Year's Day. Let me know how it works for you, or if you have questions, or you spot a glaring bug. Ciao.

Fixing Fedora

Well I finally figured out how to fix the X.org issue with running Fedora 23 under VirtualBox, where you can't install the vbox driver for video. This limits the VM to a max of 1024x768. The fix is to downgrade the x.org drivers to F22's version.

sudo dnf --showduplicates --allowerasing --releasever=22 downgrade xorg-x11-server-Xorg

This will roll the packages back. Note, after you do this, dnf/yum upgrade will reinstall the F23 packages. To prevent this, edit /etc/dnf/dnf.conf and add the following line at the end\

exclude=xorg-x11-*

Then reinstall the VirtualBox drivers as usual, and you should get your normal options for screen size back. Eventually there will be an update for VirtualBox to fix this, but until then we've got this.

Gettting into Git

If you're new to the using of Git, I highly recommend Git Immersion. It's about 50 pages going though the basics of Git. I've been using git to get files for years, but never got into the minutia of things, since I never had changes to push back to the repository (end user, not developer). But since every job posting I've seen in the last 6 months has Git, or something similar in practice. as part of the desired skillset, I decided I needed to learn to do more than 'git pull'. So if you want to grok git, this is the place to do it.