Wget, Vim and The Bash Insulter

  Рет қаралды 11,269

DistroTube

DistroTube

Күн бұрын

I recently came across a script called Bash Insulter. It chooses a random insult every time you enter a wrong command. It's a nice, simple script. So let's hack on it a little.
REFERENCED:
► www.gnu.org/so... - Wget
► www.vim.org/ - Vim
► www.gnu.org/so... - Emacs
► ergofabulous.or... - Luther's Insults
► www.nosweatsha... - Shakepeare's Insults
► github.com/hkb... - Bash Insulter
► gitlab.com/dwt... - My Modified Bash Insulter
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
SOCIAL PLATFORMS:
🗨️ Mastodon: mastodon.techn...
💬 IRC: irc://freenode #distrotube
👫 Reddit: / distrotube
📽️ LBRY: lbry.tv/$/invi...
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gopherhole: gopher://distro.tube
📁 GitLab: gitlab.com/dwt1
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🔊 Audacity: www.audacityte...
💻 VirtualBox: www.virtualbox...
Your support is very much appreciated. Thanks, guys!

Пікірлер: 64
@Tb0n3
@Tb0n3 4 жыл бұрын
How about Kamikaze Linux that rm -rf / when you mistype a command? Edit: Suicide Linux
@GrumpyCrash
@GrumpyCrash 4 жыл бұрын
*rm -rf /* wont work as expected because *--no-preserve-root* is default. You have to use *rm -rf --no-preserve-root /*
@idle-hands
@idle-hands 4 жыл бұрын
@@GrumpyCrash or sudo rm -rf /*
@sippstea5453
@sippstea5453 4 жыл бұрын
These are the kind of things you should live stream.
@12Q46HPRN
@12Q46HPRN 3 жыл бұрын
As a lifelong Lutheran and an new-to-the-fold Linux user, this was gold! Thank you.
@KevinBReynolds
@KevinBReynolds 4 жыл бұрын
Very cool video. Packed with info. Very potent. I'll have to go over it a couple of times to make sure I got it all right but, that was great. Thanks Derek!
@mathisgauthey01
@mathisgauthey01 3 жыл бұрын
Hey there, I can't find a way to make it insult everytime and not only half... Removing the if isn't working and I don't know anything about bash nor do I have the time to accord it 2 more hours. Any help ?
@keiichiiownsu12
@keiichiiownsu12 4 жыл бұрын
Video idea: viewing images and watching video in a linux tty, without any Xorg/Wayland
@komolunanole8697
@komolunanole8697 4 жыл бұрын
@Learn Linux Doubtful. Some programs can draw directly to the screen without an X server
@keiichiiownsu12
@keiichiiownsu12 4 жыл бұрын
@Learn Linux Exactly. mpv and mplayer can play directly to the frame buffer. mpv --vo=drm mplayer -vo drm If you want fullscreen for mplayer, you have to 1>/dev/null and 2>/dev/null
@keiichiiownsu12
@keiichiiownsu12 4 жыл бұрын
@Learn Linux A few other fbdev programs: fbi: can view images in console jfbviewer: fbdev PDF viewer with "VIM-like" syntax
@billchatfield3064
@billchatfield3064 4 жыл бұрын
The Lutherian insults were a great idea. Luther was a better insulter than Shakespeare. Is there a reason why you don't use gvim instead of vim?
@gnituqcom6298
@gnituqcom6298 4 жыл бұрын
Yahawah bahasham Yahawashi bahasham Rawach Qadash barak atham ( may the most high [Yahawah bahasham Yahawashi haMashiach] be with you ) PS: this is a blessing, so no need to put it in the spam folder or (if it is already there) to leave it there😀
@KelvinShadewing
@KelvinShadewing 4 жыл бұрын
Bash Bash bashers.
@tolmoli27
@tolmoli27 4 жыл бұрын
vim guru xD
@KarlMySuitcase
@KarlMySuitcase 4 жыл бұрын
I think you should have 12 year old's on Xbox Live insults.
@insanerwayner
@insanerwayner 4 жыл бұрын
ctrl+v and shift+i then type your changes and escape will do the same as the “ctrl+v then : norm I “ method
@nonenothingnull
@nonenothingnull 4 жыл бұрын
Batch insert
@GrumpyCrash
@GrumpyCrash 4 жыл бұрын
Why a script? Create a cookie-file for fortune(6) and use *trap "eval fortune cookie-file" ERR* for bash or *TRAPZERR() { fortune cookie-file }* for zsh.
@damian_madmansnest
@damian_madmansnest 4 жыл бұрын
Your kung-fu is formidable, sir.
@GrumpyCrash
@GrumpyCrash 4 жыл бұрын
@Learn Linux Nope. *eval* is necessary. Otherwise there's always the same cookie displayed.
@chri87d9
@chri87d9 4 жыл бұрын
You don't have to edit out the text editing in vim, it's pretty cool to watch. Imo. Great video.
@hUmAnWiThOpInIoNs
@hUmAnWiThOpInIoNs 4 жыл бұрын
So true
4 жыл бұрын
I concur.
@linuxrant
@linuxrant Жыл бұрын
yeah, actually seeing the command twice in different situation is very good for learning.
@kraftwerk28
@kraftwerk28 4 жыл бұрын
Now i learned how to use vim macro. Thanks, DT!
@thescrawl6594
@thescrawl6594 4 жыл бұрын
you can speed this up immensely if you have something like w3m installed. doing "w3m -dump example.com > file" will pipe a plaintext version of the page with no html tags or padding.
@AnzanHoshinRoshi
@AnzanHoshinRoshi 4 жыл бұрын
Thank you, Derek. This can be fun but I became disinterested in it after a few days.
@rochr4
@rochr4 4 жыл бұрын
Video idea: github.com/clvv/fasd
@dkosmari
@dkosmari 4 жыл бұрын
May I suggest: xmllint --html --xpath "//td[2]" insult-list.php > insults.txt After that, it's a matter of replacing "" and "" by quotes, and replace stray "" by some fancy escape sequences (or just delete them.)
@joaofnds
@joaofnds 4 жыл бұрын
"//tr/td[2]/text()"
@dkosmari
@dkosmari 4 жыл бұрын
@@joaofnds Keeping the tags make it easier to replace by quotes. Also, "/text()" will mess up when there's a "" element in the text.
@joaofnds
@joaofnds 4 жыл бұрын
@@dkosmari xmllint --html --shell insults.html
@joaofnds
@joaofnds 4 жыл бұрын
Thanks for mentioning xmllint, I didn't knew about it. I always have to open a browser and use JS to get things out of html/xml
@dkosmari
@dkosmari 4 жыл бұрын
@@joaofnds If you need to work with html, it's useful to learn some XPath and XSLT. You can do quite a bit of useful operations before you strip the structure out of the document.
@firstprincipleslearning
@firstprincipleslearning 4 жыл бұрын
Fucking Magic ! If you make a VIM course let me know. I would buy it
@lsatenstein
@lsatenstein 4 жыл бұрын
Why I turn away from many Linux channels I like presenters who understand the use of "dead air". I watch this channel today and whenever there is a topic of interest to me. That said, when editing is done for the next day's presentation, please think of you video as a book with sub-topic chapters, and paragraphs. It is not necessary to read-aloud, text that we can read on our own. When the editing has no pauses to let me absorb what was presented, before the author presents the next topic, wow. Did the author breathe in-between? Would a one second pause between major topics be OK, with 1/2 second between "paragraphs"? I have a list of 20 presenters who are afraid of slight pauses. I taught a class of students who knew nothing about the topic I was teaching. Because it was a classroom course, the pauses were quite welcome and long. With a video, a major subject change can improve a presentation if there is a one second delay from topic to topic. By the way, in teaching a class, it is done in three parts. "Today I am going to tell you about xyz", Part2: Now I do the telling, and Part 3, This summary is about what I told you. By the way, I am posting my comment as a way to get, entertain/teach and maintain audiences
@DJ_Cthulhu
@DJ_Cthulhu 4 жыл бұрын
Quite like those Lutheran insults, will probably add them to my fortune files. I think Chaucer had some nice insults, too. 🤓
@gizzmoguy.
@gizzmoguy. 4 жыл бұрын
make a video how you theme vim so sweetly I know its Dracula theme but i don't know how to get it working in vim
@yuvaldahan642
@yuvaldahan642 4 жыл бұрын
The bar at the button is vim-airline/powerline
@gizzmoguy.
@gizzmoguy. 4 жыл бұрын
@@yuvaldahan642Thanks, but knowing what it is and knowing how to install it is two different things. 🤔
@yuvaldahan642
@yuvaldahan642 4 жыл бұрын
@@gizzmoguy. Read about the plugin manager vim-plug, it has a clear README and you can easily install vim-airline with it
@gizzmoguy.
@gizzmoguy. 4 жыл бұрын
@@yuvaldahan642 Yup trying it right now using Vundle still has not gotten it to working.......
@dkosmari
@dkosmari 4 жыл бұрын
Another way to go about the arrays, is just leave them in the file, one per line, no quotes. Then use the "readarray/mapfile" command from Bash. readarray -t array2 < lutheran-insults.txt readarray -t array3 < shakespearean-insults.txt
@birkner510
@birkner510 4 жыл бұрын
You could have replaced the opening and closing tags at once with :%s//"/g
@yakimura96
@yakimura96 4 жыл бұрын
Awesome, this gave me a lot of ideas to troll some friends, thanks for the vid!
@taidee
@taidee 4 жыл бұрын
Great stuff DT, I only stumble on it now.
@asleeponmykeyboard3039
@asleeponmykeyboard3039 3 жыл бұрын
I love this community
@mitchelvalentino1569
@mitchelvalentino1569 4 жыл бұрын
hehehe. Good stuff. The OpenBSD sudo package will insult you _by default_ and the doas package, which many OpenBSD users prefer to sudo, also has some killer insults. And Gentoo has the infamous -offensive flag. 😈
@webbonyoutube
@webbonyoutube 4 жыл бұрын
Didn't OpenBSD deprecate sudo?
@mitchelvalentino1569
@mitchelvalentino1569 4 жыл бұрын
webb yes! But some people (stubborn Linux users) install it anyway. Generally speaking, sudo shouldn’t be used on OpenBSD. doas is much much better!
@mitchelvalentino1569
@mitchelvalentino1569 4 жыл бұрын
webb Interestingly, using OpenBSD is a great way to learn to live _without_ sudo. It’s an old-school way of interacting with one’s computer that can also be applied to Linux. (Much like learning to live without a package manager, or at least learning to use a minimal one). PCLinuxOS, for example, is a distro that doesn’t come with sudo..... because it’s unnecessary :)
@tiberiusmagnificuscaeser4929
@tiberiusmagnificuscaeser4929 4 жыл бұрын
Iirc Debian doesn’t come with sudo by default either
@ivanjermakov
@ivanjermakov 4 жыл бұрын
You could just copy all contents of the page through browser instead of editing page's source code.
@AtomToast
@AtomToast 4 жыл бұрын
I can recommend looking into normal commands, they are incredibly powerful. For example you can do stuff like "delete every line not containing this pattern" with something like `:g! //d`. Then with normal vim magic like visual block mode you can remove the leading tags and spaces and then use something like `:%norm f
@chaussebenjamin
@chaussebenjamin 4 жыл бұрын
Suicide Linux is a distro that executes 'Sudo rm -rf /*’ when you get a command wrong.
@stephenreaves3205
@stephenreaves3205 4 жыл бұрын
Pandoc would be nice to get the webpage directly in markdown. Should make it easier to format
@keedt
@keedt 4 жыл бұрын
I usually use "w3m -dump " to get rid of html tags
@teknastyk
@teknastyk 4 жыл бұрын
i got super impressed wt the way you removed spaces in front of each sentence... Thats something i havent seen done in a payed text editor in almost 30yrs... Yes, you could find and replace certain amount of spaces in a notepad; but(!!!) Itd also replace the same amount of spaces in the space after each sentence so that might break your form(ating). So to see a cli editor do this its just wow - ive witnessed the force i guess
@davidgomez79
@davidgomez79 4 жыл бұрын
Lol, every time I feel like being insulted and called names I just post this: Vote Trump.
@mysticmarble94
@mysticmarble94 4 жыл бұрын
⚘ BERNIE . BERNIE . BERNIE ⚘
@mysticmarble94
@mysticmarble94 4 жыл бұрын
@Max Paine Alive and well about to DESTROY Donald in November with his mighty socialist sword !!!
@mysticmarble94
@mysticmarble94 4 жыл бұрын
@Max Paine Only fake thing was a trial without witnesses 😅😅😅 Same with the fake partisan acquital.
Vim Macros Make The Impossible Possible
11:19
DistroTube
Рет қаралды 21 М.
A First Look At Zorin OS 17.2
16:36
DistroTube
Рет қаралды 20 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,9 МЛН
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 13 МЛН
From Small To Giant Pop Corn #katebrush #funny #shorts
00:17
Kate Brush
Рет қаралды 70 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 66 МЛН
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Two Minute Papers
Рет қаралды 200 М.
Command Mode, Ranges and 'g' in Vim
13:03
DistroTube
Рет қаралды 29 М.
Let's Share Our Favorite Bash Aliases
16:28
DistroTube
Рет қаралды 31 М.
Radxa X4: An N100 Pi
20:48
ExplainingComputers
Рет қаралды 14 М.
Vim Can Save You Hours Of Work
20:52
DistroTube
Рет қаралды 170 М.
Vim Versus Emacs. Which Is Better?
30:38
DistroTube
Рет қаралды 270 М.
My First Time Looking At Oreon (An Alma-Based Linux Distro)
21:29
Web Apps That Aren't Bloated! Using Curl.
12:36
DistroTube
Рет қаралды 39 М.
What If Linux Became More Popular Than Windows?
14:46
DistroTube
Рет қаралды 51 М.
A Few Vim Plugins That Have Impressed Me Recently
13:31
DistroTube
Рет қаралды 123 М.
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,9 МЛН