Ask HN: How did you automate your day job?
My first job was doing restock for a small independent retailer. The only report we could print showing inventory was inclusive of all the items we had ever carried, regardless of current status. The software was very limited and there was not much in the way of filtering. The best you could do was break the report up into ranges by vendor.<p>So my job was to go through the alphabet printing reports (e.g. &quot;every item from a vendor that starts with &#x27;A&#x27;&quot;). I&#x27;d take this report, which for some letters was over a hundred pages long (about 20 items per page) then, using a highlighter and a ballpoint pen I&#x27;d go through the report highlighting the items that had stock available in the &quot;backstock&quot; column and had stock in the &quot;sales floor&quot; column that was lesser than the &quot;restock level&quot;. I also had to compute the restock amount by subtracting the items on the floor from the restock level and taking the max of that number or the available backstock. I&#x27;d write this number in the margin of the report, then I&#x27;d travel to the backstock area, pick the highlighted items, and restock them onto the sales floor. After this was done I&#x27;d move on to the next letter. The goal was to cycle through the alphabet at least once a week and during the off-peak season this worked fine, but during the busy season, even with extra help, this system was showing signs of stress.<p>The first thing I did was to write a small perl script which I placed at the path the POS software was expecting to find a line printer. My script took the print-formatted report as input and simply stripped out the lines with no available backstock before forwarding the remaining lines to the printer. This alone reduced the number of pages printed out by an order of magnitude in most cases (from ~100 pages to ~10). At first I would copy this script to the printer path, run the report, then re-link the printer, but later I modified the script to recognize that specific report and pass-through other print jobs unmolested.<p>Over the next three years or so I added onto the script a lot. First I made it compute the restock amount for me, then I had it start skipping lines where the restock was trivial (e.g. restock amount was 1 and there were still &gt;10 on the floor). Eventually the script was maintaining its own parallel inventory database, tracking rate of sale for each item and only suggesting restock for things that had very low inventory on the floor or were selling very quickly. I got to the point where I could restock the entire alphabet every morning and have time leftover in the afternoons to help with receiving. By the time I left I had a dedicated terminal set up in the back during the busy season that ran my scripts every 10 minutes and displayed in near real-time items that required critical restock throughout the day.<p>I heard a few years after I left they had switched back to the old methodology because they couldn&#x27;t get their POS vendor to support my setup.