Friday, August 6, 2021

Composting

Introduction

This post is the basis of my forth submission to Hacker Public Radio (http://www.hackerpublicradio.org). If you'd like to listen to the melodic sound of my voice please visit: http://hackerpublicradio.org/eps.php?id=3408. It is inspired by HPR episode 3157 entitled Composting by Klaatu. During the early 2000's, I lived in a single family home which had a number of oak tree's around it. Between the trees, other foliage, and grass, there was a large amount of yard waste. While my city (Baltimore, MD in the US) will pick up your yard waste if you put it in bags by the curb [1], I would use the oak leaves as mulch, and did have a mulch pile of leaves and other yard waste. At that time, I thought about composting food waste, but there is a big issue with rats in Baltimore, and I didn't look into ways to compost. I just knew I couldn't randomly mix it into my mulch pile. I am currently living in a different house, without any oak trees, and not as much yard waste (particularly since we hire someone to mow the grass every couple weeks). After listening to the Composting episode I was inspired to look into the best way to do it given my current living situation. The first thing I did was to look and see if there are any laws against composting in Baltimore City. The rat problem is big enough that the City purchased and distributed a large green plastic trash bin to every physical mailing address in the city. This is the bin you are required to use when putting out your trash. Given the situation, I wasn't sure it would be legal to do composting in your back yard. Much to my surprise, it is not only legal, but the city website has a web page on how to compost [2] and just recently started a pilot program for food scrap drop off with seven locations around the city [3].

Kitchen Compost Bin

After determining I wasn't going to be a scofflaw, I went to the Internet to see what kind of bins are available for purchase. While Klaatu gives great suggestions for low cost composting bins, I wanted something that would look nice sitting out on a shelf for the small inside bin. I found the Utopia Kitchen Compost Bin [4]. The bin is made of stainless steel and has a volume of 1.3 gallons (4.9 liters). The lid is rounded and has a series of holes around the top. The inside of the lid holds a circular shaped charcoal filter. The combination of holes and charcoal filter capture any odors generated by the food scraps. It works amazingly well and even with onion scraps you need to stick your nose to the holes and inhale deep to smell anything when the lid is closed. It holds three to seven days worth of food scraps, most of which end up being coffee grinds. We have had this bin for 10 months, and the charcoal filter is still effective. There are replacement filters available for this bin, but you could also cut other charcoal filters to fit inside the lid.

Outside Compost Bin

Given the potential rat and other small critter issues, I wanted the main, outside composter to be fully enclosed, and preferably not sitting directly on the ground. A quick search brings up a number of options, both composters that sit on the ground and ones that are tumbler style, which hang on a frame. I went with a tumbler style compost bin. This provided the desired feature of not being on the ground, and has the added advantage of making it easy to turn the compost every second or third day by just rotating the bin slowly for three or four full turns. I purchased the FCMP Outdoor IM4000 Tumbling Composter [5]. The composter is octagonal shaped column with two chambers inside it. This allows you to fill one chamber while the other side is finishing the composting process. There are also aeration holes for each chamber which can be open to different levels to moderate the amount of moisture. The combined volume of the two chambers is approximately 37 gallons (140 liters).

My Composting Experience

So far I have been very happy with this combination. I just emptied a chamber for the third time. I do have a bit of an issue with the compost being overly damp. I have mixed some drier yard waste in from time to time and that does help, but have had times when parts of it get a little slimy. I have also run into issues with flies and other bugs living in the chamber for a while, but generally I don't see them outside of the composter, just when I open the door to add more material. Not ideal, but not so bad that I did anything about it. I have also found certain things do take extra time to compost, and usually need some manual help to break down. Pits of mangoes and avocados in particular along with corn cobs take a long time to break down. They do start to compost, and are easy to crumble in your hands, but keep their basic shape for a long while. Egg shells don't really break down, as Klaatu mentioned, but they do become very brittle and I crumble them up manually along with the pits and corn cobs. Another issue I have found with damper compost, particularly in cooler months, it doesn't heat up enough to decompose the seeds of some plants. This ended up being a pleasant surprise this summer after mixing in the first batch of compost in our little herb garden during the spring. We now have a combination of plumb and medium sized tomato plants and some kind of squash plant growing in it. If you don't want random plants growing in your yard or flower beds, do be careful when composting plants with seeds [6].

Conclusion

While it takes a little extra effort, composting does reduce the amount of garbage you are sending to the dump, and does reduce the smell of your kitchen trash bin. It also gives a rewarding feeling as you watch the material break down into a rich dirt, and then mix it into your garden or yard. I recommend giving it a try, and posting your experience as another episode of Hacker Public Radio.

References

  1. Baltimore City Department of Public Works-Yard Waste
  2. Baltimore City Department of Public Works-Source Reduction
  3. Baltimore City Department of Public Works-Food Scrap Drop-Off Pilot Program
  4. Utopia Kitchen Compost Bin
  5. FCMP Outdoor IM4000 Tumbling Composter
  6. Composting Tomato Plants: When To Compost Tomatoes

Sunday, March 14, 2021

Spam Bot Honey Pot

This post is the basis of my third submission to Hacker Public Radio (http://www.hackerpublicradio.org). If you'd like to listen to the melodic sound of my voice please visit: http://hackerpublicradio.org/eps.php?id=3296

In this post, I will describe the method I chose to combat spam bots filling out my company's contact form. About 99% of the submissions we receive are spam, which makes filtering for valid messages painful. After some research into different methods, I decided to go with the honey pot method.

The honey pot method uses an extra text input field to lure the spam bot into filling it out. There are different suggestions for how to hide this extra field from valid users by using either javascript or CSS. With javascript, the honey pot section of the form is removed from the DOM when the page loads, hiding it from your users. The argument for this method is most bots don't implement javascript, so the honey pot field will not be hidden from them. I think that is a valid argument but I didn't want to include extra javascript in my page--so I went with the CSS method.

There are references at the end of the post to a couple of the articles I read on implementing the honey pot with either javascript or CSS. My take away was, one, don't use the CSS display property set to the value of none to take the input out of the DOM. Sufficiently smart enough bots may know to scan for this, especially if applied directly to the element. Also don't name your classes something obvious to your intent like "anti-spam-filter". My guess is the majority of the bots out there aren't that sophisticated, but I figured it couldn't hurt to follow those suggestions.

I was already using Bootsrap CSS for our site, so I decided to use Bootstrap's "sr-only" class. This class is used for elements that you only want visible to screen readers. It takes the element and uses a combination of absolute positioning, setting the size and width to 1 pixel, setting a negative left margin, and hiding content overflow to prevent the honey pot showing up visually. I figured if the bot was scanning CSS for classes or properties, this wouldn't trigger any warnings. It does bring up the issue of how to prevent impacting the experience of people using screen readers. I applied the aria-hidden attribute with a value of true to the label element surrounding the honey pot input field. "[this] removes that element and all of its children from the accessibility tree." So we now have the field hidden both visually in the browser and from assistive technolgies. Given the short end of the stick accesibility usually gets, I doubt there are any spam bots scanning for that ARIA attribute. For the minority of users who might be viewing with the classic lynx browser, I put 'For office use' as the label text before the honey pot, hoping this would get the message across without tipping off the bot to the intended purpose of the related input field.

The other main issue with this method is the value of the name attribute used for the input field. Some argue to use obfuscated values like "mmxxName" instead of "name", or "sxysPhone" for "phone". Apparently some bots will skip fields they don't recognize. By using more standard names for multiple honey pot fields, it easier to determine if it is a bot. The counter arguement to this naming scheme is about the user experience, by obfuscating the name, then browser's won't auto-fill the valid fields of the form. This also brings up the matter of not auto-filling the spam fields by the browser of your users. This is done by setting any of your honey pot input elements' "autocomplete" attributes to "off".

So far this spam filtering method is working nicely. I currently send any messages flagged as spam to a different email address with the subject prepended with the words "[Spam review]". Once I am confident there are not that many false positives, I will just skip sending flagged messages. The one issue I have experienced with this method is when using the tab key to move through the form. Since the input field is only visually hidden, it still receives focus as you tab through. If you happen to hit another key while still in the hidden field, it will get captured by the honey pot and then the submission will be flagged as spam.

I have created a sample form on my personal site. Please visit URL: http://www.horning.us/hpr/SpamBotHoneyPot.php to try it out. It is a simple PHP page using the GET method when submitting the form. Once you press the submit button you will see the form fields and their values, along with the result messages. I chose to use "URL" as the name for my honey pot input field. I use it on my example form, and I use it for my work form. For my work form, a URL is not something we ask to be submitted, and being a common field in forms, makes it very tempting for bots. In my example code, the CSS for hiding the hony pot section is from the minicss.org website's. Their "visibility-hidden" class is very similar to Bootstrap's "sr-only" class. I would be interested to hear if other's have implemented something similar. I would also love to hear from someone who uses a screen reader. Does it prevent the honey pot section from being read?

References