r/ProgrammerHumor • • Oct 14 '26 • Popcorn 1

Meme typaShiClaudeGivesYouForASimpleMonitoring

Post image
2.4k Upvotes

127 comments sorted by

240

u/ThaBroccoliDood Oct 14 '26

love putting words in the terminal
sort -rn
rm -fr
journalctl -ball

69

u/rosuav Oct 14 '26

When your systemd service is messed up, you say "journalctl -fu servicename". I am sure the devs were fully aware of what they were doing with this, same as LPL was when he made the Folding Utility ("FU") pick.

24

u/deralexl Oct 14 '26

ls -lisa

16

u/acceleratedpenguin Oct 14 '26

ss -tunapls

(I think I heard about this one from Julia Evans weekly email)

5

u/Bemascu Oct 15 '26

In Spanish there's "ss -putona", which translated would be "ss -slut". It's a good mnemonic.

34

u/mrheosuper Oct 14 '26

"LGTM" go ahead

6

u/naruto_bist Oct 14 '26

"Always allow" and prompt stating don't make any mistakes

27

u/0xKaishakunin Oct 14 '26

Damn, we need a Practical Extraction and Report Language at this point

8

u/ascii158 Oct 14 '26

Awesome idea! I propose we name it after a British 70s sketch show!

346

u/djbarsone Oct 14 '26 • Popcorn

Just rename this sub AIcirclejerk already

189

u/Cutalana Oct 14 '26

might as well rename the entire field that too

62

u/Kooshi_Govno Oct 14 '26

this but unironically

8

u/einzweidreihorn Oct 14 '26

Might aswell get a pay increase out of it. I'm an AI engineer now, software engineering is for dinosaurs.

16

u/dbagames Oct 14 '26

Circle jerk "engineering"

0

u/pagraphdrux Oct 15 '26

Is this not criticism of a.i. or do ya'll think this is genuinely a good way to monitor something?

23

u/ZunoJ Oct 14 '26

Looks more or less fine to me

13

u/Jimmyfartballs Oct 14 '26

no it's not less it's head

1

u/adamantium4084 Oct 14 '26

Yea, less >= more and isLessOrMore() != head You could '<command> | head | less' If you wanted..

4

u/ziroux Oct 14 '26

Could maybe refactor into a proper script, but depends on the need and environment. Otherwise it's just usual cli stuff, no magic

14

u/BastetFurry Oct 14 '26

So Claude is your average Linux Neckbeard that loves to pipe?

9

u/virgin4ever69 Oct 14 '26

I, too, love to pipe. Alas! Meth.

12

u/Spare-Subject-796 Oct 14 '26

just did the same a couple of minutes ago for my influxDB exited when it should not have

32

u/NomaTyx Oct 14 '26

happy for you or sorry that happened

37

u/-Redstoneboi- Oct 14 '26 edited Oct 14 '26

"damn bro i'll let you use python at this point"

all these linux cli tools are so stringy, would definitely much rather have standardized apis for them

23

u/rosuav Oct 14 '26

That's fundamental to shell scripting. It's always very stringy. There are a few shell languages that took the leap to become applications programming languages (I spent a lot of my time in the 1990s writing REXX code, for example), and they will always be that bit different from "classic" programming languages.

1

u/-Redstoneboi- Oct 14 '26 edited Oct 14 '26

i'm really just saying i dont like strings in general

my favorite language is rust so i can and will strongly type everything by pure instinct rather than by logic even when scripting languages are objectively more convenient for these tasks

i like micro optimizations and overvalue it a lot more than developer time so i generally dont like the very idea of multiple regex passes and string operations/allocations even if in practice it takes a few milliseconds to run (if even that) every hour

5

u/rosuav Oct 14 '26

That's fair! It's often the wrong tradeoff to make, but I definitely understand the mindset. Personally, I tend to prefer languages with richer data types (lacking support for first-class arrays can seriously hamper a language), but there are a lot of conveniences to the simplicity of shell languages.

1

u/-Redstoneboi- Oct 14 '26

i also have some uh, opinions regarding regex and vim's default keybinds

so many things that "work and work well but aren't perfect for my specific definition of perfect"

i feel like the new kid walking into the scene going like "damn y'all live like this?" and being basically the only one in the room to (outwardly) think this way while everybody is busy doing their actual job

i'll probably look around for "regex with macros" and other text editors like kakoune and emacs before i make another competing standard

2

u/rosuav Oct 14 '26

Oh look, everyone has opinions about regex. Most of them have at least some merit. The minilanguage is so extremely compact and then has to get extended in so many directions. Ugh. Don't worry, you are not the only one to think that way.

TBH I wouldn't reach for a regex for most parsing, unless it's the only real option available in the context I'm working in. Whenever I can, I prefer sscanf parsing instead. The main reason is to avoid backtracking (yes, occasionally that means sscanf is a poor choice, but OTOH you never have the catastrophic performance that a regex can suffer from), but also I prefer the syntax.

16

u/Banes_Addiction Oct 14 '26

The fun thing about the "stringy"ness is it's really quick and simple. You can just build up a pipeline in real time looking at the output of each thing, and not really worry about anything (or even really look anything up).

No API, just a very simple set of operations with easily human readable output every step of the way.

If you look at that, journalctl is the only tool that does something specific/uncommon. Everything else is the equivalent of a standard library function.

This is what I'd consider an "aeroplane skill", ie easily doable without an internet connection.

0

u/-Redstoneboi- Oct 14 '26

from my perspective, this is just a repl but with only one type

correct me if i'm wrong but isn't that basically what bash is

it's awesome that they figured out this kind of workflow from a long long time ago, but things are absolutely not optimal the way they are now. they are simply the most backwards compatible, universal, and thus generally least headache-prone ways of doing things.

1

u/Banes_Addiction Oct 14 '26

I mean, yeah? A terminal is a REPL loop.

The thing about a shell is that it's designed to be something different than a "real" programming languange, right? It's a way to interact with the OS, and all that stuff is front and centre. Strings and files are the natural "units".

Of course you can do all this stuff in a Python interpreter if you want, it just takes way more typing.

A shell one line is a neat little "here's a thing that needs doing, it needs a few simple steps, just get them out the way". I guess the python equivalent would be a list comprehension.

1

u/-Redstoneboi- Oct 14 '26 edited Oct 14 '26

i guess the difference is that in python, the syntax is command, arg2, opt=val) while in bash it's command arg1 arg2 --opt val and you can pipe things.

very convenient, with the catch that you have only one type to work with. someone suggested i take a look at nushell and that's pretty much what i envisioned. just a language with real types, a repl, and convenient default parse/tostring implementations for every type.

user readability doesn't clobber the exact values of the data. you don't have to lose information or re-parse whatever the last program outputted, if it's compliant. the number "10,552 bytes" can show as "10kb" since both are just the same mumber displayed differently.

7

u/JangoDarkSaber Oct 14 '26

There are now 15 competing standards…

4

u/SirBanananana Oct 14 '26

all these linux cli tools are so stringy, would definitely much rather have standardized apis for them

Then you'll love nushell

2

u/-Redstoneboi- Oct 14 '26 edited Oct 14 '26

thank you

edit: damn thats hot

1

u/gregorydgraham Oct 15 '26

This is a humour subreddit, porn is not allowed.

Use r/ProgrammerPorn instead

2

u/Ok-Dimension-5429 Oct 14 '26

I mean you can go use PowerShell if you want. Commands return objects. It's a pain in the ass though. Strings work fine.

33

u/k_sway Oct 14 '26

Lately I’ve been telling it ā€œyour code needs to be easily read and understood by a human reviewer so always lean towards readability even if it means your solutions aren’t as elegantā€

I’ve been getting good results with that so far

8

u/somebodyinvisible Oct 14 '26

Somehow I understand of that evil spell.

9

u/770grappenmaker Oct 14 '26

Get the top 3 most common syslog identifiers, count errors for each?

13

u/snarkofagen Oct 14 '26

Beats having to write shit like that by hand like we had to do in the olden days.

14

u/gsaelzbaer Oct 14 '26

That’s not even a crazy command with basic UNIX/Linux knowledge.
I’d be more worried about you, if you vibe code stuff in a domain that requires this command, and don’t understand it.

4

u/Cobracrystal Oct 14 '26

tbf i think you can compress it? surely you can just get both results at the same time and censor data in the output instead of running two journalctl commands

9

u/gsaelzbaer Oct 14 '26

Not saying it’s not overly verbose šŸ˜„ LLMs usually don’t come up with the most compact solution. But that commandā€˜s intent is not _that_ hard to parse

13

u/coffeeicefox Oct 14 '26

Okay mate, everyone knows your a big bad coder, chill out.

Of course every command is simple, and if you take the time to read it you can make sense of it, It's the construction of the whole script in a nano second using tools you've not used for that project or in a while and it's moved onto the next task producing a similar output before you can even process what happened in the first one that causes the shock to your current mental model of what you're working on.

e.g, The agent is running a basic SQL command and parsing into another data structure to run sed with a mad regex on it rather than writing a decent SQL query which you would have done previously.

2

u/rosuav Oct 14 '26

journalctl -fu {}

2

u/fhayde Oct 14 '26

Claude code one liners always remind me of this Romanian Perl developer I worked with in the late 90s. At least Claude doesn’t curse me and respond with RTFM if I ask any questions.

3

u/ilnarildarovuch Oct 14 '26

systemD slop command

1

u/ilnarildarovuch Oct 14 '26

In both ways

3

u/Solomoncjy Oct 14 '26

atp just pull in python for the structed json parsing oml

1

u/GTMoraes Oct 14 '26

guy that made the tool: I didn't even know it could do that

1

u/explodedcheek Oct 14 '26

This is what I thought regex final boss would look like...but it's just code for monitoring logs lol.

1

u/Express-Acanthaceae9 Oct 14 '26

Claude finds interesting ways to reduce filling context with output from these kind of commands

1

u/ExtraWorldliness6916 Oct 14 '26

You lost me at pipe syslog identifier

1

u/exqueezemenow Oct 14 '26

I was in this same position with the same expression this week.

1

u/20220912 Oct 14 '26

I'm an SRE, and this is, like, a typical Tuesday morning, not anything exotic. It's not even 'code', it's just a series of log dumps and filtering. No conditionals or looping anywhere.

1

u/dminus Oct 14 '26

catgrepper bankai

1

u/chickey23 Oct 14 '26

I told you we should have put a no robots at the start of the crontab. Now they are stealing all of our pipes!

1

u/r0b074p0c4lyp53 Oct 14 '26

It's just reading the log, plus a bunch of formatting

1

u/cornmonger_ Oct 15 '26

/uj i highly recommend nu --mcp

/rj i highly recommend nu --mcp

1

u/glorious_reptile Oct 15 '26

| cryptominer —t 5s —silent | …

1

u/funkdefied Oct 15 '26

All my homies use ā€œsdā€

1

u/[deleted] Oct 15 '26

That moment you know something doesn't need to be so complicated

1

u/nazgulonbicycle Oct 14 '26

I’ve handwritten and stored type shi like this

1

u/burnttoast12321 Oct 14 '26 edited Oct 14 '26

It's using bash to it's peak. Love to see it. This is why AI has an advantage.

Not even kidding. The most productive I've ever felt was when using bash in Unix. Don't even get me started on how great it feels to write Regex without looking up the syntax! Wish I still could. Been a good 10 years since I've touched it.

People probably think I am kidding but AI using bash to configure systems to deploy to AI is a huge deal.

There have even been a few new Linux distros that have come out from this in the past few weeks.

We know AI is decent at coding. If it can configure systems or even bigger networks we are in for some big changes...

I wish DraftKings had a bet to say that system integration AI is the winner. Once integrated it has full control. (Not saying we can't it shut) but at this point it has system controls, coding abilities and can just keep improving.

More hardware tech may be required but this is all happening pretty fast.

1

u/BobThefuknBuilder Oct 15 '26

Didn't understand instruction, gave head 5 times no logs appeared.

0

u/[deleted] Oct 14 '26

[deleted] — view deleted comment

11

u/dcondor07uk Oct 14 '26

This is most likely just a quick one-liner for Claude to run when troubleshooting a system. It identifies which services are generating the most errors, normalizes variable values (like replacing hex values with <hex> and long IDs with <id>) so similar errors can be grouped together, then displays the five most common error patterns.

So regarding your point about ā€œselling more tokens,ā€ I’d actually argue the opposite. This is an extremely compact and efficient way to accomplish the task. Rather than having Claude break the process into multiple steps, inspect logs individually, or write a more elaborate Bash script following some arbitrary coding conventions, it can do most of the work in a single command.

All those extra steps would take more time and, more importantly, more tokens. If anything, this is an example of minimizing token usage, not inflating it.

0

u/E-M-C Oct 14 '26

I hate that I can recognize ChatGPT's style in this comment

4

u/dcondor07uk Oct 14 '26

You are absolutely right to push back on that. It was an oversight on my part and I apologise for the inconvenience.šŸ˜‚

1

u/E-M-C Oct 14 '26

I wasn't calling you a bot, just saying that, even if accurate, you comment was written by ChatGPT :p

1

u/dcondor07uk Oct 14 '26

I know, second language issues

I used gpt to make it clear and meant as a satirešŸ˜‚

4

u/Ok-Dimension-5429 Oct 14 '26

Claude is going to read the results of this command. It's better to have a complicated command which gives a short output than a simple command which gives a long output, if you want to reduce tokens.

0

u/rosuav Oct 14 '26

Precisely. It's best practice for them to sell more tokens by generating inflated code.

0

u/[deleted] Oct 14 '26

[deleted] — view deleted comment

594

u/Pristine-Pea6795 Oct 14 '26

The other day i got: for(;;) and i was like what the hell is that ? Claude said it does the same as while true, ok use while true then…

214

u/Mojert Oct 14 '26 • Bravo

IIRC using for(;;) produced better assembly in the first C compilers than while(true), so it became common because of this. Also, true wasn't a thing in C at the time so it would actually have been while(1), which also isn't super clear

72

u/vegataballs Oct 14 '26

Indeed.

But also worth noting that though "at the time" sounds (to me at least) like maybe 70's and 80's, it is anything before 1999, or really, the time when people got around to adopting the C99 standard (so mid 2000's?) where the boolean type _Bool was introduced to the language. But even then you had to include the stdbool.h header if you wanted to use bool, true, or false, which were really just convenience macros expanding to _Bool, 1, and 0. It wasn't until the year of our lord 2023 that they genuinely became part of the language.... which is pretty wild if you ask me

14

u/Mountain-Ox Oct 15 '26

That takes me back to JavaScript optimizations. You got better performance running over an array backwards than forwards. And a loop is much faster that for each. An index loop is faster than a 'for of' loop.

Then you sometimes need to allocate the variables outside the loop so they would be reused.

Usually this didn't matter but sometimes you gotta summon the arcane knowledge of the V8 engine.

44

u/iBac0n Oct 14 '26

for(ever)

8

u/atomic_redneck Oct 14 '26
#define ever 0

33

u/rusbon Oct 14 '26

Its common for c embedded world. Depending on compiler version, not even true/false existed.

4

u/Steinrikur Oct 14 '26

I've seen while(1) in FreeRTOS. for(;;) is pretty straightforward, though.

31

u/Daniikk1012 Oct 14 '26

That's actually a pretty common C idiom for infinite loops, not that obscure

15

u/Kommenos Oct 14 '26

Actually this is the preferred convention in my field for notation of ā€œthis is intentionally running foreverā€ like within a thread or a task.

Funny that….

12

u/Grokepeer Oct 14 '26

This is very common in embedded work

6

u/Sea-Quail-5296 Oct 14 '26

I’ve used that seriously before AI

5

u/Scolmann Oct 15 '26

Not uncommon in C, one advantage is it's obvious to any linter that you intend to iterate forever. Linters are generally smart enough to handle it now but if you say "while(1)" or "while(true)" you may get a warning that the condition is always true, and the latter requires including stdbool prior to C23

32

u/Irbis7 Oct 14 '26

I always use for(;;) or for (; condition; ) instead while, the last time I've used while was probably in Pascal.

95

u/anovagadro Oct 14 '26 • Bravo

Get off of reddit Claude, we need the water. Im about to shower

29

u/Irbis7 Oct 14 '26

I'm not AI, but I apologise to all unfortunate users if Claude copied my style.

11

u/[deleted] Oct 14 '26

That's what AI would say

3

u/vegataballs Oct 14 '26

Last time I recently looked at Torvald's code he did too. Not to downplay your contribution, but that too has probably "inspired" Claude quite a bit.

4

u/thet0m0 Oct 14 '26

i only know that from my second 2nd year uni course in C

2

u/Septem_151 Oct 15 '26

You've never seen for(;;) used...? This is very common.

1

u/dgbaker93 Oct 14 '26

I've seen that notation in leetcode submissions 🤣

1

u/Amatheos Oct 14 '26

I legit failed a job interview once because I didn't know that. You can also fill in for call only partially and it will still work

1

u/FUCKING_HATE_REDDIT Oct 16 '26
#define ever ;;

for(ever) {
Ā  // yay
}

0

u/-KKD- Oct 14 '26

I've heard from some algo dudes that in c++ for(;condition;) in some cases by some compilers is optimized better by -O3 than while(condition) and that can save them precious milliseconds they fap on

8

u/isamu1024 Oct 14 '26

We have that moment with SQL where suddenly everyone starts declaring temp table in a way we never saw before:D

28

u/tehtris Oct 14 '26

Python joined the chat

Claude: if x := func():

Me: JUST DECLARE THE VAR FIRST. No one knows this unless they have seen this and went "wtf is this"

31

u/DHermit Oct 14 '26

Nah, I knew this exists. It's just a relatively new addition, so people aren't used to it yet.

9

u/rosuav Oct 14 '26

And the controversy surrounding it was so strong that some of us still have scars.

6

u/codeartha Oct 14 '26

A new addition to python, already exists in other languages

4

u/wggn Oct 14 '26

this is just a scoped variable right

6

u/32nmud Oct 14 '26

Sort of, the scope is not as limited as you might expect. In this condition, x is assigned the return value of func() then evaluated for its truthiness. The variable then can be used after declaration, even outside the scope of the condition block (so you could later use x entirely outside the scope of the condition)

It's a somewhat new addition to Python, but I've found it pretty useful personally. It can also be used in some more complex cases, like in dict comprehension. For example:

products = {"Pen": 120, "Notebook": 80, "Pencil": 40}

affordable = {
    name: discounted_price
    for name, price in products.items()
    if (discounted_price := price * 0.9) < 100
}

print(affordable)

(stole this example from here because I'm lazy)

The := operator is called the walrus operator if you wanted to look it up and learn more

1

u/tehtris Oct 14 '26

Essentially. I guess it's an uncommon math operator that a lot of other languages use, but the first time I saw it in code I was like "wtf is this nonsense..... Oh..... It's bullshit"

2

u/hashishsommelier Oct 15 '26

That’s called the walrus, I like it. It’s cute if you see a walrus.

3

u/them0use Oct 14 '26

Seriously, TIL about the -l option to xargs. What a helpful meme!

3

u/JVM_ Oct 14 '26

I wanted a PNG converted to SVG or some such. It couldn't find a PowerShell way to do it, pngtosvg.com was blocked by the corporate firewall so it found a npm library to do it, downloaded it and called it locally to do the conversion.

Like. It know this possible but what a crazy way to accomplish the task.

1

u/Coulomb111 Oct 15 '26

Does ffmpeg not do that? Its funny it would use some random npm library before ffmpeg

0

u/[deleted] Oct 14 '26

[deleted] — view deleted comment

3

u/JVM_ Oct 14 '26

It was for an icon and I wanted it scalable? I forget the exact formats.

I was more impressed by AI taking a valid pathway/solution that I wouldn't have considered.

3

u/Recent-Ad5835 Oct 14 '26

Meanwhile with GPT I've head cases where I know what the function is and ask it to use it because I cant be bothered to scour the docs to find it and its name, and it kept on getting stuck because it was using a nonexistent function from a core library

2

u/BlueForeverI Oct 14 '26

Couple months ago it generated me a goto statement... in a C# greenfield project.... in 2026...

2

u/supertoilet2 Oct 14 '26

And then when you ask it to make a tiny change it causally ditches the astute function for either a made up function or some beat up clunker

3

u/bleeding_gums Oct 14 '26

I got INSTEAD OF triggers in SQL. Never knew about them.

1

u/hashishsommelier Oct 15 '26

I’m not sure what of that is in the picture. Haven’t you heard about ed? You know, ed is the standard text editor

0

u/Sea-Quail-5296 Oct 14 '26

Like how many people knew what sed was 10 yearsa ago? Three?