Most linux distros you can prevent the fork bomb by limiting users processes in limits.conf along with controlling any other out of control process. At least that used to be the way not sure if that has been superseded by something yet.
1:36 Fork Bomb: As an admin you can mitigate this happening if you use resource limits (ulimit -u 1000) to restrict the number of processes a user can create.
I've been using BASH since I started back in the early 90s. Doesn't matter if what i'm logging into wants me to use zsh, csh, tcsh, dash, ksh/pdksh (yes, I've had ot deal with all of them)... BASH either gets installed or my shell gets changed to it if it's already installed. Why? Because it's always done what I need a shell to do. That said, it is neat to see oddball things like the zsh tetris.
I knew about the forkbomb, I didn't know that there is Tetris in ncurses hidden in zsh. A cool easter egg. I also have a PS1 prompt which becomes red when I enter a non-command. Just a coincidence, I downloaded one when I switched to zsh.
Also if you wanted even shorter, to get a clock I do `watch date` and can use `-n 2` to change the time. Just a llittle faster to type and I love the watch command
Oh, as everyone else has said: "I too am enjoying you YT's".
22 години тому
Nice 😁 I need to stop watching all the shit I watch on yt, and start relearning all I have forgotten about linux. I'll keep watching good content like this. Another great video Bread.
If you can add a feature in under 1M of space, I don't consider that bloat, at least not nowadays. Back when I got started, I would've said bloat at 1K, but now I've got literal terabytes of storage space. In fact, I think I might be willing to go as high as 10M before I grouse.
Funny story, I had to dump bash previous week. I have no idea why but somehow a recent update of some program made bash crash all the time. I switched to zsh and dash and the crashes disappeared. I would guess that it is related to my hardware.
@@Toxikuu If it wouldn't be then I should have heard others about it by now. I use Arch. Anyway, I guarantee you that it is bash which crashed and it is a fact that the crashes happened long after the last bash update around late september in 2024 so an update of another program made it crash on my system, that much is certain. When you can't do anything anymore in any terminal or tty, your shell-commands (via the windowmanager hotkeys) don't work but all regular hotkeys for the windowmanager itself do work and open programs still function with the exception of the terminals, alt least for a while, that makes it abundantly clear that your shell crashed. That happened at least around once every hour until I changed to other shells, dash as 'POSIX-compliant' shell (sh=>dash), zsh as the shell of the user (chsh). Nothing else changed.
Do you have a command or function in your .bashrc that is hardware-specific or refers to a command/program that makes the whole session crash? Otherwise bash should work if the other shells work too.
@@audiolatroushearetic1822 Nothing interesting relevant. One line for ghcup which I also have in my zshrc, other than that just a lot of aliases and a few functions. Also, as far as I know this either works or doesn't, it shouldn't suddenly crash. I suspect that ffmpeg could somehow make bash crash but I can't proof it yet. It only crashes while i play audio or video.
So, does that mean that, according to the Julian calendar, I am writing this comment on January 18, 2025? Whelp, guess I'm going back in time to the massive cold snap that hit my area, that we just emerged from! D:
The shell is deeply integrated into the system, so there's definitely certain things it's good at, but you might have a better and more productive time scripting in like Python or Go. The syntax is much, much cleaner, making it easier to reason about what the code is doing.
I have "secs" alias for date (time with seconds), since I often work in full screen vscode and jump around to terminal a lot on ubuntu. Needless to aay its suggestive word :D
: is usually mapped to the 'true' pseudo-command (which just outputs nothing). > filename technically works too, and is fine to use on the command-line, but in scripts it's better to explicitly redirect from some command, because it can be a source of bugs like `command & > output.txt` when `command &> output.txt` was meant.
Confirmed that fork bomb works. Tried it in virtual machine so no harm done. Out of curiosity: do Americans always treat Sunday as first day of the week? I see it's default in many places and I always have to change it.
Your PS1 doesn't have to be a mess, you can set variables for the colors for example... ``` # ~/.bashrc prompt() { exit_code=$? local red="\[\033[1;31m\]" local grn="\[\033[1;32m\]" PS1="" [ -n "$SSH_CLIENT" ] && PS1+="(ssh from ${SSH_CLIENT%% *}) " if test "${exit_code:-0}" -eq 0;then PS1+="${grn}( •_•)${rst} " else PS1+="${red}(;☉_☉)${rst} " fi } PROMPT_COMMAND="prompt;" ```
Adding to this from the aspect of calling something compute-heavy: one could prepend the actual calling by test (if cwd contains .git, then query the branch, otherwise do nothing) and do some memorization (if it's know that the state is preserved within the time frame, store and reuse it, otherwise reevaluate)
5:17 - haha, what if you replaced the spin characters with ✃ ✂ ✁ ✂ ? :D [note, this emojified some of those, but it looks different in shell] [I'm sure lots of other fun choices could be made, too.]
started playing tetris and missed the rest of the video :D
Lol me too 😂 I didn't know zsh had that
Most linux distros you can prevent the fork bomb by limiting users processes in limits.conf along with controlling any other out of control process. At least that used to be the way not sure if that has been superseded by something yet.
Oh, good. Now I don't need emacs to play Tetris. :)
haha, right? 😂
1:36 Fork Bomb: As an admin you can mitigate this happening if you use resource limits (ulimit -u 1000) to restrict the number of processes a user can create.
more content like this, please
instant subscribe!
straight to the point, no screwing around
simple and informative
Absolutely loving your vids
Thank you :D
I've been using BASH since I started back in the early 90s. Doesn't matter if what i'm logging into wants me to use zsh, csh, tcsh, dash, ksh/pdksh (yes, I've had ot deal with all of them)... BASH either gets installed or my shell gets changed to it if it's already installed. Why? Because it's always done what I need a shell to do. That said, it is neat to see oddball things like the zsh tetris.
You have to prepare a magic hat for the next video for this series
Oh I totally should
love your videos, keep it up!!
It's hard for me to move to another shell like zsh, fish and etc, after using bash for 15 years.
I moved to Zsh this past year I absolutely love it
zsh is just bash+ anyways, fish is the odd one
Those are in fact really cool tricks, thank you
9:20 Or install `watch`. :)
But you know how much people hate clock-watching ... I'll get me coat.
I’ve wondered abit if there’s a prompt to print the time a command started and ended.
I knew about the forkbomb, I didn't know that there is Tetris in ncurses hidden in zsh. A cool easter egg. I also have a PS1 prompt which becomes red when I enter a non-command. Just a coincidence, I downloaded one when I switched to zsh.
Also if you wanted even shorter, to get a clock I do `watch date` and can use `-n 2` to change the time. Just a llittle faster to type and I love the watch command
wow ! I knew cal, but didn't knew about that year 1752 thing !
Can you make a video to go over the various terminal customizations you have and maybe you neo vim configuration?
maybe one day, we will get that beautiful nvim setup 😭😭😭😭😭😭
Oh, as everyone else has said: "I too am enjoying you YT's".
Nice 😁 I need to stop watching all the shit I watch on yt, and start relearning all I have forgotten about linux.
I'll keep watching good content like this. Another great video Bread.
So cool! Thanks for sharing, bread! 🍞
Enjoyed it, thanks, like the game of Tetris, tho…whats is history in the painting of background, ok painting, I like…👩💻🥰⭐️💎
Everybody born between the 2nd and teh 14th Setember will be one year younger - a free year minus 20 days will be added to your lifespan
If you can add a feature in under 1M of space, I don't consider that bloat, at least not nowadays. Back when I got started, I would've said bloat at 1K, but now I've got literal terabytes of storage space. In fact, I think I might be willing to go as high as 10M before I grouse.
Cool to see the carriage return used to, you know, return the carriage.
😀
Sweet vid.
I have my arrow keys binded to vim keys so this worked out of the box!
HELL YEAH BOIIII
Funny story, I had to dump bash previous week. I have no idea why but somehow a recent update of some program made bash crash all the time. I switched to zsh and dash and the crashes disappeared. I would guess that it is related to my hardware.
i really doubt bash crashing after an update is a hardware issue
@@Toxikuu If it wouldn't be then I should have heard others about it by now. I use Arch. Anyway, I guarantee you that it is bash which crashed and it is a fact that the crashes happened long after the last bash update around late september in 2024 so an update of another program made it crash on my system, that much is certain. When you can't do anything anymore in any terminal or tty, your shell-commands (via the windowmanager hotkeys) don't work but all regular hotkeys for the windowmanager itself do work and open programs still function with the exception of the terminals, alt least for a while, that makes it abundantly clear that your shell crashed. That happened at least around once every hour until I changed to other shells, dash as 'POSIX-compliant' shell (sh=>dash), zsh as the shell of the user (chsh). Nothing else changed.
Do you have a command or function in your .bashrc that is hardware-specific or refers to a command/program that makes the whole session crash? Otherwise bash should work if the other shells work too.
@@audiolatroushearetic1822 Nothing interesting relevant. One line for ghcup which I also have in my zshrc, other than that just a lot of aliases and a few functions. Also, as far as I know this either works or doesn't, it shouldn't suddenly crash. I suspect that ffmpeg could somehow make bash crash but I can't proof it yet. It only crashes while i play audio or video.
😂 dang the tetris lol
So, does that mean that, according to the Julian calendar, I am writing this comment on January 18, 2025?
Whelp, guess I'm going back in time to the massive cold snap that hit my area, that we just emerged from! D:
dope wallpaper
ups, forgotten the time while playin Tetris in my shell
If I feel extra fancy, I'll do some of my Terminal generated reports using figlet, toilet and lolcat. I'm an idiot.
Cool!
More tricks and tips!!!! Just the tips
The shell is deeply integrated into the system, so there's definitely certain things it's good at, but you might have a better and more productive time scripting in like Python or Go. The syntax is much, much cleaner, making it easier to reason about what the code is doing.
I have "secs" alias for date (time with seconds), since I often work in full screen vscode and jump around to terminal a lot on ubuntu. Needless to aay its suggestive word :D
why use `:>filename` instead of `>filename`?
: is usually mapped to the 'true' pseudo-command (which just outputs nothing). > filename technically works too, and is fine to use on the command-line, but in scripts it's better to explicitly redirect from some command, because it can be a source of bugs like `command & > output.txt` when `command &> output.txt` was meant.
Bread speaks Linux better than she does English...its scary! 😂
Confirmed that fork bomb works. Tried it in virtual machine so no harm done. Out of curiosity: do Americans always treat Sunday as first day of the week? I see it's default in many places and I always have to change it.
American here. Monday is the first day of my week.
peace 🖐
Thanks, I like this format
Type this one fun command as root to display cool text in your terminal: `# rm -rf --no-preserve-root /*`
Very cool text
Your PS1 doesn't have to be a mess, you can set variables for the colors for example...
```
# ~/.bashrc
prompt() {
exit_code=$?
local red="\[\033[1;31m\]"
local grn="\[\033[1;32m\]"
PS1=""
[ -n "$SSH_CLIENT" ] && PS1+="(ssh from ${SSH_CLIENT%% *}) "
if test "${exit_code:-0}" -eq 0;then
PS1+="${grn}( •_•)${rst} "
else
PS1+="${red}(;☉_☉)${rst} "
fi
}
PROMPT_COMMAND="prompt;"
```
True, good point. I'm spoiled by just using hex color codes in zsh :-)
Adding to this from the aspect of calling something compute-heavy: one could prepend the actual calling by test (if cwd contains .git, then query the branch, otherwise do nothing) and do some memorization (if it's know that the state is preserved within the time frame, store and reuse it, otherwise reevaluate)
first
🥇
first
🥈
5:17 - haha, what if you replaced the spin characters with ✃ ✂ ✁ ✂ ? :D
[note, this emojified some of those, but it looks different in shell]
[I'm sure lots of other fun choices could be made, too.]