Тёмный

This CLI Tool is AMAZING | Prime Reacts 

ThePrimeTime
Подписаться 607 тыс.
Просмотров 82 тыс.
50% 1

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 116   
@CommanderRiker0
@CommanderRiker0 Год назад
Former programmer and current linux/unix administrator I've beaten many of our in house Java/Python(many multi-threaded/processor) routines that massage data with parallel + Awk (or Mawk for even faster performace, given you fit the limitations). We crunch through massive amounts of plain text / hour. Nearly every time the younger staff are perplexed at how this can be (which is in turn perplexing to me how they think they will beat a nearly 40 year old highly optimized program with a few days of coding). Sometimes Mawk will beat my C++ implementations compiled with the most aggressive flags I can set.
@BlackwaterEl1te
@BlackwaterEl1te Год назад
I hear so many people mention AWK feels like i should spend a weekend with AWK and try it out.
@CommanderRiker0
@CommanderRiker0 Год назад
@@BlackwaterEl1te If you need to manipulate text, CSV, or basically anything textual nothing beats the ease of use being able to isolate columns, rows, line numbers, regular expressions, etc. Having some of the worlds best computer scientists optimize its code doesn't hurt either.
@BlackwaterEl1te
@BlackwaterEl1te Год назад
@@CommanderRiker0 Cool thanks for the info, AWK sounds really useful especially in this text data heavy world.
@CommanderRiker0
@CommanderRiker0 Год назад
@@BlackwaterEl1te I recommend the book "Sed & AWK" (Make sure its a later edition), the free pdf is floating around everywhere on the net (O'reilly publisher). Just skip the SED parts if you want. SED is a line editor for quick and dirty regex replacements (its basically built into VIM). AWK is a full programming language.
@trejohnson7677
@trejohnson7677 Год назад
Lol u have chatgpt now, awk is easier then ever
@ChadVanKlompenburg
@ChadVanKlompenburg Год назад
I use a lot of bash scripts not because I like bash scripts, literally any other scripting language would be better, but if written properly, it just works on almost on anything... Also GNU parallel is awesome.
@harrytsang1501
@harrytsang1501 Год назад
I work with docker images and sometimes even bash is too much to ask for. alpine falls back to sh
@tapwater424
@tapwater424 Год назад
More like works on almost nothing. Aside from built-ins, every command is an external program that may or may not be on the system. And the program may have different versions or implementations. Sometimes it's GNU tar, sometimes it's BSD tar. To make a platform independent bash script you need to find the common denominator of every target platform. Don't get me wrong, I use bash all the time, but it's because it's actually a very good model for composing programs together.
@parnmatt
@parnmatt Год назад
the ::: _is_ parallel specific nothing to do with bash parallel is also written in perl
@xdevs23
@xdevs23 Год назад
Yea the ::: are just good ol' arguments to parallel
@MelroyvandenBerg
@MelroyvandenBerg Год назад
It's indeed written in Perl. Hence the stupid :::
@user-hk3ej4hk7m
@user-hk3ej4hk7m Год назад
Parallels is great for anything you could do using multiple tmux sessions. Anything that requires joining and error handling gets overly complicated pretty quickly.
@harsha1306
@harsha1306 Год назад
> be primeagen > wax poetic about the benefits of gnu parallel > never run it on stream Por que Maria?
@theodorealenas3171
@theodorealenas3171 Год назад
A note on xargs: in POSIX it has no parallelism. I don't know how much that means though.
@ThePrimeTimeagen
@ThePrimeTimeagen Год назад
That's good to know. I'm glad I use parallel for all my parallelism :)
@ThePrimeTimeagen
@ThePrimeTimeagen Год назад
Also big fan
@theodorealenas3171
@theodorealenas3171 Год назад
@@ThePrimeTimeagen you're a blessing. I gathered Reddit people now and "percentage viewed"s dropped.
@Palundrium
@Palundrium Год назад
Author of GNU parallel also has a RU-vid playlist references in the manual: ru-vid.com/group/PL284C9FF2488BC6D1&si=lTOiasQ-llm9IwEB
@marghidanu
@marghidanu Год назад
It’s written in Perl.
@Vegetoyesh
@Vegetoyesh Год назад
Acadamia has knowledge about GNU parallel for a long time. This is what happens with big tech is so focussed on their own stack. They ignore the amazing open source contributions made by smarter people who know how to simplify things.
@complexity5545
@complexity5545 Год назад
Academia is about that money. Most of the tools used in college are used as advertisment. Most students end up with jobs that used those classroom commercial tools. I had to learn about parallel via perl in my sparetime and night job; I was my university's web administrator and saw it in a script that some guy in the 1990s wrote. Thank god, I stumbled upon the old timers' scripts.
@Vegetoyesh
@Vegetoyesh Год назад
@@complexity5545 Wasn't my experience. I got to use whatever I wanted. And so did my professor. I'm sure your point is valid in certain circumstances.
@COneillCodes
@COneillCodes Год назад
I had the same question about the ::: when I started seeing examples of the parallel command and did the same thing went crazy digging around perl, and bash and zsh and fish trying to figure out what this thing was and couldn't find anything but it is part of parallel its how it separates arguments or you can use -arg-file
@dradic9452
@dradic9452 Год назад
I surprised prime didn't know that I had to find out as well and found it in his book "GNU Parallel 2018 ,Ole Tange" section 2.1 'Input sources' it's the first thing he talks about. No, I wonder when it was introduced... dam I'll have to do some more digging.
@MelroyvandenBerg
@MelroyvandenBerg Год назад
Parallel is written in Perl >
@azratosh
@azratosh Год назад
I wish I saw this live so I could spam "man parallel" in the chat; ::: is specific to GNU parallel
@hiraginoyuki
@hiraginoyuki Год назад
same here, it was just too frustrating to see all those comments getting ignored
@azratosh
@azratosh Год назад
@@hiraginoyuki Eh it wasn't frustrating imo, it was fun seeing Papa Prime try to figure out whether it was yet another weird BASH construct or not
@Alex-xl4xe
@Alex-xl4xe Год назад
I feel like there are so many amazing tools out there that you would never find in a google search if you search for a specific problem. Isn't there like a comprehensive list of those?
@driyagon
@driyagon Год назад
i searched a few hours ago about gnu parallel and prime comes out with a vid, what are the odds Hmm Susge
@UliTroyo
@UliTroyo Год назад
It's like hearing about a new tech thing and that day seeing a Fireship "100 seconds of the thing"
@ayehavgunne
@ayehavgunne Год назад
Mmm sausage.
@animanaut
@animanaut Год назад
6:28 'brace expansion', if you want to look it up
@mitchelvalentino1569
@mitchelvalentino1569 Год назад
GNU Parallel and Tmux are the two tools I rely on daily for my work. Indispensable.
@complexity5545
@complexity5545 Год назад
This is kind of surprising that he didn't know ::: is cartesian product (in parallel). Its basically data set math/stat like designs to create a argument list of commands. I n bash cartesian product is like `echo {a..b}{1..2}` and it'll print a1 a2 b1 b2. Its SQL like understanding too. Its used to reduce invocations and source code (especially in maths). He probably knew it though, but just forgot (or only saw it used a handful of times by the solo smart old-timers).
@LordHelixe
@LordHelixe Год назад
"$?" only stores the return code of last executed command
@Warflay
@Warflay Год назад
Parallel is awesome, I even used it a few times where I didn't even need parallelization because it's argument parsing and hand handling is so much more powerful than xargs so I just used it instead
@vladimirreyes1938
@vladimirreyes1938 Год назад
You're learning Spanish, I'd like to see how many native Spanish speakers we are ... greetings from the Dominican Republic.
@MarcCastellsBallesta
@MarcCastellsBallesta Год назад
Do you want to count us with the likes? Or you want a reply from each one of us? 😂 😂
@javierflores09
@javierflores09 Год назад
There's quite a few from what I know. Greetings from Argentina
@Markski
@Markski Год назад
Greetings, also from Argentina. Love el primo agen
@juaninfante7000
@juaninfante7000 Год назад
Dominican too
@minneelyyyy
@minneelyyyy Год назад
parallel is written in perl
@MelroyvandenBerg
@MelroyvandenBerg Год назад
Parallel written in Perl :)
@dr3d3d
@dr3d3d 7 месяцев назад
this episode was extra amusing as I am currently writing a bash script to auto play Cookie Clicker using only core linux/X11 tools, not just a clicker but full on buying,gardening, combo'ing etc
@user-cc8kb
@user-cc8kb Год назад
yeah, he should have asked chat-gippity for the turbo fish thing :D
@limpiadora
@limpiadora Год назад
This could solve a lot of problem at my job, we have a bunch of e2e tests that are crazy, some developer that left try build a multilprocess version with node but it suck and it fail for no reason
@asdfasdf9477
@asdfasdf9477 Год назад
yeah, and when after 100+ attempts you finally get all the quoting/escaping/piping just right in your interactive bash session, you can begin fixing quoting/escaping/piping required for a script version
@ZacharyBetz
@ZacharyBetz Год назад
Watched for the headline. Stayed for your narration.
@JoaoAntonioCardoso
@JoaoAntonioCardoso Год назад
so... it seems that parallel is written in ... perl
@meowsqueak
@meowsqueak Год назад
12 minutes later and I still don’t know what it actually does…
@mage3690
@mage3690 Год назад
As someone who has programmed altogether too many lines of Bash (all 10 of them were 10 too many), I know I've done a little too much Bashing (excellent name for it, BTW. It's called bashing because that's what I do to the keyboard with my head) when I see any control flow statements more complex than an "if". "While" is right out, and "for" gives me PTSD (dear God, may I never try to implement flags in Bash). Also, anything more than 5 pipes or escape characters on one line are heinous to read, and I've colorized my command prompt. Why does double quote string expansion escape single quotes, I'll never know.
@Feedback406
@Feedback406 5 месяцев назад
If you saw my zls colors regex for my completions you would trip out😂😂😂
@AloisMahdal
@AloisMahdal Год назад
Man, both `:::` and `{1}` are totally a GNU Parallel syntax.
@CTimmerman
@CTimmerman Год назад
Indeed, as zsh on MacOS says: ❯ ls {1} ::: {1..10} ls: 1: No such file or directory ls: 10: No such file or directory ls: 2: No such file or directory ls: 3: No such file or directory ls: 4: No such file or directory ls: 5: No such file or directory ls: 6: No such file or directory ls: 7: No such file or directory ls: 8: No such file or directory ls: 9: No such file or directory ls: :::: No such file or directory ls: {1}: No such file or directory
@dots5641
@dots5641 Год назад
im going to write an assembler in bash. you cant stop me.
@nibblrrr7124
@nibblrrr7124 Год назад
The most glorious 15,000 lines of Perl ever written.
@sealwithawkwardness3951
@sealwithawkwardness3951 Год назад
Have you ever heard of VIM though?
@jlucsx
@jlucsx Год назад
Finally!!! Thank yooouu
@Maraloon_
@Maraloon_ Год назад
read the doc, it's awesome
@H4KnSL4K
@H4KnSL4K Год назад
Dude, Primeagen, you need to take a break and slow down sometimes. Take it easy and enjoy it, there's no rush!
@Diego-Garcia
@Diego-Garcia Год назад
The name is Themultitaskgen
@PinakiGupta82Appu
@PinakiGupta82Appu Год назад
Again, a suggestion for another mindless Rust-rewrite?😳
@georgecarder4695
@georgecarder4695 Год назад
Luke Smith sold me my first hit of GNU parallel.
@davidlee588
@davidlee588 Год назад
found this on SO: Parallel processing makes sense when your work is CPU bound (the CPU does the work, and the peripherals are mostly idle) but here, you are trying to improve the performance of a task which is I/O bound (the CPU is mostly idle, waiting for a busy peripheral). In this situation, adding parallelism will only add congestion, as multiple tasks will be fighting over the already-starved I/O bandwidth between them. On macOS, the system already indexes all your data anyway (including the contents of word-processing documents, PDFs, email messages, etc); there's a friendly magnifying glass on the menu bar at the upper right where you can access a much faster and more versatile search, called Spotlight. (Though I agree that some of the more sophisticated controls of find are missing; and the "user friendly" design gets in the way for me when it guesses what I want, and guesses wrong.)
@JimWitschey
@JimWitschey 5 месяцев назад
dbrock losing his damn mind in the chat. love it
@Tony-dp1rl
@Tony-dp1rl Год назад
Wow, it's like Powershell on Windows ten years ago.
@GiovanniCKC
@GiovanniCKC Год назад
Powershell got something right? I thought everybody hated it.
@complexity5545
@complexity5545 Год назад
Parallel was made in like 2002, back when SMP was being written in kernels, and google started promoting python instead of perl. During that time most programs were written to only run on 1 cpu. Parallel allowed you to take a 1 cpu program and use all 4 of your CPUs. Today we have 128-Cores and parallel will apply to all of them; stuff gets done quick. We'd use it in clusters and then Gearman was made. I think Powershell copied alot of that stuff.
@CyberDork34
@CyberDork34 2 месяца назад
Powershell is an actual programming language with a type system, whereas POSIX shell is mostly just calling executables and piping the text of one executable to the next
@Han-ve8uh
@Han-ve8uh 5 месяцев назад
Anyone remembers which is the video on this channel where @ThePrimeTime spoke about gnu parallel being able to continue to the next command down the pipe without blocking? There were also some diagrams drawn in that video. Found it! thanks to youtube's good search algo, searching "parallel" led to ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pHJmmTivG1k.html
@kvherro
@kvherro 11 месяцев назад
Parallel is a superpower
@joelkorpela2706
@joelkorpela2706 Год назад
1080p is the new 4k!
@blakebaird119
@blakebaird119 Год назад
At least the article didn’t call anything mesg
@rawpointer
@rawpointer Год назад
I want to date the girl from algoexpert, is the only ad that I don't hate opposed to clement's mental picture.
@noTmeDev
@noTmeDev Год назад
The name is the parallelagen. XD
@weeb3277
@weeb3277 Год назад
bash or pass
@Lemmy4555
@Lemmy4555 Год назад
My eyes burn every time I read bash, pwsh and cmd. The technology is still not advanced enough for a comprehensible command line language.
@CTimmerman
@CTimmerman Год назад
Nushell and Fish have readable scripts.
@KeinNiemand
@KeinNiemand Год назад
pwsh more readable then cmd or bash to me, still not great
@harshgandhi100
@harshgandhi100 Год назад
Stop paralyzing start parallelizing
@shadyheadstash
@shadyheadstash Год назад
11:57 I'm serious
@apina2
@apina2 Год назад
Ghanoo Parallel
@martinhotmann7868
@martinhotmann7868 Год назад
Yeeeah finally this shit it out :) BTW: love your content ^^ I watch it all some days ;) Greetings from germany 🇩🇪
@elie3423
@elie3423 Год назад
Go sleep parmesan
@333juniorb
@333juniorb Год назад
yeah C baby !!!
@Kane0123
@Kane0123 Год назад
Or is it really gnu/Linux parallel
@ordinarygg
@ordinarygg Год назад
If you know Python forget about this tool and just use Multiprocessing module -> you will have queue, shared memory and more. Bash is very limited and hard to read in terms of just fundamental programming logic.
@complexity5545
@complexity5545 Год назад
Do you use it to invoke other programs?
@ordinarygg
@ordinarygg Год назад
@@complexity5545 read about multiprocessing, shell and async Pipes, you can open programs and async stream
@PinakiGupta82Appu
@PinakiGupta82Appu Год назад
😂😂👍👍
@robervaldo4633
@robervaldo4633 Год назад
better to skip parallel and just use ansible
@ordinarygg
@ordinarygg Год назад
agree, he is probably Junior dev
@greyshopleskin2315
@greyshopleskin2315 Год назад
Ansible to run tests? Wtf?
@ordinarygg
@ordinarygg Год назад
@@greyshopleskin2315 xD you probably didn't saw more then 5k test suites in your life in automated CI/CD lol
@greyshopleskin2315
@greyshopleskin2315 Год назад
@@ordinarygg no, but I don’t understand the use case for ansible. I used it to configure machines, that’s it. How do you use it? You have a cluster of n machines, and use ansible to pull latests changes from git repo and run tests across all machines? Or what?
@ordinarygg
@ordinarygg Год назад
@@greyshopleskin2315 pull from repo? This is security breach to give access machine to run tests to your repo, it should be synced outside. In general yes, but you missed: - collect the results - bootstrap env to run those tests if they are E2E - create a report If you use something like gitlab CI or even worse github actions imagine it will go down or change the syntax LOL. All kids that use free things don't understand one simple rule, if it's free then price is you and your code. Nothing is free in this world.
@thomassynths
@thomassynths Год назад
What's the point of this tool? Basically all modern scripting languages can do the same thing with the same amount of code. Except you aren't using a shell language anymore = Win.
@bitti1975
@bitti1975 Год назад
Your bash bashing is uncalled-for. Adhere your own advice and learn your tools!
@ThePrimeTimeagen
@ThePrimeTimeagen Год назад
yes, i agree, but as i said, once i hit arrays, its time to use something better i still think this is a good piece of advice for bash
@bitti1975
@bitti1975 Год назад
​@@ThePrimeTimeagen Yes, there should be a threshold, and in the examples given using an array was unnecessary (that's why we have globs, e.g. `for test in potentially_flaky_*.sh; do...`). Still, there is also a threshold for switching to a 'real' scripting language, since interacting with CLI tools is so much easier in bash than in python, ruby and alike. And using an advanced feature can keep the script more readable if used appropriately.
@bitti1975
@bitti1975 Год назад
Btw. brace expansion (à la project/{src,dist}) I don't consider an 'advanced feature', since it's also very practical in interactive use (i.e. in particular when you don't write a script). And it's not even bash specific and supported by practically all shells (fish doesn't have range expansions though).
@samuelschwager
@samuelschwager Год назад
gnu is not unix
@GiovanniCKC
@GiovanniCKC Год назад
4:36 why not just use a makefile for this? feels like it would work well enough with the parallelization, but now it's more understandable, and I don't need to download a new utility. (maybe something like uhhhh) ```make # tests T=potentially_flaky_1.sh potentially_flaky_2.sh potentially_flaky_3.sh potentially_flaky_4.sh potentially_flaky_5.sh tests: $T potentially_flaky_%.sh: bash $@ ``` and then just exec the tests with ```sh make -j tests ``` and you can still get output in the correct order with just a couple tweaks to the makefile: ```make # output files O=pft_out_0 pft_out_1 pft_out_2 pft_out_3 pft_out_4 pft_out_5 tests: $O cat $O ; rm $O pft_out_%: potentially_flaky_%.sh > $^ ; bash $^ 1>$@ 2>&1 ```
@papillon8i838
@papillon8i838 Год назад
love. nuf sed
Далее
Tutorials Are KILLING Your Growth | Prime Reacts
17:35
Просмотров 130 тыс.
I Feel Bad For New Programmers
19:12
Просмотров 462 тыс.
The RustConf Drama
35:28
Просмотров 89 тыс.
Xargs Should Be In Your Command Line Toolbag
16:24
Просмотров 100 тыс.
I Parsed 1 Billion Rows Of Text (It Sucked)
39:23
Просмотров 135 тыс.
Dear Functional Bros | Prime Reacts
26:03
Просмотров 232 тыс.
This Algorithm is 1,606,240% FASTER
13:31
Просмотров 842 тыс.
10 AWESOME CLI TOOLS TO SUPERCHARGE YOUR WORKFLOWS
10:03
Vim vs Emacs | Prime Reacts
15:56
Просмотров 153 тыс.
Bash is Bloated!
11:48
Просмотров 143 тыс.
Why I Use C | Prime Reacts
13:00
Просмотров 164 тыс.
Prime Reacts: The Flaws of Inheritance
29:05
Просмотров 360 тыс.