Skip to content

u/moepwizzy

In this archive from Dec 2014 to Aug 2021

2
posts
53
comments
0
media
343
score

I had something similar once. After installing Arch I wanted to try different DEs before setting everything up. I tried several and went back to i3, but to have a clean slate, I did a rm -rf ~. After that I began my normal set up.

So far so good. But at some point months later I did a typo: Instead of sudo !! to run my last command as root, I typed sudo !1. This runs the first command of the history as root. This, of course, was rm -rf ~, as the command is added to the history after execution.

Thankfully, when repeating commands like that, they are printed. But since I already had run a sudo command short before, it immediatly started deleting my files, and quite a chunk of .config was lost, before I noticed what had happend and hit CTRL+C.

So the moral of the story: Dont have rm -rf ~ as the first command in your history!

15 points

as others already said, most checks are unnecessary. But otherwise:

Line 27 and 80: Just do

yay -S $str

No need to call echo. (same for the pacman call later)

Also:

if [ -r /usr/bin/yay ]
then
    aur
else
    git clone https://aur.archlinux.org/yay-bin.git
    cd yay-bin
    makepkg -si
    aur
fi    

would imho be nicer this way:

if ! pacman -Q yay;
then
    git clone https://aur.archlinux.org/yay-bin.git
    cd yay-bin
    makepkg -si
fi
aur

since you call aur in both parts of the if clause. The pacman -Q yay is just my personal preference.

4 points

This is the command, you would accidentally copy-paste into your terminal:

git clone /dev/null; clear; echo -n "Hello ";whoami|tr -d '\n';echo -e '!\nThat was a bad idea. Don'"'"'t copy code from websites you don'"'"'t trust!
Here'"'"'s the first line of your /etc/passwd: ';head -n1 /etc/passwd
git clone git://git.kernel.org/pub/scm/utils/kup/kup.git 

Thanks to the line breaks, the malicious commands would be executed immediately

7 points

One thing I really liked in pacaur and isn't implemented in trizen (as far as I know), is viewing the build files in diff, to just see the changes to the previous version.

That would get me on board :D

8 points

it's healthy for your body. because it doesn't have any new food to take care of your body has time to clean itself. i am not religious myself, if you are curious

Meh, while I agree that fasting may be a good idea every once in a while, the body does not need time to "clean itself". If you don't do meth 24/7 your liver and kidneys shouldn't have any trouble keeping your body clean.

5 points

As Swedophone said: Try g++
But for future posts: Lines starting with four spaces are treated as code, so you can add nicely formatted code:

#include <iostream>
using namespace std;
int main() {
	cout << "Hello World"; 
	return 0; 
}
7 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.