• 2 Posts
  • 126 Comments
Joined 2 years ago
cake
Cake day: January 25th, 2024

help-circle

  • I recommend you gnu parallel. It does similar things, but runs the commands in parallel. And it’s way easier to pipe than xargs. If you really need it to run one command at a time you can give number of cores to 1. And it also has progress bars, colors to differentiate stdout fo different commands, etc.

    Basic example: to echo each line

    parallel echo < somefile.txt

    To download all links, number of jobs 4, show progress

    parallel -j 4 --bar ''curl -O" < links.txt

    You can do lot more stuffs with inputs, like placing them wherever with {}, numbers ({1} is first) that allow multiple unique arguments, transformers like remove extension, remove parent path, etc. worth learning




  • We have a good system for Superbowl with my friends, we gather in a place and whoever is there for game enjoys the game, while others do chores (prep food and such), and those that are there for halftime shows and things enjoy those, and the game guys do chores and help around during that time.



  • Now I’m thinking why don’t we make an image editor that we can customize the simple UI. Like users choose which sliders and tools to put on the ui, it’ll be simple UI with like just 5-10 buttons/sliders/tools, but you van customize it to have basically anything. That way you can simply drag drop tools make new UI and then use it for specific use cases.

    Maybe already existing tools have that options. Or maybe we need to make a new one, in that case, it’d be nice if we could just add all different tools in dlls or sth, so that you can only download/keep the tools you use.






  • I haven’t really gone full typst on notes. But honestly my notes are mostly just texts, so it doesn’t really matter what I’m writing it in. I should be able to get it to typst with a few find and replace for old one. Math will be easier in typst, so I’m at least writing the new notes in typst when I need those.

    But I think for future notes I’ll do typst, specially if I have to share those notes it’s easier to send PDFs. Many of my colleagues get confused if I send markdown, so I had to export them to pdf for sharing anyway.




  • I guess it can go unnoticed, I use Arch so maybe that’s why I got more involved. I remember searching why auto completion didn’t work, then finding out I need to install bash-completions package. After knowing that it makes one curious about how it works. Then the next stage is writing it for my own programs because it obviously won’t come with bash-completions package.

    I once wrote a shell (terminal) to watch anime, and I wrote auto completion for different commands on it, it was really nice to just type play then prefix and then tab for auto completion on anime names, and even for episodes I wrote auto completion give me last episode I watched + 1.


  • Whenever someone says they don’t really like terminal because they don’t like to type or remember commands. This is what I think “they didn’t use auto complete”.

    Auto complete works for file names and paths by default, but the development can write it to only complete certain extensions. Like auto complete for image program only completes image files. Then you have completion for commands, subcommands and flags.

    Auto complete is done through calling a bash script with currently typed line, and the bash script can call other commands. So developer can write a really complicated auto complete and make it available as a binary if they want, and just use that in bash. Or you can use many tools that will generate auto complete script for you based on your commandline args.

    If you write your own scripts/cli binaries I recommend learning how to write auto complete for it. Makes it incredibly easy to use the tools.