Recycled Electrons

Web development and other goodness by Ryan Heldt

Author: rheldt

Do Not Move Piano

IMG_20150726_114955This is a Wurlitzer upright piano that has long called the Dakins Community Center in Zearing home. It has long fascinated me for a couple reasons. First, its age and condition suggest that it rolled around the battlefields of Verdun for several months in 1916 France. Second, it used to have three individually laminated signs across the top, each saying “Do Not Move Piano”. Whether or not one was actually permitted to play the piano remains unknown.

It had been a while since I last visited “Wurly” (well over a year), but a few weekends back, I noticed her laminated signs are now gone. Only the faint reside of cellophane tape remains. As you know, laminated signs exude authority equal only to that of a Presidential Executive Order. So, the fact that all three of the signs are now gone and the piano had been moved from the east wall to the south wall, suggests a shadowy element at work. Granted, it may have just been an overzealous cleaning crew, but seriously, who moves a piano – even to vacuum?

IMG_20150726_115005Silliness partially aside, I would like to lean more about the origins of the piano. Did a prominent Zearingite give it to the Dakins Center? Was it something that just showed up one day, like a Pottery Barn catalog? Maybe, the piano was part of whatever building was there previously, and they build the Dakins Center around it. Finally, why does the Dakins Center have a piano? In fact, why to they have two pianos? There’s also a Clavinova-looking thing up there, which oddly has more dust than our friend from the Western Front.

I don’t know enough about pianos to know if Wurly is considered to be a Cadillac or something more akin to the pianos people always want to give away on Craigslist “to a good home.” Whatever the case may be, I have a feeling I know why the piano wasn’t supposed to be moved: safety. There’s something like 7 tons of potential energy inside a piano. That thing is literally a bomb-on-wheels, waiting for the moment when it can implode on itself in a glorious symphony flats and minors.

Even so, I can’t help but feel somewhat sorry for her. Instruments are meant to be played, not collect dust. Even if it is just a weaponized box of wood and cast iron.

Zearing powers Google datacenters

wind

This story was from a while back, but always intended to share it. Back in 2010, Google struck a 20-year deal to buy a bunch of green power from a wind farm in Iowa.

We.. completed a substantial 20-year green Power Purchase Agreement that allows us to take responsibility for our footprint and foster true growth in the renewable energy sector. On July 30 we will begin purchasing the clean energy from 114 megawatts of wind generation at the NextEra Energy Resources Story County II facility in Iowa.
Source: Google

The reason I mention this is because the majority of these turbines are located around my very small hometown of Zearing, Iowa. It’s pretty cool, although even after several years it’s somewhat paradoxical to see these high-tech windmills rising from the corn and bean fields I grew up around.

Find within stored procedures

Earlier this week, I needed to identify all the stored procedures in my database which contained a particular string (in this case, a table name) so I could make a few updates. Luckily, since the database was on SQL Server, I just needed to query a couple of the system tables. For example:

 

Automatically backing up an OpenMediaVault server to Amazon S3

I’ve been working on setting up a file server for our church. One of the things I wanted to do with this server is use it as a place to backup our in-house workstations. We hadn’t been doing anything in the way of automated backups, so it was well-past time.

I found an oldish Dell Inspiron gathering dust. It had an AMD Athlon and 2GB of RAM; also conjured up two SATA drives for storage: 1 1TB and a 500MB. Only needed to shell out $15 for a SATA DVD drive since the one that had been in that machine was apparently being used elsewhere.

After playing with several of the open source NAS servers, I finally settled on OpenMediaVault. It’s based in Debian, so you have all goodness of Linux along with the APT package manager which makes installing stuff dead simple. Case in point, s3tools — a slick command line interface for working with S3 buckets.

I’m going to assume that you’re already up and running with OpenMediaVault and you’ve enabled the SSH service. If not, check out their documentation for instructions on how to get started. You’ll also need to generate an access key and secret key along with an S3 bucket using the Amazon Management Console.

There’s a great article on kura.io that details how to install and configure s3tools. In short, you’ll need to SSH into your OpenMediaVault box and run a few commands.

Once you’ve run those, s3tools will be installed and you can configure it to use your Amazon S3 account. This is where you’ll need to use your access and secret keys. I’d highly recommend you read the kura.io article above under ‘Configuration’ for details on doing this.

Once s3tools is installed, we need to figure out the location of the file system that’s being managed by OpenMediaVault. From an SSH terminal, run the blkid command. For example:

Knowing the name of your file system  (in OpenMediaVault under Storage | File Systems), make a note of it’s UUID. For example, my file system is named “Main”. That will be the location under Linux where all your files are stored.

Now, go into the OpenMediaVault web admin and pull up Scheduled Jobs under the System sidebar menu. This will allow us to set up an automated job to run at regular intervals. In this case, we’re going to tell s3tools to back up our OpenMediaVault media directory once per day.

omv_job

Click add. The dialog that appears is a little confusing, but if you want to back up everything once per day, enter minutes and hours to your liking and leave the other date fields at *. In the example above, the job will run every day at 2:00 am. A good time since everyone will be sleeping. Under user select root and in comments put something like “Backup to Amazon S3”. If you have a mail server setup in OpenMediaVault you can also have it send you a message each time the job is run. Nice to have, but not necessarily required.

Finally, in the field next to Command, enter:

If you’re like me and can’t wait until 2:00 am comes around to see if this all works, you can click on the job from the job list and click Run.

Friendly Filesize Formatting

Most ColdFusion functions, like cfdirectory, return file size information in bytes. While that is probably a more technically accurate number, it usually doesn’t mean a whole heck of a lot to end users, who are probably more used to “denominations” such as the kilo or megabyte. I remedy this, I whipped up the following helper function.

Basic usage: fileSizeFormat(size)

If you need to show file sizes larger that GB, you could easily add 1024^4 and 1024^5 to the above if statement. Either that or seriously start looking into compression.

© 2018 Recycled Electrons

Theme by Anders NorenUp ↑