this post was submitted on 01 Oct 2025
581 points (99.3% liked)

Programmer Humor

26650 readers
2352 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] gmtom@lemmy.world 4 points 2 hours ago

Oh man, you guys should see what I was cooking up at my old place.

Head office too shitty to give us an actual asset management solution, but we did have full access to the Microsoft suite, so i used a SharePoint lists as databases, powerapps apps running on iPads for all the data entry ux and then like two dozen hacked together power automate flows linking them all together as well as taking any Info out of the actual IT systems head office used and since we didn't have API access to those system any data feeding back in to them would be in the form of automated emails that the poor 1st line techs in head office would have to sort through and process manually.

Nah bro, that bash alias is FULLY documented in .bashrc! Idiot.

[–] rumba@lemmy.zip 38 points 10 hours ago

I don't see the alias in your .bashrc

yeah, um, about that. I have no idea where it comes from. We can type alias and see what it is, so if it's ever lost, we can recreate it, but I looked for 30 minutes yesterday even did a grep -R and I have NO IDEA where it comes from, or why it's named electricboogaloo

[–] dotslashme@infosec.pub 26 points 10 hours ago (3 children)

My current project has a crontab with 216 entries.

[–] pinball_wizard@lemmy.zip 28 points 10 hours ago (3 children)

Well, here's a sentence I haven't been tempted to use before:

"I believe that may be too many crontab entries."

[–] DickFiasco@sh.itjust.works 15 points 10 hours ago (1 children)

Any problem in server administration can be solved with an additional crontab entry. Except for the problem of too many crontab entries.

[–] Opisek@piefed.blahaj.zone 7 points 6 hours ago* (last edited 6 hours ago)

And that's why I added a crontab entry that periodically purges my cron configuration. That way, I'm forced to readd only the truly necessary cron jobs, successfully reducing the amount of crontab entries.

[–] cupcakezealot@piefed.blahaj.zone 9 points 9 hours ago (1 children)

just randomly delete 50 of them.

[–] pinball_wizard@lemmy.zip 15 points 8 hours ago (1 children)

Yes. The strongest crontab entries will probably restore themselves. (For anyone reading along, this is sarcasm. Don't do this.)

[–] farngis_mcgiles@sh.itjust.works 4 points 2 hours ago

a crontab can regenerate from bisection to form two whole crontabs

[–] rumba@lemmy.zip 2 points 10 hours ago (1 children)

pshaw, just drop in there and combine a few

/etc/cron.d/first25 /etc/cron.d/second25 ...

[–] j_z@feddit.nu 1 points 2 hours ago

This is the way. Exactly what we did + migrated 80% of everything to k8s cronjobs and Argo workflows

[–] marcos@lemmy.world 4 points 8 hours ago (2 children)

At some point it may be good to migrate to airflow or something similar.

It's not the number of entries that makes it bad. It's the fact that if you run crontab, they are gone...

[–] bleistift2@sopuli.xyz 6 points 5 hours ago* (last edited 5 hours ago) (1 children)

At first I thought you missed the -r. Then I checked. Defaulting to STDIN here is very, very dumb, IMHO. Almost as bad as putting the “edit” flag right next to the “delete everything without confirmation” flag on a Western keyboard (-e vs -r).

[–] marcos@lemmy.world 4 points 5 hours ago

Crontab is a really badly designed program that we just can't fix because everybody depends on its WFTs for something.

[–] dondelelcaro@lemmy.world 7 points 8 hours ago (1 children)

That's why there's a crontab rule to load the crontab from a file. Cronception if you will.

[–] marcos@lemmy.world 6 points 7 hours ago (1 children)

Make the rule start a secondary cron system. Otherwise it won't run after you erase the crontab.

[–] dondelelcaro@lemmy.world 6 points 6 hours ago* (last edited 6 hours ago)

Here you go:

with-lock-ex -q /path/to/lockfile sh -c '
while true; do
    crontab cronfile;
    sleep 60;
done;'
[–] Lightfire228@pawb.social 6 points 9 hours ago

Use SystemD timers, you animal

[–] cupcakezealot@piefed.blahaj.zone 51 points 13 hours ago

the final part of that is "written by person that left the company ten years ago"

[–] Adderbox76@lemmy.ca 8 points 9 hours ago (2 children)

I'll hear NO aspersions against my precious Cron!

Cron is magic. Cron is civilization!

[–] 0x0@lemmy.zip 1 points 2 hours ago

This might come in handy.

[–] phutatorius@lemmy.zip 4 points 8 hours ago

Naw, mate, that's Crom.

[–] r00ty@kbin.life 87 points 15 hours ago (2 children)

I have a tool that I wrote, probably 5+ years ago. Runs once a week, collects data from a public API, translates it into files usable by the asterisk phone server.

I totally forgot about it. Checked. Yep, up to date files created, all seem in the right format.

Sometimes things just keep working.

[–] RustyNova@lemmy.world 49 points 14 hours ago (4 children)

Meanwhile, had to debug a script that zipped a zip recursively, with the new data appended. The server had barely enough storage left, as the zip took almost 200GB (the data is only 3GB). I looked at the logs, last successful run: 2019

[–] r00ty@kbin.life 17 points 14 hours ago (1 children)

Yes, had the same happen. Something that should be simple failing for stupid reasons.

[–] RustyNova@lemmy.world 11 points 12 hours ago (2 children)

Well it's not that simple... Because whoever wrote that made it way too complicated (and the production version has been tweaked without updating the dev too)

A clean rewrite with some guard clauses helped remove the haduken ifs and actually zipping the file outside of the zipped directory helped a lot

[–] r00ty@kbin.life 6 points 11 hours ago

I mean, I have to say I've hastened my own demise (in program terms) by over-engineering something that should be simple. Sometimes adding protective guardrails actually causes errors when something changes.

[–] Quantenteilchen@discuss.tchncs.de 2 points 10 hours ago (1 children)

Am I understanding that last part correctly?

[...] and actually zipping the file outside of the zipped directory helped a lot

Did they just automatically create a backup zip-bomb in their script‽

[–] RustyNova@lemmy.world 8 points 9 hours ago

I oversimplified it but the actual process was to zip files to send to an FTP server

The cron zipped the files to send in the same directory as the zipped files, then sent the zip, then deleted the zip

Looks fine, right? But what if the FTP server is slow and uploading take more time than the hourly cron dispatch? You now have a second script that zip all the folder, with the previous zip file, which will slow down the upload, etc...

I believe may have been started by an FTP upload erroring out and forcing an early return without having a cleanup, and progressively got worse

... I suppose this happened. The logs were actually broken and didn't actually add the message part of the error object, and only logging the memory address to it

load more comments (3 replies)
[–] Gonzako@lemmy.world 19 points 15 hours ago (2 children)

Yeah, all these simple data processing scripts will always work as long as both sides stay the same/compatible

[–] r00ty@kbin.life 20 points 14 hours ago

Yep. It seems they haven't changed a thing about the format. Probably a script much older than mine on their end is generating it too.

[–] MonkderVierte@lemmy.zip 8 points 14 hours ago (1 children)

Isn't that true for all of data processing?

[–] Gonzako@lemmy.world 7 points 14 hours ago

Maybe. But webdevs have made it a mission not to seem like so

[–] desmosthenes@lemmy.world 5 points 10 hours ago

I feel attacked

[–] Gonzako@lemmy.world 34 points 15 hours ago (1 children)
[–] cenzorrll@lemmy.ca 13 points 11 hours ago* (last edited 11 hours ago)

Ha, loser.

*glances over at 6 bash scripts and 2 cron jobs*

Not you, you're perfect

[–] barnaclebutt@lemmy.world 11 points 13 hours ago

I know there's a meme here, but as a Canadian, I'm sorry about that traitorous asshat.

[–] ag10n@lemmy.world 27 points 15 hours ago

Suck my dick O’Leary

[–] A_norny_mousse@feddit.org 15 points 14 hours ago

A self-written shell script "daemon" that tails & greps log output for "ERR|FAIL"

[–] MonkderVierte@lemmy.zip 10 points 14 hours ago* (last edited 14 hours ago) (4 children)

How can a shell alias be undocumented? Type alias, there is the oneliner that can't be too complicated due to lack of variables.

[–] marcos@lemmy.world 3 points 8 hours ago

Nobody write down that if you run the stuff in a different machine, you have to create the alias first.

And once you lose the machine and are trying to restore your backups, you can't run alias and discover what doThingy actually does.

[–] cupcakezealot@piefed.blahaj.zone 9 points 13 hours ago* (last edited 13 hours ago) (1 children)

alias thisdoessomething='cd /home/linuxuser/ && ./myscript.sh'

[–] elvith@feddit.org 10 points 9 hours ago (1 children)

alias cd='echo "command not found"'

[–] jaybone@lemmy.zip 6 points 13 hours ago

If you try hard enough

load more comments (1 replies)
load more comments
view more: next ›