How to replace yourself with a very small shell script


#1

Originally published at: http://boingboing.net/2017/06/30/next-level-regexp.html


#2

I know a guy who used to threaten vfx coordinators with that fate. Now they are all producers and he’s unemployed.


#3

Yet she has a gmail.com address, curious.


#4

Google released quite a while ago gmail command line tools. Just FYI.


#5

What? Who uses email anymore?


#6

So, would you?


#7

This is the life of a python programmer. Spend two years fixing things, and move on.


#8

She’s hiding her Romanian accent, but you can tell that she’s really a vampire.


#9

So is she or isn’t she at their mercy?


#10

Curl can handle IMAP and Gmail uses IMAP so it is perfectly possible to write tools that work with Gmail and not be stuck with Google.


#11

Gmail can be POPped.


#12

A little frustrating - the talk was in 2009, she said a few months later she’d stick the scripts on github ‘when they’re ready to share’ but other than a twitter-related script that seems to be the one she mentioned in this talk there’s no email scripts in her github repositories and googling finds nothing. Anyone else have any luck finding them?


#13

That’s a cool feat, but I wonder if their program can really account for all edge cases. They stated that it took someone months to do everything by hand, and it took their program a few minutes. I have a hard time believing it was only processing speed.

I suppose it’s possible that everything was covered with their program, but I feel like there must have been a reason they didn’t automate it in the first place. If they never thought of automating things, this person should pitch it to the company and get a more fulfilling task!


#14

Lack of interest. The job gets done, it’s covered in the budget and the current way doesn’t offer any surprises.

And it’s often in the interest of the previous job holder not to automate, because then he’d or she’d be out of a job. The newcomer is usually not that invested in keeping the status quo.

I’ve seen the strangest things, like not automating testing because investing 1 or 2 person-months in a block feels more expensive to management than 4 to 6 person-months each year, distributed over a group of developers.

“Your sawing takes very long - perhaps you should sharpen your saws.”
“We don’t have time for that, we are behind schedule.”


#15

Probably not ready to share. I’m doing similar things myself.

  • Adding another layer of spam-catching.
  • Auto-Reply when people write to an address I know they didn’t want to. (I have catch-all, they want to write to a business on another, similar domain.)
  • Moving certain e-mails from the INBOX to other folders or tagging them with keywords.
  • Extracting the wav files from my answering machine and pdf files from the fax, upload them and make them clickable in push messages.
  • Only send notifications for a select number or mails. Don’t want notifications for everything, even if it stays in INBOX.
  • Extract data from iTunes Purchases mail and preprocess them, so that I can import them into my finance software.
  • Process CSV-files I get from my thermometers by mail, putting them into a sqlite database.
  • … and a couple more, I guess.

They work very well, they run stable, they do not stress my raspberry pi, but they are a mess. I could make “nice” code out of it, sure, but that would take more time than I have and much more than would be willing to “donate”.


#16

Lol that’s true. I guess once you throw corporate beauracracy into the mix as well it sets things in stone, regardless of how backwards things are.

I hope the person in that article is able to move on and use their skills for something more fulfilling. If they are able to automate something like that and not have any errors pop up they are definitely a capable individual.

I lost the article, but a few years ago I read about a guy who automated their whole job and spent two years playing games in his office. Eventually people caught on and he was out of work. He said he ended up forgetting how to program after doing nothing for two years. It’s a good lesson. No matter how comfortable your current condition is, you need to be ready in case things go south.


#17

That’s a decent reason right there to post your code publicly. Because some people will be willing to make them pretty for you, as long as the code is useful enough to be worth someone else’s time… I know that I usually rewrite other people’s scripts while I am analyzing them for traps, just to make it easier for me to understand as I go along.


#18

But I don’t need anyone to make the code prettier for me. The code works for me. And it relies on dozens of assumptions that are only true for my environment, so basically everything is hardcoded. I rent my own dedicated IMAP server, I have my own web space with its sftp account, I can always make sure that my home directory is accessible under the same fixed string, so I don’t even have to bother with $HOME.

I do deliver stable, documented, extensible and prettily formatted code for my employer. And before that to my customers. But this is my totally chaotic work-shed - the only thing I make sure of is that I commit the stuff to the respective git repository so that I don’t weep in case my pi ever dies on me.


#19

Of course, most of the problems you describe can be resolved with a very small shell script ;).

find /home/peter/scripts -type f -exec sed -i ‘s#/home/peter#$HOME#g’ {} ;

But I do get your point!

Another prospective problem is the possibility of revealing a hole or backdoor that you don’t know about, or forgot about, and having some idiot griefer take advantage of that to repay your generosity with pain…


#20

A few things she mentions are in Gmail now, like “mark as important”. Others, like the suggested replies, are in Inbox (I’ve tried it a few times only, it was very strange)