You are viewing a single thread.
View all comments View context
5 points
*

Just take a photo with a trusted regular camera app and then enhance it with imagemagick. I have this script, works like a charm: convert INPUT_IMAGE.jpg -colorspace gray \( +clone -blur 15,15 \) -compose Divide_Src -composite -normalize -threshold 80% OUTPUT_IMAGE.jpg. Pretty sure you can also specify multiple input images, and imagemagick can merge it into a PDF file. For joining a really large number of images into PDF files (e.g.scans of entire books), you can convert each image individually, and then pdunite them. So something like for i in *; do convert $i $i.pdf; done; pdfunite $(ls *.pdf | sort -n) output.pdf

Apps are bloat. Reject modernity, embrace shell scripts.

permalink
report
parent
reply
2 points

I agree.

Does it count if one uses an LLM to help compose the shell script? I mean, I can and have written gnarly scripts by hand but it can take half an hour to work out a single line sometimes for a simple task versus 10 minutes describing it in plain language.

permalink
report
parent
reply
2 points

Of course it “counts”! Whatever gets the job done! I personally am pretty bad with writing shell scripts, so I often use LLMs as “pseudocode compilers”. Like, I literally give it an entire program in pseudocode, and most of the time it can “compile” it to BASH or posix shell pretty well. Maybe some people might argue that it’s better to just sit down and learn shell scripting yourself, but I would argue that just by looking at or tweaking LLM-generated scripts you’re already passively learning the basic syntax and conventions. Not to mention that you can ask it to explain parts of the code to you!

permalink
report
parent
reply
2 points

Whew, thanks for not being a knee-jerk about my ‘mental prosthetic’! It takes real skill and understanding, I think, to even write the pseudocode or plain language description of a working script. After all, describing the problem and the outline of the solution is usually the hardest part. Pecking out the syntax takes the bulk of the time, but if you can avoid that step, what is lost? Very little in my experience.

I’ve begun collecting an assortment of custom python and shell script utilities to accomplish routine or one-off tasks for which system utilities don’t exist. You bet you are still learning when doing it this way. After all, you have to understand the code well enough to tell if the output is what you need.

permalink
report
parent
reply

Memes

!memes@lemmy.ml

Create post

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

Community stats

  • 8.3K

    Monthly active users

  • 12K

    Posts

  • 265K

    Comments