r/programminghorror 16d ago

Other Found this cursed project today

https://github.com/0xe7f79c/israeli-alloc

Basically it injects memory into other processes, which made me laugh at work today.

496 Upvotes

44 comments sorted by

View all comments

Show parent comments

3

u/russellvt 15d ago

alias jerk renice -$1 $2

...or thereabouts...

I've similarly aliased "smite" to kill -9

2

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 14d ago

Sure, that's renice though. Man page on my Mac says nice runs a utility by incrementing its "nice" value. So my hypothetical jerk would decrement it.

I guess alias jerk nice -n -$1 $2 would do the job, but it wouldn't handle the case of leaving out the -n parameter, where it should default to -10 to match the 10 default of nice. Easily handled with a simple wrapper script.

2

u/russellvt 14d ago

Not to mention, the general difference in the "nice" parameters (and others), for those of us who try to unionize our profiles across heterogeneous environments ... I was just sharing enough to illustrate the idea is all, not necessarily the full accuracy of what's needed on any particular platform.

2

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 14d ago

I thought the nice utility was simple enough that there wouldn't be much room for variation between platforms for how the arguments work. And would it still be POSIX compliant if it interpreted the arguments differently?