🖥️

unix

Unix gets quite worrisome really fast

If you are on a unix-like environment, ports < 1024 (like 80) will require superuser privileges.

disk mounting and unmounting

sudo mount -o discard,defaults <diskid> <dir>

you can get the disk id by

ls -l /dev/disk/by-id

Checking disk usage

df

size of sum of files in directory

du -bch <dirname>

checking the os

lsb_release -a

or

cat etc/os-release

sudo issues

When using aws a lot of times its annoying to type sudo for all commands. instead it is much simpler to just grant super user privileges to the ubuntu user only.

in the ubuntu shell do the following

sudo su -

this should switch to a different type of shell. Now, you are in the root user shell.

from there, run

passwd ubuntu

This should prompt you to set a new username password This is just icing on the cake for future use. As, I still am unable to find the default password.

Then, run

usermod -aG sudo ubuntu

This provides super user privileges to ubuntu.

linux screen

I’ve run too many processes on a screen

list screen

screen -ls

connect to screen

screen -r <id>

remove screen

screen -S <id> -X quit 

Scroll, ctrl+A then esc and scroll

detach, ctrl+A,D

a quote i like

Frodo: “It’s a pity Bilbo didn’t kill Gollum when he had the chance.”

Gandalf: “Pity? It’s a pity that stayed Bilbo’s hand. Many that live deserve death. Some that die deserve life. Can you give it to them, Frodo? Do not be too eager to deal out death in judgment. Even the very wise cannot see all ends. My heart tells me that Gollum has some part to play in it, for good or evil, before this is over. The pity of Bilbo may rule the fate of many.”

Frodo: “I wish the Ring had never come to me. I wish none of this had happened.”

Gandalf: “So do all who live to see such times, but that is not for them to decide. All we have to decide is what to do with the time that is given to us. There are other forces at work in this world, Frodo, besides that of evil. Bilbo was meant to find the Ring, in which case you were also meant to have it. And that is an encouraging thought.” ― J.R.R. Tolkien, The Fellowship of the Ring